18 Commits

Author SHA1 Message Date
Denis Pushkarev
00cae77ec7 fix #9232, add some missed modules to noConflict (#9780) 2019-04-02 21:19:34 +02:00
Sven Sauleau
17e10509c0
refactor: unify polyfill with noConflict mode 2019-04-02 14:00:58 +02:00
Denis Pushkarev
3303b079c5 Update to core-js@3 (#7646)
### `@babel/runtime`
- Added `@babel/runtime-corejs3` package and `corejs: 3` options to `@babel/plugin-transform-runtime`.
- Added support of instance methods, fixes #8928.
- Added flag `proposals` (in `corejs: { version: 3, proposals: true }` format) for support all proposals polyfills from `core-js`.
- Used separate directories in runtime for `core-js` entry points with proposals and without.
- Used `get-iterator-method` helper for getting iterators, fixes #2500.
- As a cheap bonus, added support of IE8- (except some cases of `regenerator`).

### `@babel/polyfill`
- Should be deprecated in favor of separate usage required features from `core-js` and `regenerator-runtime` with an informative message.

### `@babel/preset-env`
- Uses for built-ins data from [`core-js-compat`](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat) instead of `compat-table` since information from `compat-table` [is not enough](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat).
- `useBuilIns` now requires direct setting of `corejs` version option, without it will be used `2` by default and shown deprecation warning.
- Added support of minor `core-js` versions for simplify updating in the future.
- For preventing some order-related problems, polyfills in the both `core-js@3` plugins added on `post` stage in the order of `core-js-compat` data.
- Divided plugins and polyfills parts of `preset-env`, instead of 2 internal plugins for adding polyfills, we have 6: usage and entry versions of plugins for `core-js@2`, ### Current state:
`core-js@3`, `regenerator-runtime`.
- Added support `samsung` target (for Samsung Internet) since `core-js-compat` and `compat-table` now contains mapping for this, fixes #6602.

#### `useBuilIns: entry` with `corejs: 3`
- No longer transforms `@babel/polyfill`.
- Transforms **all possible** `core-js` entry points to import of related modules (based on data from [`core-js-compat`](https://unpkg.com/core-js-compat@3.0.0-beta.15/entries.json)).
- Since of this, we no longer need `shippedProposals` / `proposals` flags with `useBuilIns: entry`.
- Removes `regenerator-runtime/runtime` import where it's not required.

#### `useBuilIns: usage` with `corejs: 3`
- In addition to `shippedProposals`, added flag `proposals`  (in `corejs: { version: 3, proposals: true }` format) for polyfill all proposals from `core-js`.
- Fixed list of dependencies in built-in definitions.
- Improved the way of determination method / built-in name and source of this method.
- Adds import of required polyfills on `MemberExpression`, `ObjectPattern`, `in` operator.
- Adds import of required polyfills on access to global object properties.
- Adds import of all required common iterators on all syntax features which use iterators protocol (`for-of`, destructuring, spread, `yield` delegation, etc.).
- Adds import of promises on syntax features which use promises (async functions/generators, dynamic import, etc.), fixes #9250, #7402, etc.

### `core-js@2` stuff
I didn't want to tough `core-js@2`-related stuff, however
- Fixed some serious errors in definitions which breaks `Object.getOwnPropertySymbols`, `Symbol.toStringTag` logic, `Promise#finally`, `Array#forEach`, etc.
- `Array#flatMap` and trim methods moved to stable features as a part of ES2019 and loaded by deprecated `@babel/polyfill` and `@babel/preset-env` with `corejs: 2` option.
2019-03-19 21:07:45 +01:00
Henry Zhu
c8bb450032
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.
2018-08-09 11:43:45 -04:00
Evan Scott
0bb71caad3 Add noConflict entry mode to @babel/polyfill + change error to warning (#6371)
* feat: add noConflict polyfill entry
* use a warning
2018-04-22 19:11:50 -04:00
Mateusz Burzyński
859ea4b175 Scoped: updated numerous docs with scoped packages change [skip ci] 2017-10-16 22:49:57 -04:00
Henry Zhu
9083bd6283 Merge branch 'master' into 7.0 2017-02-09 18:36:02 -05:00
Logan Smyth
b845f2b69d Re-enable the max-len ESLint rule. (#5265) 2017-02-04 11:07:15 -05:00
Anderson Vasques
81c3578adc [7.0] Remove old code used for backwards compatibility (#5122)
[7.0] Remove old code used for backwards compatibility in babel-polyfill

Fixes #5121
2017-01-19 22:32:16 -05:00
Henry Zhu
672adba9a1 enable prefer const (#5113) 2017-01-14 09:48:52 -05:00
Ben Newman
b3acf9100e Make babel-runtime use regenerator-runtime from npm. (#3494)
The source repository for regenerator-runtime can now be found at
https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime

This also removes the babel-regenerator-runtime package, now that the only
difference between it and regenerator-runtime has been resolved:
bc8d2d672c
2016-05-28 19:04:48 -04:00
Logan Smyth
9843c87573 Fix block statement code style. (#3493) 2016-05-02 21:15:37 -04:00
Denis Pushkarev
ca46147734 dirty fix for T7206 for preventing runtime transform Object.defineProperty in the babel-polyfill entry point 2016-03-15 02:55:46 +06:00
Sebastian McKenzie
9bd15508a2 suppress final lint error? 2016-02-15 00:20:19 +00:00
Denis Pushkarev
79214b3b05 update core-js 2016-02-09 07:31:02 +06:00
Sebastian McKenzie
983ca5c71f add function.sent 2015-11-17 23:02:21 -08:00
Ari Porad
d631f38209 Fix typo related to name change. 2015-11-01 20:02:23 -08:00
Sebastian McKenzie
67c96b6ed5 move babel polyfill into a separate package 2015-08-12 02:57:12 +01:00