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
Drop core-js 2 support #11751
Drop core-js 2 support #11751
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/24955/ |
@@ -48,11 +46,7 @@ const getValidIncludesAndExcludes = ( | |||
new Set([ | |||
...allPluginsList, | |||
...(type === "exclude" ? modulePlugins : []), | |||
...(corejs | |||
? corejs == 2 | |||
? [...Object.keys(corejs2Polyfills), ...defaultWebIncludes] |
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 like the idea of not applying web polyfills for node-only targets. However these defaultWebIncludes
are applied unconditionally. That is also why the core-js 3 support does not have defaultWebIncludes
. I think we should bring back and properly filter out web-only polyfills for node-only targets. Surely it falls into a new PR.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit aa31eb3:
|
@@ -1 +1 @@ | |||
import '@babel/polyfill'; | |||
import 'core-js'; |
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.
The CoreJS3EntryPlugin has thrown warning for @babel/polyfill
imports and it does not replace these imports to core-js
submodules. I think this behaviour is acceptable and we can preserve it in Babel 8.
The test case is about when core-js
is not specified and @babel/polyfill
is imported, it should be replaced via the usage plugin by a series of core-js
submodule imports. Since we have also changed the core-js
defaults to 3, we shall also revise this case to showcase that import "core-js"
will be replaced, too.
35bc3d2
to
aae02b5
Compare
The other breaking change I would like to see is to drop Note that if we internally make |
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* breaking(preset-env): remove corejs 2 plugin * test(preset-env): revise for corejs default value changes * test(preset-env): remove unused core-js 2 tests * breaking(transform-runtime): remove core-js 2 support * test(transform-runtime): revise for core-js 3 * test(transform-runtime): remove core-js 2 related tests * breaking(compat-data): remove core-js 2 compat data * breaking: remove corejs2 compat data proxy * chore: do not clean and force publish runtime-corejs2 * address review comments * Update packages/babel-plugin-transform-runtime/src/index.js Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com> Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* breaking(preset-env): remove corejs 2 plugin * test(preset-env): revise for corejs default value changes * test(preset-env): remove unused core-js 2 tests * breaking(transform-runtime): remove core-js 2 support * test(transform-runtime): revise for core-js 3 * test(transform-runtime): remove core-js 2 related tests * breaking(compat-data): remove core-js 2 compat data * breaking: remove corejs2 compat data proxy * chore: do not clean and force publish runtime-corejs2 * address review comments * Update packages/babel-plugin-transform-runtime/src/index.js Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com> Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This PR drops support of core-js 2 in
compat-data
,preset-env
andtransform-runtime
. It should be reviewed commit-by-commit.