-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
[material-ui][docs] Add first batch of v6 migration #42242
base: next
Are you sure you want to change the base?
Conversation
Netlify deploy previewBundle size report |
Hey @siriwatknp! I merged #42194. I'll complete the deprecations section as soon as possible. |
On React, we decided on React 17 |
Signed-off-by: Diego Andai <diego@mui.com>
@siriwatknp I updated the PR after some breaking changes were added to the migration guide in other PRs. I haven't forgotten about adding the |
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.
Looking great! Curious to see what Sam thinks of all these suggestions 😬
Also, are we not mentioning React 19 as a v6 highlight? 🤔 I think we should!
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.
The URL name confused me 😅 It makes me think that this is docs for migrating to v5 instead of from v5 to v6. Maybe we should change it to: migrating-to-v6
?
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.
Me too. I am not sure why all the previous migration pages use this pattern 🤔
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.
Yeah I was confused as well when I created the files 😅: #41561 (comment). But I just followed the convention.
I think migrating-to-vX
is a better convention, assuming we're always migrating from vN to vN+1.
@@ -11,35 +11,78 @@ In the `package.json` file, change the package version from `latest` to `next`. | |||
+"@mui/material": "next", | |||
``` | |||
|
|||
If you are one of these packages, be sure to change the version to `next` too: |
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.
If you are one of these packages, be sure to change the version to `next` too: | |
If you use one of these packages, change the version to `next` too: |
I assume the original copy was saying "if you are using" 😅
Material UI v6 includes many bug fixes and improvements over v5. | ||
|
||
The biggest highlight in v6 is the opt-in support for Pigment CSS which enable styles extraction that get rid of style recalculation and reduce bundle size. |
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'd glue these sentences here with something like:
Material UI v6 includes many bug fixes and improvements over v5. | |
The biggest highlight in v6 is the opt-in support for Pigment CSS which enable styles extraction that get rid of style recalculation and reduce bundle size. | |
Material UI v6's biggest highlight is the inclusion of Pigment CSS, a next-gen zero-runtime CSS-in-JS library, as an opt-in styling engine. | |
Using it will make your project compatible with React Server Components and reduce its bundle size due to the styles extraction, avoiding client-side recalculation. |
|
||
The biggest highlight in v6 is the opt-in support for Pigment CSS which enable styles extraction that get rid of style recalculation and reduce bundle size. | ||
|
||
Apart from the support for Pigment CSS, the v6 release provides a stable API for adopting CSS variables which open more customization possibilities and offers a more enjoyable developer experience. |
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.
Apart from the support for Pigment CSS, the v6 release provides a stable API for adopting CSS variables which open more customization possibilities and offers a more enjoyable developer experience. | |
Aside from that, the CSS variables API for Material UI is now stable in v6. | |
Relying on CSS variables allows for more intricate customization possibilities and better overall DX. |
|
||
Apart from the support for Pigment CSS, the v6 release provides a stable API for adopting CSS variables which open more customization possibilities and offers a more enjoyable developer experience. | ||
|
||
Additionally, the v6 release does not include major breaking changes, apart from the browser support & node.js version bump. Instead, they are deprecated to bring more consistent developer experience which can be migrated using our codemods. |
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.
Additionally, the v6 release does not include major breaking changes, apart from the browser support & node.js version bump. Instead, they are deprecated to bring more consistent developer experience which can be migrated using our codemods. | |
A major feedback we've learned from the v5 cycle is to reduce the number of breaking changes to the smallest. | |
Material UI v6 does exactly that: minimal breaking changes, including only browser support updates and a Node.js version bump. | |
These updates can, for the most part, be migrated automatically via codemods. |
It feels important to highlight how this contrasts with v5 and be accountable to the community that we've learned the lesson here. Also added "for the most part" as I wasn't sure if the codemods could tackle everything, so feel free to drop it if that's the case.
|
||
### System props | ||
|
||
System props are deprecated in `Box`, `Typography`, `Link`, `Grid`, and `Stack` components. |
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.
System props are deprecated in `Box`, `Typography`, `Link`, `Grid`, and `Stack` components. | |
System props, such as `mt={*}`, `color={*}`, and others, are deprecated in the Box, Typography, Link, Grid, and Stack components. |
Just to give quick examples here. It'd be even better if we linked to a place where I could see all previously existing system props. Also removing the backticks from the components.
|
||
### Theme component variants | ||
|
||
Theme component variants has been merged with the theme style overrides by targeting the `root` slot of the component: |
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.
Theme component variants has been merged with the theme style overrides by targeting the `root` slot of the component: | |
Custom component variants defined in the theme are now merged with the theme style overrides, defined within the `root` slot of the component: |
Changing the tense here. Also, saying "custom component variants defined in theme" sounds clearer than "theme component variants", which I had to stop for a second to understand what it was.
}) | ||
``` | ||
|
||
This reduces the API surface and let you define variants in other slots of the component. |
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.
This reduces the API surface and let you define variants in other slots of the component. | |
This reduces the API surface and lets you define variants in other slots of the component. |
We try to align with types released by [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) (that is packages published on npm under the `@types` namespace). | ||
|
||
We will not change the minimum supported version in a minor version of Material UI. | ||
However, we generally recommend not to use a TypeScript version older than the lowest supported version of DefinitelyTyped. |
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.
However, we generally recommend not to use a TypeScript version older than the lowest supported version of DefinitelyTyped. | |
However, we recommend not using a TypeScript version older than the lowest supported version by DefinitelyTyped. |
<!-- #stable-snapshot --> | ||
|
||
- Node 18 (up from 12) |
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.
- Node 18 (up from 12) | |
- Node.js 18 (up from 12) |
Not ready yet so I think we can add it when it is |
@siriwatknp I added the section about As discussed, the |
Preview: https://deploy-preview-42242--material-ui.netlify.app/material-ui/migration/migration-v5/
Out of scope