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

Closed
oliviertassinari opened this issue May 8, 2024 · 1 comment · Fixed by #68290
Closed

Remove @babel/plugin-transform-classes #65540

oliviertassinari opened this issue May 8, 2024 · 1 comment · Fixed by #68290
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. locked 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
@github-actions github-actions bot added the linear: next Confirmed issue that is tracked by the Next.js team. label Jul 15, 2024
@ijjk ijjk closed this as completed in be3e330 Jul 29, 2024
samcx pushed a commit that referenced this issue Jul 29, 2024
We shouldn't include this by default in our plugins list anymore and
this should be handled by browserslist instead via `@babel/preset-env`
if browsers old enough that need this are configured. Additionally we'll
leave this configured if specific config is being provided for it to
avoid unexpected dropping.

Closes: #65540
Closes: NEXT-3598
samcx pushed a commit that referenced this issue Jul 29, 2024
We shouldn't include this by default in our plugins list anymore and
this should be handled by browserslist instead via `@babel/preset-env`
if browsers old enough that need this are configured. Additionally we'll
leave this configured if specific config is being provided for it to
avoid unexpected dropping.

Closes: #65540
Closes: NEXT-3598
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. locked Performance Anything with regards to Next.js performance. Runtime Related to Node.js or Edge Runtime with Next.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant