Skip to content

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

Merged
merged 13 commits into from
Jul 3, 2025
Merged

Conversation

exec-astraea
Copy link
Contributor

@exec-astraea exec-astraea commented Jun 19, 2025

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. and logger 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.

@exec-astraea
Copy link
Contributor Author

Mendix 11 guide for Session Management already mentions the new login method. I decided not to touch Mendix 10 version for now. The guide is complicated enough as it is and adding blocks like "if you're below 10.22 use X otherwise Y" would make it worse 😄
We'll update the guide after MTS versions are out of support.

Copy link
Collaborator

@MarkvanMents MarkvanMents left a 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.

Comment on lines +186 to +196
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*.
Copy link
Collaborator

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.

Copy link
Collaborator

@MarkvanMents MarkvanMents left a 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.

@quinntracy
Copy link
Collaborator

@exec-astraea Mark and I have both completed our reviews. Should we merge the PR?

@exec-astraea
Copy link
Contributor Author

@quinntracy @MarkvanMents thank you! Yes, go ahead 🙂

@quinntracy quinntracy merged commit 714adc7 into mendix:development Jul 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants