Skip to content

Commit 3327845

Browse files
mmermerkayaJosh Crowther
authored andcommitted
Use core-js for polyfills (#671)
* Use core-js for polyfills * Remove DOM polyfill, it's not used * Only polyfill parts of ES2015 we currently use
1 parent 7463443 commit 3327845

File tree

8 files changed

+19
-222
lines changed

8 files changed

+19
-222
lines changed

packages/polyfill/index.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
import './src/polyfills/promise';
18-
import './src/shims/Array';
19-
import './src/shims/String';
17+
// Fetch
18+
import 'whatwg-fetch';
19+
20+
// Promise
21+
import 'promise-polyfill/src/polyfill';
22+
23+
// ES6
24+
import 'core-js/fn/array/find';
25+
import 'core-js/fn/array/find-index';
26+
import 'core-js/fn/string/starts-with';

packages/polyfill/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313
},
1414
"license": "Apache-2.0",
1515
"dependencies": {
16-
"promise-polyfill": "^7.1.0",
17-
"tslib": "^1.9.0",
16+
"core-js": "^2.5.5",
17+
"promise-polyfill": "^7.1.2",
1818
"whatwg-fetch": "^2.0.3"
1919
},
2020
"devDependencies": {
21-
"@types/node": "^9.4.6",
2221
"rollup": "^0.57.1",
2322
"rollup-plugin-commonjs": "^9.1.0",
2423
"rollup-plugin-node-resolve": "^3.3.0",

packages/polyfill/src/polyfills/fetch.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/polyfill/src/polyfills/global.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

packages/polyfill/src/polyfills/promise.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

packages/polyfill/src/shims/Array.ts

Lines changed: 0 additions & 113 deletions
This file was deleted.

packages/polyfill/src/shims/String.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

yarn.lock

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,6 +2448,10 @@ core-js@^2.0.0, core-js@^2.2.0, core-js@^2.4.0:
24482448
version "2.5.3"
24492449
resolved "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e"
24502450

2451+
core-js@^2.5.5:
2452+
version "2.5.5"
2453+
resolved "https://registry.npmjs.org/core-js/-/core-js-2.5.5.tgz#b14dde936c640c0579a6b50cabcc132dd6127e3b"
2454+
24512455
core-js@~2.3.0:
24522456
version "2.3.0"
24532457
resolved "https://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65"
@@ -8234,9 +8238,9 @@ promise-polyfill@^6.0.1:
82348238
version "6.1.0"
82358239
resolved "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-6.1.0.tgz#dfa96943ea9c121fca4de9b5868cb39d3472e057"
82368240

8237-
promise-polyfill@^7.1.0:
8238-
version "7.1.0"
8239-
resolved "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-7.1.0.tgz#4d749485b44577c14137591c6f36e5d7e2dd3378"
8241+
promise-polyfill@^7.1.2:
8242+
version "7.1.2"
8243+
resolved "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-7.1.2.tgz#ab05301d8c28536301622d69227632269a70ca3b"
82408244

82418245
82428246
version "1.0.0"

0 commit comments

Comments
 (0)