From c8bb4500326700e7dc68ce8c4b90b6482c48d82f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 9 Aug 2018 11:43:45 -0400 Subject: [PATCH] remove proposals polyfills from default import [skip ci] (#8440) The default import is replaced with only polyfills that are Stage 4; this is in alignment with how we have removed the Stage presets. This also would mean we would need to add new imports when necessary, but that can be in a future release. --- packages/babel-polyfill/src/index.js | 17 ++++++++++++++++- packages/babel-polyfill/src/noConflict.js | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/packages/babel-polyfill/src/index.js b/packages/babel-polyfill/src/index.js index 5661b7c75a..d2bea4df33 100644 --- a/packages/babel-polyfill/src/index.js +++ b/packages/babel-polyfill/src/index.js @@ -1,4 +1,19 @@ -import "core-js/shim"; +// Cover all standardized ES6 APIs. +import "core-js/es6"; + +// Standard now +import "core-js/fn/array/includes"; +import "core-js/fn/string/pad-start"; +import "core-js/fn/string/pad-end"; +import "core-js/fn/symbol/async-iterator"; +import "core-js/fn/object/get-own-property-descriptors"; +import "core-js/fn/object/values"; +import "core-js/fn/object/entries"; +import "core-js/fn/promise/finally"; + +// Ensure that we polyfill ES6 compat for anything web-related, if it exists. +import "core-js/web"; + import "regenerator-runtime/runtime"; if (global._babelPolyfill && typeof console !== "undefined" && console.warn) { diff --git a/packages/babel-polyfill/src/noConflict.js b/packages/babel-polyfill/src/noConflict.js index ae74735ec3..ec7c002fff 100644 --- a/packages/babel-polyfill/src/noConflict.js +++ b/packages/babel-polyfill/src/noConflict.js @@ -1,2 +1,17 @@ -import "core-js/shim"; +// Cover all standardized ES6 APIs. +import "core-js/es6"; + +// Standard now +import "core-js/fn/array/includes"; +import "core-js/fn/string/pad-start"; +import "core-js/fn/string/pad-end"; +import "core-js/fn/symbol/async-iterator"; +import "core-js/fn/object/get-own-property-descriptors"; +import "core-js/fn/object/values"; +import "core-js/fn/object/entries"; +import "core-js/fn/promise/finally"; + +// Ensure that we polyfill ES6 compat for anything web-related, if it exists. +import "core-js/web"; + import "regenerator-runtime/runtime";