Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Replace deprecated babel-polyfills in favor of core-js and regenerator-runtime #1660

Closed
wants to merge 1 commit into from

Conversation

tleunen
Copy link
Contributor

@tleunen tleunen commented Oct 22, 2020

Description

Babel-polyfill is deprecated and shouldn't be used anymore. We should use core-js directly now.
https://babeljs.io/docs/en/babel-polyfill

I'm aware of this issue that cause the revert somehow. But I think it was caused by a misconfiguration maybe? By using core-js v3. We should also update our babel preset to configure preset-env with corejs 3, and might prevent the size increase?

Currently, we still default on v2, but consumers can customize it. Once this PR is shipped, we should default on v3. https://github.com/Shopify/web-configs/blob/ba2c02cac3fc150c5603493506e7115774335e59/packages/babel-preset/web.js#L6

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added a changelog entry, prefixed by the type of change noted above (Documentation fix and Test update does not need a changelog as we do not publish new version)

@tleunen tleunen requested review from alexandcote and a team October 22, 2020 17:47
"@shopify/useful-types": "^2.2.1",
"browser-unhandled-rejection": "^1.0.2",
"caniuse-api": "^3.0.0",
"core-js": "^3.6.5",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't v3 begin reflected in the yarn.lock 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably because other packages use v2? I haven't really looked much into that as it seems upgrading to v3 is more problematic than I thought

@@ -7,6 +7,8 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- ## [Unreleased] -->

- Replace deprecated `babel-polyfills` in favor of `core-js` and `regenerator-runtime`. [#1660](https://github.com/Shopify/quilt/pull/1660)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be a breaking change or minor?

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 think it would actually be a major since it requires consumers to run babel with the corejs v3 flag. But @alexandcote shared worries with such an upgrade as he tried to do a the same upgrade in sewing kit https://github.com/Shopify/sewing-kit/pull/1899 So I'm not exactly sure what the foundation team decided to do with this core-js upgrade

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning to do the full core-js bump during the next hack day so after BFCM most of the project will be able to use core-js 3 and new ES features.

This was referenced Dec 3, 2020
@tleunen tleunen closed this Jan 15, 2021
@tleunen tleunen deleted the babel-corejs branch January 15, 2021 15:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants