23 Commits

Author SHA1 Message Date
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
Logan Smyth
a8224d40e2 Split @babel/runtime into two separate runtime modules. 2018-08-02 19:25:07 -07:00
Logan Smyth
a149466001 Move build-dist script to the runtime transform. 2018-08-02 19:23:47 -07:00
Chaitanya Kumar Kamatham
daf0ca8680 Rename "babylon" to "@babel/parser" (#7937) 🎉 2018-05-19 00:03:05 -04:00
Justin Ridgewell
3177f05904
ESLint: Ignore lerna.json and .git (#7708)
* Ignore lerna.json

* Oh, and ignore .git
2018-04-10 08:47:50 -04:00
Daniel Tschinder
c8992e4155
Enforce Prettier defaults + also format .babelrc and .json (#7499)
* .prettierrc: full configuration for Prettier

This way, contributors using different-from-default settings will still
use the correct prettier settings

* Makefile: also lint .babelrc.js

* Makefile: also prettify .json files

* Exclude package.json files and correct build dir

* Add more default options to prettierrc and load it in cli

This avoids prettier looking up the config for each file

* Format json

* Update prettier and eslint and reformat codebase

* Remove obsolete file

* Add comment
2018-03-06 11:40:36 +01:00
Henry Zhu
70361f1200 Remove the experimental folder 2017-11-21 20:03:16 -05:00
Artem Yavorsky
262d7518bd Move babel-preset-env-standalone to the monorepo. (#6438) 2017-11-15 09:50:36 -06:00
Daniel Tschinder
cc66495a95
Unify eslint/prettier config (#6747)
* Unify eslint/prettier config

Use a prettier config file and correctly configure trailing commas

Enable curly in babylon as in all other packages.

* Add experimental and codemods
2017-11-06 14:19:59 +01:00
Daniel Tschinder
3b540e3f5a
Integrate babylon into babel workflow 2017-11-01 23:26:51 +01:00
Brian Ng
38355d9230
Tweak babel-preset-env for monorepo 2017-10-05 17:35:16 -05:00
Henry Zhu
8597219ce5 move to codemods folder [skip ci] 2017-09-19 16:04:11 -04:00
Daniel Lo Nigro
a04c18af71 Move babel-standalone into main Babel repo (#6029)
* Move babel-standalone into main Babel repo

* Don't try to gather coverage data for babel-standalone test

* Fix JSX test

* Always use npm v4 on Travis

* Include pull request number as part of version number

* Cherry-picking 5721b2e43e

Remove deprecated packages to prevent Babel v6 files from being pulled in

* Use RootMostResolvePlugin to dedupe packages

* Avoid destructuring so the build works on archaic Node.js versions

* - Fix version number
- Remove Babili packages (they should be in separate babili-standalone)
- Remove deprecated  syntax-class-constructor-call

* - Remove more Babili packages
- Remove `babel-plugin-inline-replace-variables` for now as it pulls in Babel 6 stuff

* Actually remove reference to babel-plugin-undeclared-variables-check

* Add Babylon to root package.json so we hoist the right version. This fixes the tests.
2017-08-11 23:36:19 -07:00
Henry Zhu
7a1ccf076c Misc (#5545)
* normalize npmignores

* fixup eslint ignore, etc

* lint

* remove unused

* rm from gitignore

* use strict
2017-03-25 21:46:16 -04:00
Henry Zhu
b363e7b199 add @danez's changes 2017-03-01 12:54:22 -05:00
Daniel Tschinder
1d9e509df2 Fix eslint (#4897)
* Fix eslint call

* Fix linting errors
2016-11-26 11:24:38 -05:00
Andrew Levine
c0038221d7 Run ESLint on test files, and fix lint errors in test files (#4732) 2016-10-15 18:27:48 -04: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
Sebastian McKenzie
5b89849f43 Switch to klint, fix some lint rules 2016-02-14 23:25:14 +00:00
Sebastian McKenzie
3ef9bffcc2 split up babel core into multiple modules 2015-08-11 17:40:59 +01:00
Sebastian McKenzie
7c8f3ed696 rewrite bootstrap script to use shelljs as the bootstraping process is kinda weird now with multiple packages 2015-07-14 16:48:20 +01:00
Sebastian McKenzie
fedf894904 Begin transition of Babel to a more scalable architecture, async flow to allow for RPC and better build system for multiple packages 2015-07-11 12:39:54 +01:00
Sebastian McKenzie
83c23d266f add eslint with an acorn-babel compatibility layer, yay! coming soon to a production release near you 2015-02-27 13:17:22 +11:00