-
-
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] Remove core-js 2 and regenerator from preset-env #15838
Conversation
@@ -0,0 +1,9 @@ | |||
// TODO(Babel 8): Remove this file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rewrote the files in this folder to CJS so that they can easily be conditionally required.
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/55660/ |
b41b429
to
4624ff2
Compare
I mark this PR as breaking change because the preset-env options |
57d9ed5
to
be33b0e
Compare
@@ -90,10 +90,9 @@ | |||
"@babel/plugin-transform-unicode-regex": "workspace:^", | |||
"@babel/plugin-transform-unicode-sets-regex": "workspace:^", | |||
"@babel/preset-modules": "0.1.6-no-external-plugins", | |||
"@babel/types": "workspace:^", | |||
"babel-plugin-polyfill-corejs2": "^0.4.5", | |||
"babel-plugin-polyfill-corejs2": "condition:BABEL_8_BREAKING ? : ^0.4.5 (peer:@babel/core)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(peer:@babel/core)
is to correctly propagate the @babel/core
dep provided by @babel/preset-env
to babel-plugin-polyfill-corejs2-BABEL_8_BREAKING-false
.
5e1c443
to
cc682d0
Compare
* Remove getPolyfillPlugins from the public API * Only load babel 7 polyfill plugins when used * Support `@babel/core` cjs proxy in local dev
cc682d0
to
c85defd
Compare
It's bee two months since I touched this code -- I self-reviewed it and it seems good. It only changed Babel 8 behavior, and in Babel 7 everything behaves the same (including "accidentally exposed" function from I'm merging this, because this PR touches a lot of files and rebasing it is difficult every time. |
@@ -0,0 +1,4 @@ | |||
/* eslint-disable */ | |||
module.exports = require("$repo-utils").USE_ESM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this file be preserved on release? We should not depend on $repo-utils
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in .npmignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/babel/babel/pull/15838/files#diff-82bd9573b4cb005e6b3183120e5379562c70d9c37e57893a8224f6a89dc77623R116
Will it still remain in exports
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #1, Fixes #2
This PR removes support for
babel-plugin-polyfill-corejs2
andbabel-plugin-polyfill-regenerator
from@babel/preset-env
:If users still need those two plugins (for example, because they are manually writing references to
regeneratorRuntime
in their code, or because they cannot migrate to core-js 3), they can still use them directly rather than through preset-env.The deleted corejs2 tests already have equivalent corejs2-babel7 folders, so the deleted files are only for Babel 8.
I will open a similar PR for
transform-runtime
.