-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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] Use Next.js 14 on examples #44486
base: master
Are you sure you want to change the base?
Conversation
a6a47bc
to
bb74dcf
Compare
Netlify deploy previewhttps://deploy-preview-44486--material-ui.netlify.app/ Bundle size report |
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.
Nice!
Agreed—I would always rather have a (potentially slightly outdated) stable integration over the latest release if there's a chance that the latest will be broken (in which case I'll have to downgrade anyway and wait for a fix). I think developers would lose trust if our official examples won't run reliably, so we should be more proactive about maintaining them at specific versions. |
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.
nitpick copyedit for the readme text but tentatively approving 👍
## Upgrading to Next.js 15 | ||
|
||
This example uses Next.js 14. | ||
To upgrade to Next.js 15, please follow their [upgrade guide](https://nextjs.org/docs/app/building-your-application/upgrading/version-15). |
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.
to make it more explicit that this a link to the Next.js docs
To upgrade to Next.js 15, please follow their [upgrade guide](https://nextjs.org/docs/app/building-your-application/upgrading/version-15). | |
To upgrade to version 15, please follow the [official upgrade guide](https://nextjs.org/docs/app/building-your-application/upgrading/version-15) in the Next.js docs. |
I was confused about this. How so?
I would expect the opposite as a developer, I would want to start with Next.js 15. Why would a developer want to start a new project with an older version?
This was by design, the objective was to get those reported quickly, so we can fix them in a matter of hours/days rather than weeks. |
There are two separate but related issues:
"react": "latest"
and"react-dom": "latest"
. In theory, both should be"rc"
until React 19 is stable (then it becomes"latest"
). Next.js 15 is constantly updating to the latest"rc"
releases.@mui
packages indicate"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
as peer dependency (same for react-dom), but npm doesn't recognize the 19.0.0-rc versions to be included in that range, so a warning/error is logged whennpm i
is run. This doesn't happen with yarn or pnpm.We could update our Next.js examples to
"react": "rc"
and our peer dependency ranges to17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc
, but it won't improve anything for our users because:My proposal in this PR is to downgrade the examples to Next.js 14 until React 19 is stable.
I also added a link to Next.js upgrade guide to each example's README. The upgrade process is pretty straightforward. It also warns about the
npm i
issue, so users know what to do: https://nextjs.org/docs/app/building-your-application/upgrading/version-15.On a related note, pointing to the
"latest"
version of a framework in our examples seems risky. It seems safer to point to a specific major and update them on major releases to make sure they work with the new major.