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

[material-ui][docs] Add first batch of v6 migration #42242

Open
wants to merge 10 commits into
base: next
Choose a base branch
from

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented May 14, 2024

Preview: https://deploy-preview-42242--material-ui.netlify.app/material-ui/migration/migration-v5/

Out of scope

  • Pigment CSS migration (likely to be added after beta release)

@siriwatknp siriwatknp added the docs Improvements or additions to the documentation label May 14, 2024
@siriwatknp siriwatknp changed the title [docs] Add migration for v6 [WIP][docs] Add migration for v6 May 14, 2024
@siriwatknp siriwatknp added the on hold There is a blocker, we need to wait label May 14, 2024
@mui-bot
Copy link

mui-bot commented May 14, 2024

Netlify deploy preview

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against ab5f2e4

@siriwatknp siriwatknp added this to the Material UI: v6 milestone May 16, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 17, 2024
@DiegoAndai
Copy link
Member

Hey @siriwatknp! I merged #42194. I'll complete the deprecations section as soon as possible.

@DiegoAndai DiegoAndai self-assigned this May 24, 2024
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels May 28, 2024
@mnajdova
Copy link
Member

mnajdova commented Jun 5, 2024

Decide on the minimum React & TypeScript version

On React, we decided on React 17

Signed-off-by: Diego Andai <diego@mui.com>
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 5, 2024
@DiegoAndai
Copy link
Member

@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 components and componentsProps to the deprecation section 😅 I just haven't had time yet, but I'll get to it.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 10, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 11, 2024
@siriwatknp siriwatknp changed the title [WIP][docs] Add migration for v6 [docs] Add first batch of v6 migration Jun 11, 2024
@siriwatknp siriwatknp marked this pull request as ready for review June 11, 2024 06:38
@siriwatknp siriwatknp added v6.x migration and removed on hold There is a blocker, we need to wait labels Jun 11, 2024
Copy link
Contributor

@danilo-leal danilo-leal left a 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!

Copy link
Contributor

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?

Copy link
Member Author

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 🤔

Copy link
Member

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:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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" 😅

Comment on lines +28 to +30
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.
Copy link
Contributor

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:

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Node 18 (up from 12)
- Node.js 18 (up from 12)

@danilo-leal danilo-leal added the package: material-ui Specific to @mui/material label Jun 11, 2024
@danilo-leal danilo-leal changed the title [docs] Add first batch of v6 migration [material-ui][docs] Add first batch of v6 migration Jun 11, 2024
@DiegoAndai
Copy link
Member

are we not mentioning React 19 as a v6 highlight?

Not ready yet so I think we can add it when it is

@DiegoAndai
Copy link
Member

@siriwatknp I added the section about components and componentsProps deprecations.

As discussed, the *Component, *Props, and composed classes deprecations will continue to be added after v6 release, so I'm not mentioning them here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation package: material-ui Specific to @mui/material v6.x migration
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

None yet

5 participants