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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/polyfills/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


## [1.2.4] - 2020-10-20

- Updated `tslib` dependency to `^1.14.1`. [#1657](https://github.com/Shopify/quilt/pull/1657)
Expand Down
3 changes: 2 additions & 1 deletion packages/polyfills/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@
},
"homepage": "https://github.com/Shopify/quilt/blob/master/packages/polyfills/README.md",
"dependencies": {
"@babel/polyfill": "^7.10.1",
"@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

"formdata-polyfill": "^3.0.18",
"intersection-observer": "^0.5.1",
"intl-pluralrules": "^0.2.1",
"mutationobserver-shim": "^0.3.3",
"node-fetch": "^2.3.0",
"regenerator-runtime": "^0.13.7",
"tslib": "^1.14.1",
"url-polyfill": "^1.1.7",
"whatwg-fetch": "^3.0.0"
Expand Down
3 changes: 2 additions & 1 deletion packages/polyfills/src/base.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
require('@babel/polyfill');
require('core-js/stable');
require('regenerator-runtime/runtime');
15 changes: 6 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1292,14 +1292,6 @@
"@babel/helper-create-regexp-features-plugin" "^7.10.4"
"@babel/helper-plugin-utils" "^7.10.4"

"@babel/polyfill@^7.10.1":
version "7.10.1"
resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.10.1.tgz#d56d4c8be8dd6ec4dce2649474e9b707089f739f"
integrity sha512-TviueJ4PBW5p48ra8IMtLXVkDucrlOZAIZ+EXqS3Ot4eukHbWiqcn7DcqpA1k5PcKtmJ4Xl9xwdv6yQvvcA+3g==
dependencies:
core-js "^2.6.5"
regenerator-runtime "^0.13.4"

"@babel/preset-env@^7.10.4":
version "7.11.5"
resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.11.5.tgz#18cb4b9379e3e92ffea92c07471a99a2914e4272"
Expand Down Expand Up @@ -5231,7 +5223,7 @@ core-js@^1.0.0:
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=

core-js@^2.0.0, core-js@^2.4.0, core-js@^2.6.5:
core-js@^2.0.0, core-js@^2.4.0:
version "2.6.11"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c"
integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==
Expand Down Expand Up @@ -12165,6 +12157,11 @@ regenerator-runtime@^0.13.4:
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697"
integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==

regenerator-runtime@^0.13.7:
version "0.13.7"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55"
integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==

regenerator-transform@^0.14.2:
version "0.14.5"
resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.5.tgz#c98da154683671c9c4dcb16ece736517e1b7feb4"
Expand Down