From c8c36596018f927770d2fc88076288d18e342029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20C=C3=B4t=C3=A9?= Date: Wed, 17 Jun 2020 08:29:28 -0400 Subject: [PATCH] Fix an issue with bundle size increased --- packages/polyfills/CHANGELOG.md | 4 +++- packages/polyfills/package.json | 3 +-- packages/polyfills/src/base.ts | 15 +-------------- yarn.lock | 8 ++++++++ 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/packages/polyfills/CHANGELOG.md b/packages/polyfills/CHANGELOG.md index f45db5b45b..300f14bc0e 100644 --- a/packages/polyfills/CHANGELOG.md +++ b/packages/polyfills/CHANGELOG.md @@ -5,7 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - +## [Unreleased] + +- Fix an issue with bundle size increased by ~20kb [#1518](https://github.com/Shopify/quilt/pull/1518) ## [1.2.0] - 2020-05-27 diff --git a/packages/polyfills/package.json b/packages/polyfills/package.json index 3785b58f8d..71294630c3 100644 --- a/packages/polyfills/package.json +++ b/packages/polyfills/package.json @@ -24,16 +24,15 @@ }, "homepage": "https://github.com/Shopify/quilt/blob/master/packages/polyfills/README.md", "dependencies": { + "@babel/polyfill": "^7.10.1", "@shopify/useful-types": "^2.2.0", "browser-unhandled-rejection": "^1.0.2", "caniuse-api": "^3.0.0", - "core-js": "^2.6.5", "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.4", "tslib": "^1.9.3", "url-polyfill": "^1.1.7", "whatwg-fetch": "^3.0.0" diff --git a/packages/polyfills/src/base.ts b/packages/polyfills/src/base.ts index 8d41f5a525..c7c823054d 100644 --- a/packages/polyfills/src/base.ts +++ b/packages/polyfills/src/base.ts @@ -1,14 +1 @@ -// Cover all standardized ES6 APIs. -require('core-js/es6'); -// Standard now -require('core-js/fn/array/includes'); -require('core-js/fn/string/pad-start'); -require('core-js/fn/string/pad-end'); -require('core-js/fn/symbol/async-iterator'); -require('core-js/fn/object/get-own-property-descriptors'); -require('core-js/fn/object/values'); -require('core-js/fn/object/entries'); -require('core-js/fn/promise/finally'); -// Ensure that we polyfill ES6 compat for anything web-related, if it exists. -require('core-js/web'); -require('regenerator-runtime/runtime'); +require('@babel/polyfill'); diff --git a/yarn.lock b/yarn.lock index 4cf6c6bb60..e5929ecc99 100644 --- a/yarn.lock +++ b/yarn.lock @@ -808,6 +808,14 @@ "@babel/helper-regex" "^7.4.4" regexpu-core "^4.6.0" +"@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.4.3": version "7.6.3" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.6.3.tgz#9e1bf05a2e2d687036d24c40e4639dc46cef2271"