Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Releases: babel/babylon

v6.11.1

22 Sep 20:09
Compare
Choose a tag to compare

Hot Fix

  • #137 - Fix a regression with duplicate exports - it was erroring on all keys in Object.prototype. @danez
export toString from './toString';
`toString` has already been exported. Exported identifiers must be unique. (1:7)
> 1 | export toString from './toString';
    |        ^
  2 |

v6.11.0

22 Sep 18:09
Compare
Choose a tag to compare

6.11.0 (2016-09-22)

Spec Compliancy

// Only one default export allowed per module. (2:9)
export default function() {};
export { foo as default };

// Only one default export allowed per module. (2:0)
export default {};
export default function() {};

// `Foo` has already been exported. Exported identifiers must be unique. (2:0)
export { Foo };
export class Foo {};

New Feature (Syntax)

  • Add support for computed class property names (#121) @motiz88
// AST
interface ClassProperty <: Node {
  type: "ClassProperty";
  key: Identifier;
  value: Expression;
  computed: boolean; // added
}
// with "plugins": ["classProperties"]
class Foo {
  [x]
  ['y']
}

class Bar {
  [p]
  [m] () {}
}

Bug Fix

  • Fix static property falling through in the declare class Flow AST (#135) @danharper
declare class X {
    a: number;
    static b: number; // static
    c: number; // this was being marked as static in the AST as well
}

Polish

  • Rephrase "assigning/binding to rvalue" errors to include context (#119) @motiz88
// Used to error with:
// SyntaxError: Assigning to rvalue (1:0)

// Now:
// Invalid left-hand side in assignment expression (1:0)
3 = 4

// Invalid left-hand side in for-in statement (1:5)
for (+i in {});

Internal

  • Fix call to this.parseMaybeAssign with correct arguments (#133) @danez
  • Add semver note to changelog (#131) @hzoo

v6.10.0

19 Sep 15:34
Compare
Choose a tag to compare

6.10.0 (2016-09-19)

We plan to include some spec compliancy bugs in patch versions. An example was the multiple default exports issue.

Spec Compliancy

  • Implement ES2016 check for simple parameter list in strict mode (#106) (Timothy Gu)

It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors

More Context: tc39-notes

For example:

// this errors because it uses destructuring and default parameters
// in a function with a "use strict" directive
function a([ option1, option2 ] = []) {
  "use strict";
}

The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to.

New Feature

  • Exact object type annotations for Flow plugin (#104) (Basil Hosmer)

Added to flow in facebook/flow@c710c40

Looks like:

var a : {| x: number, y: string |} = { x: 0, y: 'foo' };

Bug Fixes

  • Include typeParameter location in ArrowFunctionExpression (#126) (Daniel Tschinder)
  • Error on invalid flow type annotation with default assignment (#122) (Dan Harper)
  • Fix Flow return types on arrow functions (#124) (Dan Harper)

Misc

  • Add tests for export extensions (#127) (Daniel Tschinder)
  • Fix Contributing guidelines [skip ci](Daniel Tschinder)

v6.9.2

09 Sep 15:02
Compare
Choose a tag to compare

6.9.2 (2016-09-09)

The only change is to remove the babel-runtime dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller.

v6.9.1

24 Aug 09:26
Compare
Choose a tag to compare

6.9.1 (2016-08-23)

This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for exponentiationOperator, asyncFunctions and trailingFunctionCommas which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops.

Bug Fixes

  • Fix issues with default object params in async functions (#96) @danez
  • Fix issues with flow-types and async function (#95) @danez
  • Fix arrow functions with destructuring, types & default value (#94) @danharper
  • Fix declare class with qualified type identifier (#97) @danez
  • Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default (#98) @danez

v6.9.0

16 Aug 14:35
Compare
Choose a tag to compare

6.9.0 (2016-08-16)

New syntax support

(Be aware that React is not going to support this syntax)

<div>
  {...todos.map(todo => <Todo key={todo.id} todo={todo}/>)}
</div>
  • Add support for declare module.exports (#72) @danez
declare module foo {
  declare module.exports: {}
}

New Features

  • If supplied, attach filename property to comment node loc. (#80) @divmain
  • Add identifier name to node loc field (#90) @kittens

Bug Fixes

  • Fix exponential operator to behave according to spec (#75) @danez
  • Fix lookahead to not add comments to arrays which are not cloned (#76) @danez
  • Fix accidental fall-through in Flow type parsing. (#82) @xiemaisi
  • Only allow declares inside declare module (#73) @danez
  • Small fix for parsing type parameter declarations (#83) @gabelevi
  • Fix arrow param locations with flow types (#57) @danez
  • Fixes SyntaxError position with flow optional type (#65) @danez

Internal

v6.8.4

06 Jul 23:40
Compare
Choose a tag to compare

6.8.4 (2016-07-06)

Bug Fixes

  • Fix the location of params, when flow and default value used (#68) Fixes #67 @danez

v6.8.3

06 Jul 23:39
Compare
Choose a tag to compare

6.8.3 (2016-07-03)

Bug Fixes

  • Fix performance regression introduced in 6.8.2 with conditionals #63 @danez

v6.8.2

06 Jul 23:37
Compare
Choose a tag to compare

6.8.2 (2016-06-24)

Bug Fixes

  • Fix parse error with yielding jsx elements in generators function* it() { yield <a></a>; }
  • When cloning nodes do not clone its comments
  • Fix parse errors when using arrow functions with an spread element and return type (...props): void => {}
  • Fix leading comments added from previous node
  • Fix parse errors with flow's optional arguments (arg?) => {}
  • Support negative numeric type literals
  • Remove line terminator restriction after await keyword
  • Remove grouped type arrow restriction as it seems flow no longer has it
  • Fix parse error with generic methods that have the name get or set class foo { get() {} }
  • Fix parse error with arrow functions that have flow type parameter declarations <T>(x: T): T => x;

Documentation

  • Document AST differences from ESTree
  • Move ast spec from babel/babel

Internal

  • Enable skipped tests
  • Add script to test latest version of babylon with babel
  • Upgrade test runner ava
  • Add missing generate-identifier-regex script
  • Rename parser context types
  • Add node v6 to travis testing
  • Update to Unicode v9

v6.8.1

24 Jun 18:41
Compare
Choose a tag to compare

6.8.1 (2016-06-06)

New Feature

  • Parse type parameter declarations with defaults like type Foo<T = string> = T

Bug Fixes

  • Type parameter declarations need 1 or more type parameters.
  • The existential type * is not a valid type parameter.
  • The existential type * is a primary type

Spec Compliancy

  • The param list for type parameter declarations now consists of TypeParameter nodes
  • New TypeParameter AST Node (replaces using the Identifier node before)
interface TypeParameter <: Node {
  bound: TypeAnnotation;
  default: TypeAnnotation;
  name: string;
  variance: "plus" | "minus";
}