Skip to content
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

[blog] React 19 migration for MUI X #45348

Merged
merged 12 commits into from
Feb 26, 2025
Merged

Conversation

arminmeh
Copy link
Contributor

@arminmeh arminmeh commented Feb 18, 2025

@mui-bot
Copy link

mui-bot commented Feb 18, 2025

Netlify deploy preview

https://deploy-preview-45348--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 7f0f735

@mapache-salvaje
Copy link
Contributor

Nice! I haven't reviewed the post yet but I love to see this kind of "behind the scenes" content for the blog! 🙌

Copy link
Contributor

@alelthomas alelthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great @arminmeh 🎉 Just made some small suggestions for grammar/readability

@arminmeh
Copy link
Contributor Author

This is great @arminmeh 🎉 Just made some small suggestions for grammar/readability

Thanks @alelthomas
Applied all of them

Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice. I just left comments that are more a matter of taste than recommendation. feel free to ignore :)

We were lucky that we didn't have to change much in the source code, but a lot of changes had to be made to our tests because of the modifications related to [strict mode](https://react.dev/blog/2024/04/25/react-19-upgrade-guide#strict-mode-improvements) and [error reporting](https://react.dev/blog/2024/04/25/react-19-upgrade-guide#errors-in-render-are-not-re-thrown).
These changes caused a different call count for our spies and different console outputs, so we had to expect different values based on the React major.

`@mui/internal-test-utils` provides an export `reactMajor` that extracts the major version of the React version used in the test.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal is not to encourage them to use our internal-test-utils but to rewrite their own

Suggested change
`@mui/internal-test-utils` provides an export `reactMajor` that extracts the major version of the React version used in the test.
:::info
To know which version of React is running, they provide a nice helper
```js
import * as React from 'react';
const reactMajor = parseInt(React.version, 10);
```
:::

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need the actual snippet 🤔

Copy link
Contributor

@mapache-salvaje mapache-salvaje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions for title, description, and intro—I'll come back to review the rest tomorrow.

Copy link
Member

@cherniavskii cherniavskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great initiative!
Added my five cents below 🙂

Copy link
Contributor

@mapache-salvaje mapache-salvaje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two tiny style suggestions, otherwise I think this is ready to publish. Great job @arminmeh !

@arminmeh arminmeh merged commit a85cdb7 into mui:master Feb 26, 2025
22 checks passed
@arminmeh arminmeh deleted the blog-post-r19 branch February 26, 2025 19:55
arminmeh added a commit to arminmeh/material-ui that referenced this pull request Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants