* Add support for rhino as a compilation target
* Add tests for target: rhino
* Fix test failing due to whitespace
* Keep consistent names for rhino tests in babel 7 and 8
* Bump core-js-compat to 3.15.0
* Change references to rhino to include patch version
* Update compat table data import
* Split transpilation of arrow function features more finely
* Rename rhino fixtures to include the patch number and update to include syntax that is and isn't supported for better testing
* Only use the relevant features for transform-new-target and transform-classes
* inline escapeRegExp instead of using any dep
* inline camelCase
* replace merge with object spread
* copy if array instead of using clone
* inline isRegExp
* review fixes!
* remove escape-string-regexp from package.json and in test
* add error for field defaults that are not primitives or empty arrays
* replace merge with object spread
* yarn
* Lint against CJS globals in modules
* Use `import.meta.url` instead of `__filename` in `src` files
* Prepare fixtures runner for `import.meta.url`
* Use `import.meta.url` instead of `__filename` in `test/index` files
* Remove `__dirname` from remaining test files
dirname
* Avoid using `module` in `src` files
* Avoid using `require` in `src` files
* Avoid using `require` in `test` files
* Update `@types/node`
* Compile dynamic import in `@babel/node`
* Fix windows
* Use `@babel/plugin-proposal-dynamic-import` from npm
* Prepare preset-env and compat-data for preset-modules
* Add transform-edge-default-parameters from preset-modules
* AUtomatically generate data from compat-table
* Add compat data for other plugins
* Updates after rebase
* Add more bugfixes to preset-env
* Update tests
* Add bugfix/transform-safari-for-shadowing
* Fix build script
* bugfix/transform-safari-block-shadowing
* Fix flow
* Include changes from 7127330f02b423d9cb0555b3d2a24dbccbc149b5
* Fix check-compat-data
Instead of using `convert-source-map`'s `removeComments` method before
parsing the file, we can first parse the file with `@babel/parser` and then
analyze the comments.
This is needed because it is not possible to reliabily detect comments in
JavaScript without fully parsing the file:
https://github.com/thlorenz/convert-source-map/issues/63
### `@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.
* generate typescript types
* improve type generator output
* move generator scripts to scripts/generators
* use new stringifier for generating flow types too
* export summary types
* add support for oneOfNodeOrValueTypes to improve type generation
* export typescript types from top level, and remove module declaration
* generate typescript/flow types and copy typescript types to babel-types/lib as part of make build
* copy flow types to babel-types/lib as part of make build (fix#6839)
* improve typing: Identifier->name should be a string, not any
* avoid destructuring, to support node 4
* update doc generator to share more code, regenerate babel-types readme, pipe all generator output to stdout
* regenerate babel-types readme as part of make build
* improve typing: ClassProperty->key should be Identifier | StringLiteral | NumericLiteral | Expression, not any
* improve typing: optional node properties are nullable, not undefinedable
* improve docs: FlowClassImplements should be ClassImplements
* make ts usage more friendly: when using babel-types api, make optional params | undefined, and when reading nodes keep optional params | null
* rm lib/types.d.ts and lib/types.js in favor of packages/babel-types/lib
* add missing variance node type, address review comments
* add tests for flow variance
* Comment should be a disjoint union of tagged types
* update .flowconfig
Currently, Babel is treating JSXIdentifier, JSXMemberExpression, and JSXEmptyExpression as expressions as well, which means Babel will for example incorrectly allow you to place these anywhere an expression is wanted.
Closes#6851.