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

[examples] Add example using nextjs & @mui/styles as a starter for the migration to v5 #33005

Merged
merged 7 commits into from Jun 15, 2022

Conversation

mnajdova
Copy link
Member

@mnajdova mnajdova commented Jun 3, 2022

Closes #29428

The PR adds new example project that can serve as a starting point when migrating to v5. The #29428 revealed that lot of people are struggling with this, so adding the example should hopefully help.

The PR should be merged after #32740, so that we can link it where appropriate.

@mnajdova mnajdova added on hold There is a blocker, we need to wait v5.x migration examples Relating to /examples labels Jun 3, 2022
@mnajdova mnajdova requested a review from a team June 3, 2022 11:53
@mui-bot
Copy link

mui-bot commented Jun 3, 2022

No bundle size changes

Generated by 🚫 dangerJS against ccaf62e

@mnajdova mnajdova marked this pull request as ready for review June 8, 2022 08:57
@mnajdova
Copy link
Member Author

mnajdova commented Jun 8, 2022

cc @siriwatknp could you review from technical point of view?
cc @samuelsycamore this is an example project for people that use Mateiral UI v5 with @mui/styles (JSS) and nextjs, it contains all configuration required for SSR. Where do you think it's best for us to link this in the migration guide?

Should we also link it here - https://mui.com/material-ui/getting-started/example-projects/#main-content ?

@mnajdova mnajdova requested review from samuelsycamore and siriwatknp and removed request for a team June 8, 2022 08:58
@samuelsycamore
Copy link
Member

samuelsycamore commented Jun 8, 2022

@samuelsycamore this is an example project for people that use Mateiral UI v5 with @mui/styles (JSS) and nextjs, it contains all configuration required for SSR. Where do you think it's best for us to link this in the migration guide?

Good question. Both the "getting started" and the "migrating from JSS" pages contain this text:

One of the biggest changes in v5 is the replacement of JSS for Emotion as a default styling solution.

I think it would make sense to add a line or two in this section on both pages to say that you can check out this example project to see how to upgrade to v5 while continuing to use @mui/styles.

Should we also link it here - https://mui.com/material-ui/getting-started/example-projects/#main-content ?

Definitely!

I think it would also be worthwhile to write a blog post to explain the setup and hopefully catch more frustrated devs looking for a solution on Google. 😁 I'm happy to take that on.

Comment on lines 13 to 19
"@emotion/cache": "^11.7.1",
"@emotion/react": "^11.9.0",
"@emotion/server": "^11.4.0",
"@emotion/styled": "^11.8.1",
"@mui/icons-material": "^5.0.0",
"@mui/material": "^5.0.0",
"@mui/styles": "^5.0.0",
Copy link
Member

Choose a reason for hiding this comment

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

I think we should mark them as latest?

Copy link
Member

@siriwatknp siriwatknp Jun 9, 2022

Choose a reason for hiding this comment

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

@samuelsycamore I wonder if we need to mention in the migration guide that React 18 upgrade should be done after MUI upgrade?

Currently, we only mention about the minimum version of React

cc @mnajdova does it make sense?

Copy link
Member Author

Choose a reason for hiding this comment

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

React 18 upgrade should be done after MUI upgrade

If you mean: React 18 upgrade should be done after @mui/styles is replaced with one of the alternatives, than yes, good point 👍

@mnajdova mnajdova removed the on hold There is a blocker, we need to wait label Jun 9, 2022
@mnajdova mnajdova requested a review from siriwatknp June 9, 2022 13:11
@mnajdova
Copy link
Member Author

cc @siriwatknp & @samuelsycamore would be great to push this and #33063 (comment) for next week release :)

Copy link
Member

@samuelsycamore samuelsycamore left a comment

Choose a reason for hiding this comment

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

Excellent addition!

docs/data/material/migration/migration-v4/migration-v4.md Outdated Show resolved Hide resolved
examples/nextjs-with-typescript-v4-migration/README.md Outdated Show resolved Hide resolved
examples/nextjs-with-typescript-v4-migration/README.md Outdated Show resolved Hide resolved
examples/nextjs-with-typescript-v4-migration/README.md Outdated Show resolved Hide resolved
examples/nextjs-with-typescript-v4-migration/README.md Outdated Show resolved Hide resolved
examples/nextjs-with-typescript-v4-migration/README.md Outdated Show resolved Hide resolved
examples/nextjs-with-typescript-v4-migration/README.md Outdated Show resolved Hide resolved
mnajdova and others added 2 commits June 13, 2022 12:20
Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
@mhayk

This comment was marked as off-topic.

@mnajdova

This comment was marked as off-topic.

@mnajdova mnajdova merged commit 55a75d1 into mui:master Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Relating to /examples v5.x migration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nextjs + Mui V5 emotion example is still showing className mismatch error
5 participants