* Added optionalExpression types to babylon and babel-types
* OptionalChain transforms bug fix
* Added OptionalExpressions to babel-generator. Fixed OptionalChain Bugs
* Removed 'optionalChain' from newExpression and added test cases
* Added test cases for optionalChain
* Update index.js
* 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
* Update line endings in test fixtures to match current output
* Fix incorrectly set up static-property-tdz fixtures
It seems the fixture runner does not look into subfolders.
* Remove expected file that should not exist
* Reenable disable optimisation test
* Reenable disabled nbsp tests
* Reenable comments between props test
The comments adjacent to children test is still broken so it stays off.
* Split exportExtensions into two plugins in babylon
* rename proposal-export-default to proposal-export-default-from
* rename proposal-export-namespace to proposal-export-namespace-from
* Add JSX Fragments to babel-types
* Support JSX fragments in the transform-react-jsx plugin
* Add tests JSX fragments
* Update helper-builder and transform plugin documentations for jsx fragment
* Add generator for jsx fragments
* Add test for jsx fragment generator
* Split jsx transform example into normal and fragment examples
* Remove unnecessary fields from ElementState in babel-helper-builder-react-jsx
* inline [skip ci]
* Fix OOB string character access in Printer#_maybeAddParen.
The `_maybeAddParen` method of the `Printer` class does
```js
const chaPost = str[i + 1]
```
without checking that `i + 1` is still within the bounds of `str`. It
seems like this triggers fairly often that the `str[i + 1]` access is
out of bounds. The first out of bounds access will turn the KeyedLoadIC
(in case of V8) into *MEGAMORPHIC* state, which is significantly slower
for strings (there's a fix in flight for V8 to mitigate the cost a bit
in that case). Even worse than that, the out of bounds access also
pollutes the later comparisons, namely
```js
chaPost === "/"
```
and
```js
chaPost === "*"
```
which are now no longer monomorphic on strings, since `chaPost` was
sometimes `undefined`.
This is a non-breaking performance fix, which improves babel execution
on the [web-tooling-benchmark](github.com/v8/web-tooling-benchmark)
workload by around 6-9%.
* Restructure and optimize the code a bit.
The code
```js
linesInfo && linesInfo[type]
```
performs a lot of dynamic lookups on the `Boolean.prototype`, as the
*ToBoolean* operation let's `true` pass for `linesInfo` (which might
itself be concerning that this can be a boolean). Instead of the
coercion, the code should properly check for valid objects via `typeof`
and strict equality with `null` comparison.
This is a non-breaking performance fix.