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
Default in Babel 8 to use @babel/plugin-transform-runtime #13157
Comments
Hey @thernstig! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite." |
I think it's time to revive this thread now. Let's extend the requirement first:
From my perspective, Babel is on the right track. In my usecase for building a frontend app with the advantages listed:
My config looks like this: // @filename: babel.config.mjs
return {
plugins: [
'@babel/plugin-transform-runtime', { moduleName: '@babel/runtime' },
'babel-plugin-polyfill-corejs3', { method: 'usage-global' },
],
presets: [
['@babel/preset-env', {...}], // without "useBuiltIns".
// ...
]
} As you can see, there are still some leaky abstractions. (I will explain the details for beginners in the following section.) But I think it is a good starting point for asking some questions:
The following section is written for beginners. It's intended to summarize/clarify the long-opening thread: For a better referencing experience, please right-click every link with "Open Link in New Tab" to trigger the decent text-fragment feature I managed really hard for you. 🤔 Using
|
Feature Request
Is your feature request related to a problem?
We all want our bundles to be as small as possible. Using
@babel/plugin-transform-runtime
definitely does this.Describe the solution you'd like
It would be nice if
@babel/plugin-transform-runtime
was run by default. This helps double-up since first it will inject imports into files instead of helper functions, and then bundlers like Webpack will be even smarter to just use the code once. This is only beneficial to users.Documentation, Adoption, Migration Strategy
This needs to be done in babel 8 to not break current users setup.
The text was updated successfully, but these errors were encountered: