Skip to content
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

Merged
merged 11 commits into from Jul 1, 2020
Merged

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Jun 26, 2020

Q                       A
Fixed Issues? #10746 (comment)
Major: Breaking Change? Yes
Tests Added + Pass? Yes
Documentation PR Link babel/website#2765
Any Dependency Changes?
License MIT

This PR drops support of core-js 2 in compat-data, preset-env and transform-runtime. It should be reviewed commit-by-commit.

@JLHwung JLHwung added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release pkg: preset-env pkg: compat-data labels Jun 26, 2020
@JLHwung JLHwung added this to the Babel 8.0 milestone Jun 26, 2020
@babel-bot
Copy link
Collaborator

babel-bot commented Jun 26, 2020

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]
Copy link
Contributor Author

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.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 26, 2020

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:

Sandbox Source
thirsty-star-nzygq Configuration
happy-davinci-mgcdg Configuration

@@ -1 +1 @@
import '@babel/polyfill';
import 'core-js';
Copy link
Contributor Author

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.

@nicolo-ribaudo nicolo-ribaudo mentioned this pull request Jun 26, 2020
34 tasks
@nicolo-ribaudo
Copy link
Member

The other breaking change I would like to see is to drop @babel/runtime-corejs3 and directly inject imports to core-js-pure.

Note that if we internally make @babel/runtime and useBuiltIns delegate to https://github.com/babel/babel-polyfills (and I think that we should, so that we don't have to maintain the same duplicated thing) it will happen automatically.

JLHwung and others added 2 commits June 30, 2020 14:43
@JLHwung JLHwung merged commit ffa4bb3 into babel:next-8-dev Jul 1, 2020
@JLHwung JLHwung deleted the drop-core-js-2-support branch July 1, 2020 21:14
nicolo-ribaudo added a commit that referenced this pull request Jul 5, 2020
* 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>
nicolo-ribaudo added a commit that referenced this pull request Aug 28, 2020
* 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>
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 1, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2020
@JLHwung JLHwung removed this from the v8.0.0 milestone Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: compat-data pkg: preset-env PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants