-
Notifications
You must be signed in to change notification settings - Fork 743
Client API updates #9709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client API updates #9709
Conversation
Mendix 11 guide for Session Management already mentions the new |
content/en/docs/howto/extensibility/build-javascript-actions/write-javascript-github.md
Outdated
Show resolved
Hide resolved
content/en/docs/howto/extensibility/build-javascript-actions/write-javascript-github.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a couple of comments about the things which have been taken out of the Mendix 10 version of the document and how that affects customers who are still on earlier versions of Mendix (10.12 or 10.18).
Can you have a look and see if we need to keep some of that documentation to support customers who cannot upgrade quickly.
content/en/docs/howto/extensibility/best-practices-javascript-actions.md
Show resolved
Hide resolved
content/en/docs/howto/extensibility/best-practices-javascript-actions.md
Show resolved
Hide resolved
content/en/docs/howto10/extensibility/best-practices-javascript-actions.md
Outdated
Show resolved
Hide resolved
import { create } from "mx-api/data" | ||
|
||
try { | ||
const cat = await create({ entity: "MyFirstModule.Cat" }) | ||
console.log("Object created on server:", cat); | ||
} catch (err) { | ||
console.error("Could not commit object:", err); | ||
} | ||
``` | ||
|
||
For more information on creating objects, consult the [Create](https://apidocs.rnd.mendix.com/10/client/mx.data.html#.create) section of the *Mendix Client API*. | ||
For more information on creating objects, consult the [Create](https://apidocs.rnd.mendix.com/10/client-mx-api/module-mx-api_data.html#.create) section of the *Mendix Client API*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to keep the old information as well for those who are still using MTS versions of Mendix 10.
content/en/docs/howto10/extensibility/build-javascript-actions/write-javascript-github.md
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made the versioning information clearer in this commit: 3a3598d
Looks OK to me.
content/en/docs/howto/extensibility/best-practices-javascript-actions.md
Show resolved
Hide resolved
content/en/docs/howto10/extensibility/best-practices-javascript-actions.md
Outdated
Show resolved
Hide resolved
content/en/docs/howto10/extensibility/build-javascript-actions/write-javascript-github.md
Show resolved
Hide resolved
@exec-astraea Mark and I have both completed our reviews. Should we merge the PR? |
@quinntracy @MarkvanMents thank you! Yes, go ahead 🙂 |
In Mendix 10.22 we introduced the new Client API. It uses promises and works as a modern JS module instead of being attached to the global window object.
This PR removes all mentions of the old
mx.
andlogger
APIs for Mendix 10 and 11. JS actions guide was also partially rewritten using new APIs.Note that docs still mention
mx.session.getConfig("csrftoken")
in Mendix 10 guide.getCSRFToken
was introduced quite late (Mendix 10.23). Plus, at the moment there is no way to import the new API in pluggable widgets.We'll revise these docs after 10.6, 10.12 and 10.18 are out of support and after
getCSRFToken
is availaible in Pluggable Widgets.