Skip to content

Remove @babel/plugin-transform-classes #65540

@oliviertassinari

Description

@oliviertassinari

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PerformanceAnything with regards to Next.js performance.RuntimeRelated to Node.js or Edge Runtime with Next.js.bugIssue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions