481 Commits

Author SHA1 Message Date
Daniel Tschinder
7dbed2170e Move typscript test copy script to scripts folder and run once (#6749) 2017-11-06 09:46:49 -06:00
Henry Zhu
f76ac0b197 v7.0.0-beta.31 2017-11-03 16:03:01 -04:00
Clement Hoang
1a7194a22f Add JSX Fragment syntax support (#6552)
* 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]
2017-11-03 10:43:48 -04:00
Henry Zhu
690d6465d8 v7.0.0-beta.5 2017-10-30 16:55:46 -04:00
Henry Zhu
38f984f956 v7.0.0-beta.4 2017-10-30 14:33:56 -04:00
Benedikt Meurer
00342452e2 Fix OOB string character access in Printer#_maybeAddParen. (#6589)
* 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.
2017-10-30 09:16:44 -04:00
Benedikt Meurer
ffe4301fe2 Fix property lookup on booleans in needsWhitespace. (#6584)
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.
2017-10-28 20:16:48 -04:00
Henry Zhu
962128c0f0
Update to babylon v7 beta.30 (#6587) 2017-10-28 20:01:52 -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
c0a958098f Scoped: update readme headers to @babel/ [skip ci] 2017-10-16 22:49:57 -04:00
Brian Ng
65495105e9 Scoped: rename installation instructions for transforms [skip ci] 2017-10-16 22:49:56 -04:00
Henry Zhu
691f90a774 Scoped: change test imports to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Henry Zhu
cde0054227 Scoped: change src imports to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Henry Zhu
8e5e27577a Scoped: update package.json dependencies to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Henry Zhu
1cd564bd16 Scoped: rename package names to @babel/ [skip ci] 2017-10-16 22:49:01 -04:00
Henry Zhu
279f55cd9b update to babylon beta.29 2017-10-16 20:10:55 -05:00
Henry Zhu
94da889ab7 v7.0.0-beta.3 2017-10-15 09:12:00 -04:00
Henry Zhu
4a8137c6b4 Merge pull request #6335 from jridgewell/pipeline
Pipeline operator
2017-10-02 16:32:15 -04:00
JeromeFitz
ae168edcfa Remove babel-messages (#6347), continuation of #6352
package.json "babel-messages" removed:
- babel-core
- babel-helper-replace-supers
- babel-plugin-transform-es2015-classes
- babel-traverse

"messages" remove from:
- babel-plugin-check-es2015-constants/src/index.js
- babel-plugin-transform-es2015-for-of/src/index.js

export "babel-messages" removed from:
- babel-core/src/index.js

import "babel-messages" removed from:
- babel-generator/src/index.js
- babel-helper-replace-supers/src/index.js
- babel-traverse/src/index.js
- babel-traverse/src/scope/index.js
- babel-traverse/src/visitors.js

package "babel-messages" removed completely.

💯️ All tests pass.
2017-09-30 09:31:53 -04:00
rouzbeh84
aaeebfaf00 inlines babel-messages on the following files:
option-manager.js... /babel-core/src/config/
 build-external-helpers.js... /packages/babel-core/src/tools/
 index.js... /packages/babel-generator/src
2017-09-30 02:19:32 -07:00
Gilbert
81496ab7b1 Pipeline operator 2017-09-29 19:01:18 -04:00
Brian Ng
832408e85d Fix generator missing parens on Flow union types (#6334) 2017-09-29 14:43:38 -04:00
Justin Ridgewell
23f98a753a Add throw expressions (#6325)
* Add throw expressions

Stage 2 proposal: https://github.com/tc39/proposal-throw-expressions

* Update babylon

* Add to stage 2
2017-09-27 16:15:44 -04:00
Henry Zhu
70547efcc1 v7.0.0-beta.2 2017-09-26 11:14:41 -04:00
Henry Zhu
314bd31b85 update generator/babel-types printing, babylon (#6306)
* update generator printing, babylon [skip ci]

* Update babel-types for TS node types
2017-09-26 10:01:55 -04:00
Henry Zhu
23121d2bd3 v7.0.0-beta.1 2017-09-19 16:24:07 -04:00
Ethan Han
f5ad86c5c6 Fix newlines before the update suffix operator in babel-generator (#6259) 2017-09-17 11:22:05 -07:00
Brian Ng
7f390b0282 Make terminator paren comment check more strict (#5651) 2017-09-15 11:06:24 -07:00
Henry Zhu
1c13250807 v7.0.0-beta.0 2017-09-11 23:01:41 -04:00
Daniel Tschinder
ca117e08cb fix(requeue): Always requeue implicitely created BlockStatements (#6193)
This reverts the former fix done in #5743 and always requeues
BlockStatements when they get created.

This also fixes a bug in babel-generator which would indent code
even though no comments are present.
2017-09-02 01:02:21 -04:00
Henry Zhu
b82b65a31e v7.0.0-alpha.20 2017-08-30 15:02:49 -04:00
Henry Zhu
0a4f1b0a6e update babylon beta.22 (#6167) 2017-08-29 17:53:29 -04:00
Mateusz Burzyński
3c4f19a28d Adjusted Object Rest/Spread tests to use only allowed syntax from the latest spec (#6102) 2017-08-24 15:50:43 -04:00
Andy
68d2f8d161 Add "classProperties" plugin to babel-generator typescript tests (#6074) 2017-08-08 17:38:39 -04:00
Henry Zhu
79f4956948 v7.0.0-alpha.19 2017-08-07 18:21:08 -04:00
Henry Zhu
a1debae8f0 babylon beta.19 (#6053) 2017-08-04 14:46:12 -04:00
Henry Zhu
79c6814d65 v7.0.0-alpha.18 2017-08-03 18:20:36 -04:00
jbrown215
4e9a25e34a Flow opaque type aliases (#5990) 2017-08-02 16:30:19 -05:00
Henry Zhu
0f823beeb1 Newlines in fixtures (#6044)
* write newlines for fixtures

* rerun fixtures
2017-08-02 15:35:29 -04:00
Andy
e32042f353 babel-generator: Comment TypeScript-specific code (#6026) 2017-07-28 18:03:38 -04:00
Andy
c1d07fd6db babel-generator: Add TypeScript support (#5896)
* babel-generator: Add TypeScript support

* Remove type declarations; not published from babylon

* Remove TODOs

* Consistently use `this.word` for tokens that are words
2017-07-28 16:07:05 -04:00
Andy
b242e0d946 babel-generator: Make plugins list explicit for test cases (#6018) 2017-07-26 15:46:47 -04:00
Henry Zhu
9322fd0458 v7.0.0-alpha.17 2017-07-26 08:38:44 -04:00
Henry Zhu
f01438e9b1 update devdeps to latest, update babylon (#6012)
* temporary flow strip measure
2017-07-26 07:57:49 -04:00
Henry Zhu
7f1cd44d60 v7.0.0-alpha.16 2017-07-25 17:35:35 -04:00
Andy
248743e6c5 babel-types: Add TypeScript definitions (#5856)
* babel-types: Add TypeScript definitions

* Add missing builders

* Allow arrow function to have "generator"

* Replace link to resolved issue with comment

* Re-add 'generator' to functionCommon
2017-07-25 11:42:25 -04:00
Brian Ng
9a1b8ea443 Add support for flow predicates in babel-generator (#5984) 2017-07-25 11:38:17 -04:00
Brian Ng
55aea26f13 Add support for export type star in babel-generator (#5985)
* Add support for export type star in babel-generator

* Bump babylon
2017-07-25 11:37:27 -04:00
MarckK
9fc910d8c0 Add optionality to catch bindings (#5956) 2017-07-25 09:38:48 -05:00
Daniel Tschinder
c9ed159a18 Update jsesc to the latest version (#5995) 2017-07-23 09:21:22 -04:00