-
-
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
[core] Adopt pnpm catalogs for React deps #43455
Conversation
Netlify deploy previewhttps://deploy-preview-43455--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
One drawback I could think of us that it's now harder for tooling to statically analyze the versions in package.json. Was the |
It should work for But I agree catalogs can come with some downsides e.g. doesn't support |
c922531
to
f20bebe
Compare
This is what a script should do to change React packages versions: 810387c#diff-18ae0a0fab29a7db7aded913fd05f30a2c8f6c104fadae86c9d217091709794c The idea would be to keep in pnpm-workspace.yaml all of the different catalog versions (react19, react17, etc.) so a script would only require to replace the |
Alternatively: keep multiple |
That's a great idea. The only downside I can think of is parts of the file getting out of sync (e.g. the packages list) |
f20bebe
to
3b22771
Compare
3b22771
to
8d11924
Compare
This should work:
I'm a bit hesitant using catalogs as it doesn't feel like a cemented feature in package managers, it doesn't seem like even pnpm has fully adopted support for it. If a classic solution works just as well, I think I'd prefer it over creating potential tech debt. And in any case, once pnpm adds support for catalogs in their update command, I believe our solution would look very similar. (e.g. |
TIL! I thought using I totally agree with your points. I'll close this experiment |
In case someone lands on this PR while adopting catalogs in the future, a benefit of catalogs is being able to specify them in material-ui/packages-internal/test-utils/package.json Lines 65 to 68 in 08ea93e
peerDependencies fields are not updated, wrong package versions get installed.
|
Adopts pnpm catalogs for React dependencies to have an easier way to share the same version between different packages.
This will also make it easier to fix the
react-next
CI pipeline by having a centralized place to upgrade React packages versions. TheuseReactVersion.js
script is very outdated and thereact-next
pipeline has been broken for a long time.Q: we have some packages under
test/bundling/fixtures
that define their own React version. Do we want these to use the centralized React version, too?