-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[babel 8] Cleanup @babel/plugin-transform-runtime
options
#16310
Comments
There is a problem regarding #16241, and I believe this is something that needs to be considered during your cleanup of
And now I got the same error saying I'm using
So it seems that the option default '@babel/plugin-transform-runtime', { moduleName: '@babel/runtime', regenerator: false },
'babel-plugin-polyfill-corejs3', { method: 'usage-global' },
'babel-plugin-polyfill-regenerator', { method: 'usage-global' } This doesn't work in that '@babel/plugin-transform-runtime', { moduleName: '@babel/runtime' },
'babel-plugin-polyfill-corejs3', {
method: 'usage-global',
['#__secret_key__@babel/preset-env__compatibility']: {
noRuntimeName: true,
},
}, After all, I feel it is very counter-intuitive when I set |
Oh this is a bug in the new option. Feel free to open a separate PR, otherwise I'll take a look at it probably on Monday. |
I can wait since I haven't done it before and you probably know how to do it more concisely. On the other hand, could you please make it show some warning when two different runtimes, e.g. in my case |
@nyngwang The import to Note that if you specify the |
To @nicolo-ribaudo:
If the import to
On the other hand, I wonder about the difference between injecting |
|
So the same thing is achieved, but it's just that nothing is a special case, right? |
Yes :) |
I like this :) Sounds like a really good decision for me! Great that Babel 8 (or I should say now) has it! |
Basically, make it only to inject imports to helpers
corejs
option, and recommendbabel-plugin-polyfill-corejs3
directly. [note: when the polyfill provider is enabled, we will still inject imports to@babel/runtime-corejs3
instead of@babel/runtime
]helpers
option (and make ittrue
)runtime
option (and make itfalse
), since it's mostly not needed anymore now that we directly inject imports to@babel/runtime/helpers/regeneratorRuntime
. For the edge case mentioned in [Bug]: Generator functions cannot be converted using only @babel/plugin-transform-runtime #16260 (comment), people can still usebabel-plugin-polyfill-regenerator
.Then, clean up the docs at https://next.babeljs.io/docs/babel-plugin-transform-runtime/
The text was updated successfully, but these errors were encountered: