-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Remove outdated Babel plugins #42140
[core] Remove outdated Babel plugins #42140
Conversation
Netlify deploy previewhttps://deploy-preview-42140--material-ui.netlify.app/ @material-ui/core: parsed: -3.86% 😍, gzip: -3.80% 😍 Bundle size reportDetails of bundle changes (Toolpad) |
Any idea where this 18% increase comes from? |
Not sure. It seems to be related to the |
You could try running
on master and copy the |
@Janpot Yesterday, I spent quite some time checking and debugging. I compared the development files instead of the production ones because the production file is unreadable, likely due to terser. Here's what I did:
Here's a sample diff which is the same till the end: umd.builds.diff.mp4What I noticed is that it's using What I don't understand is why rollup's babel is using the |
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.
Yesterday, I spent quite some time checking and debugging.
Uff, I'm sorry, that was not my intention. I believe the UMD bundle is up for removal in v6. We have visualized now the added code in the bundle, at least we now know it's in the bundling and not in the size calculation. Let's not waste more time on debugging this. For me this PR is good to merge after UMD is removed.
@ZeeshanTamboli I plan to work on the UMD removal hopefully this week or next, but if you want to unblock this PR by removing it yourself, feel free to go ahead. |
How about we open a new issue for this? https://pagespeed.web.dev/analysis?url=https%3A%2F%2Fdeploy-preview-42140--material-ui.netlify.app%2F This can be reproduced too in HEAD. I imagine that Lighthouse uses Seeing this on https://deploy-preview-42140--material-ui.netlify.app/ is wrong: We should at minimum go into loose mode: https://github.com/vercel/next.js/blob/5ff2731c589692ed86379f876a38e1ca46f5761e/packages/next/src/build/babel/preset.ts#L161. I also left the feedback in vercel/next.js#65540. |
@DiegoAndai Thanks. I've already begun working on this yesterday. Here's the PR: #42172. Feel free to push any changes if needed.
@oliviertassinari Do we need to make any changes outside of this PR? I suppose it's all related to Next.js with the new issue you created there. |
Given the Next.js team's track record with the maintenance of the babel setup in Next.js I would assume we'll be using their SWC setup before this gets fixed 😄. Btw, yesterday, on top of this PR on the X repo I did a few quick tests and I could just remove the babel config without breaking their build. Page compilation in dev mode went from ~8s to ~4.5s on my machine. I couldn't enable turbopack due to our usage of |
@ZeeshanTamboli would it be possible to come up with a detailed list of Safari 12 features that will stop working on v6? This is so users can adjust accordingly. |
@DiegoAndai I'm not familiar with the specific features of Safari 12, but whatever was available in Safari 12 will be carried forward to the newly supported Safari 15.6 version. We can document the list of supported browser versions, as done in the Migrating to v5 docs, but that should be done in a separate PR. |
@Janpot @DiegoAndai Now that #42172 is merged, this PR is ready for review. |
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.
Good to go 👍
@ZeeshanTamboli Not for this PR, but there is something for docs-infra here, issue created #42385. |
Part of #40958.
With the updated browser support, particularly for the new Safari browser, it seems we no longer require these plugins. Previous attempted PRs mentioned in #40958.
Additionally, it appears that the
assumptions
feature of Babel is also not needed. This closes #37461.The plugins are now included by default in the latest version of
@babel/preset-env
. They are applied based on the browsers listed inbrowserslist
, with Babel maintaining a mapping of versions for each plugin here.browserstack-force
run for Safari: https://app.circleci.com/pipelines/github/mui/material-ui/128548/workflows/5eb395f3-c3f8-4e63-bdd3-f51a5e790419/jobs/693108Bundle size reduction.