Drop core-js 2 support#11751
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/24955/ |
| ...(type === "exclude" ? modulePlugins : []), | ||
| ...(corejs | ||
| ? corejs == 2 | ||
| ? [...Object.keys(corejs2Polyfills), ...defaultWebIncludes] |
There was a problem hiding this comment.
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.
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 <[email protected]>
* 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 <[email protected]> Co-authored-by: Nicolò Ribaudo <[email protected]>
* 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 <[email protected]> Co-authored-by: Nicolò Ribaudo <[email protected]>
This PR drops support of core-js 2 in
compat-data,preset-envandtransform-runtime. It should be reviewed commit-by-commit.