-
-
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
[v6] Upgrade minimum version of Node.js #32546
Comments
cc: @mui/core |
We can use a recent Node version for building the library, but I'd leave Node 12 for tests as we still support it. We will likely drop support for it with the next major version. |
Maybe we should link this issue in the next major version roadmap. Or somewhere else. |
Just a quick update, Node.js 16 is now unsupported, so we probably want to bump this up to 18. |
v18 is in maintenance mode, so I'd say we should go for 20. |
I fail to see how removing support for the older versions of Node.js is helpful. For example, React has https://unpkg.com/[email protected]/package.json:
What would be the value? |
For example, being able to use native ES modules. |
Based on mui/mui-x#10997 (comment), I think we should follow this strategy:
The main reason is that it's not really our role to tell developers which Node.js version to use. As a developer, you shouldn't have to upgrade your Node.js version or use a newer version of Material UI if you use a version Node.js version that is not completely outdated, it's friction, not great DX. This wouldn't be against https://mui.com/material-ui/getting-started/supported-platforms/#server "The objective is to support Node.js down to the last version in maintenance mode", developers won't complain that we support older versions unless it harms the experience with more recent versions. Today, the ecosystem seems to be:
So from an ecosystem perspective v12 seems OK but maybe with v14, it would still be on the safe side. |
There doesn't seem to be an agreement in #40958.
Agree, it's not. Node.js itself tells developers which versions not to use by putting them out of maintenance. We can follow their guidance. I'm not advocating for increasing the minimum version just for the sake of it, but using older versions comes with a couple of issues:
|
This alone would be a big win! (#39765) |
@michaldudak Agree, it makes sense to increase the version of the CI to not fall behind Node.js LTS.
We will see, but I suspect that the ecosystem isn't ready for a ESM only package, so I suspect that v6 would be a hybrid version: https://twitter.com/wooorm/status/1663129796195364865.
So far, we have relied on bug reports, and fixing them. I imagine that having one smoke server-side rendering test could be enough. Is it worth the effort? If there are users using older versions of Node.js I think so. If there aren't enough developers, then it might not be worth the effort to maintain. Now, honestly, I don't see this as being a lot of work. Create a new npm package, use the build output, run a simple node server that render a few components, see if it fails or if it works. |
Not sure who's using Node.js v6 and at the same time is serverside rendering React 😄, but I'd love to see how they've got that set up. Webpack is used as well for other purposes than React and those are more than likely the ones v6 support exists for.
We do tell them which browsers to use though. When they want to use older than supported browsers they'll have to transpile the packages themselves. One could argue that the same should apply to node.js versions. (although here they'd also have to configure their package manager to ignore the engines field)
According to their docs v12 is the first version that declares ESM stable. So I guess there is no real problem on this front? Anyway, I'm personally with @oliviertassinari here, also leaning towards keeping the engines field for node on a low version in our packages. I don't think at the moment it blocks us from moving forward with anything, but:
|
I'm moving this out of the v6 milestone per the last comment. Upgrading the minimum version of node at this moment doesn't seem to bring any benefit to users, and it's not blocking anything either. Please let me know if this should be reconsidered. |
Being lazy, and waiting to see the problem, makes sense to me. I'm amazed by how quickly developers moved in 6 months, compared to #32546 (comment) "Today, the ecosystem seems to be" with today -Next.js: the most used version is v12. That Next.js version works down to node v12
+Next.js: the most used version is v14. That Next.js version works down to node v18 -Webpack: there are 50% of the users on v4 supports node down to v6
+Webpack: there are 24% of the users on v4 supports node down to v6. v5 supports node down to v10 -Vite: most of the users are on v4 which supports node down to v14
+Vite: most of the users are on v5 which supports node down to v18 -pnpm latest: https://unpkg.com/pnpm@latest/package.json supports node down to v16
+pnpm: most of the users are on v8 which supports node down to v18 |
I have just realized that MUI X is on Node.js v14 as their minimum version: mui/mui-x#6966. It feels like we should sync those two so developers have a more consistent experience. |
Updated #42920 to sync version with MUI X |
Merged #42920, Material UI is now synced with MUI X, closing this one. |
Summary 💡
Node v12 has reached end-of-life rather its ended. https://nodejs.org/en/about/releases/
material-ui/packages/mui-material/package.json
Lines 112 to 113 in ac99485
Examples 🌈
Similar to dropping support for node v10 in #25306.
Motivation 🔦
The text was updated successfully, but these errors were encountered: