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

Remove @babel/plugin-transform-classes #65540

Open
oliviertassinari opened this issue May 8, 2024 · 0 comments
Open

Remove @babel/plugin-transform-classes #65540

oliviertassinari opened this issue May 8, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Performance Anything with regards to Next.js performance. Runtime Related to Node.js or Edge Runtime with Next.js.

Comments

@oliviertassinari
Copy link
Contributor

oliviertassinari commented May 8, 2024

To Reproduce

[
require('next/dist/compiled/babel/plugin-proposal-class-properties'),
options['class-properties'] || {},
],

Current vs. Expected behavior

Include @babel/plugin-transform-classes vs. Removed

Provide environment information

HEAD

Which area(s) are affected? (Select all that apply)

Performance, Runtime

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)

Additional context

I saw it in https://pagespeed.web.dev/analysis?url=https%3A%2F%2Fdeploy-preview-42140--material-ui.netlify.app%2F

SCR-20240508-qkhd

Lighthouse warns about the use of legacy transformations, from https://github.com/GoogleChrome/lighthouse/blob/369979f498bd6560127e10476edffb264d4fa3b9/core/audits/byte-efficiency/legacy-javascript.js#L301.

By the look of today's browser support for ES6 Class https://caniuse.com/es6-class, it seems like we should be able to remove this from the default Babel plugin configuration and leave it to be added opt-in by developers. At least, if not for the next major release, in the next few months.

@oliviertassinari oliviertassinari added the bug Issue was opened via the bug report template. label May 8, 2024
@github-actions github-actions bot added Performance Anything with regards to Next.js performance. Runtime Related to Node.js or Edge Runtime with Next.js. labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Performance Anything with regards to Next.js performance. Runtime Related to Node.js or Edge Runtime with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant