NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #4263 most downloaded on npm
A JavaScript parser
Last release 8 years ago
no release in 18 months
Ships fairly regularly
a new release about every 2 weeks
Some releases are documented
notes for 30 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
132 releases · first in 2015
Property variance type annotations for Flow plugin (#161) (Sam Goldman)
Property variance type annotations for Flow plugin (#161) (Sam Goldman)
See https://flowtype.org/docs/variance.html for more information
type T = { +p: T };
interface T { -p: T };
declare class T { +[k:K]: V };
class T { -[k:K]: V };
class C2 { +p: T = e };
Raise error on duplicate definition of __proto__ (#183) (Moti Zilberman)
({ __proto__: 1, __proto__: 2 }) // Throws an error now
Flow: Allow class properties to be named static (#184) (Moti Zilberman)
declare class A {
static: T;
}
Allow "async" as identifier for object literal property shorthand (#187) (Andrew Levine)
var foo = { async, bar };
Fix flowtype and add inType to state (#189) (Daniel Tschinder)
This improves the performance slightly (because of hidden classes)
Fix .gitattributes line ending setting (#191) (Moti Zilberman)
Increase test coverage (#175) (Moti Zilberman)
Re-add missing .eslintignore for IDEs (Daniel Tschinder)
Error on missing expected.json fixture in CI (#188) (Moti Zilberman)
Add .gitattributes and .editorconfig for LF line endings (#179) (Moti Zilberman)
Fixes two tests that are failing after the merge of #172 (#177) (Moti Zilberman)
One column per quarter.
Implement import() syntax (#163) (Jordan Gensler)
Implement import() syntax (#163) (Jordan Gensler)
This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript
import(`./section-modules/${link.dataset.entryModule}.js`)
.then(module => {
module.loadPageInto(main);
})
Add EmptyTypeAnnotation (#171) (Sam Goldman)
Just wasn't covered before.
type T = empty;
Fix crash when exporting with destructuring and sparse array (#170) (Jeroen Engels)
// was failing due to sparse array
export const { foo: [ ,, qux7 ] } = bar;
Allow keyword in Flow object declaration property names with type parameters (#146) (Dan Harper)
declare class X {
foobar<T>(): void;
static foobar<T>(): void;
}
Allow keyword in object/class property names with Flow type parameters (#145) (Dan Harper)
class Foo {
delete<T>(item: T): T {
return item;
}
}
Allow typeAnnotations for yield expressions (#174)) (Daniel Tschinder)
function *foo() {
const x = (yield 5: any);
}
Annotate more errors with expected token (#172)) (Moti Zilberman)
// Unexpected token, expected ; (1:6)
{ set 1 }
Remove kcheck (#173)) (Daniel Tschinder)
Also run flow, linting, babel tests on seperate instances (add back node 0.10)
Fix crash when exporting with destructuring and sparse array (#170) (Jeroen Engels)
Fix crash when exporting with destructuring and sparse array (#170) (Jeroen Engels)
// was failing with `Cannot read property 'type' of null` because of null identifiers
export const { foo: [ ,, qux7 ] } = bar;
Fix: Check for duplicate named exports in exported destructuring assignments (#144) (Kai Cataldo)
Fix: Check for duplicate named exports in exported destructuring assignments (#144) (Kai Cataldo)
// `foo` has already been exported. Exported identifiers must be unique. (2:20)
export function foo() {};
export const { a: [{foo}] } = bar;
Fix: Check for duplicate named exports in exported rest elements/properties (#164) (Kai Cataldo)
// `foo` has already been exported. Exported identifiers must be unique. (2:22)
export const foo = 1;
export const [bar, ...foo] = baz;
Fix: Allow identifier async for default param in arrow expression (#165) (Kai Cataldo)
// this is ok now
const test = ({async = true}) => {};
Babylon will now print out the token it's expecting if there's a SyntaxError (#150) (Daniel Tschinder)
# So in the case of a missing ending curly (`}`)
Module build failed: SyntaxError: Unexpected token, expected } (30:0)
28 | }
29 |
> 30 |
| ^
Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu)
Add static errors for object rest (#149) (@danez)
Add static errors for object rest (#149) (@danez)
https://github.com/sebmarkbage/ecmascript-rest-spread
Object rest copies the rest of properties from the right hand side obj starting from the left to right.
let { x, y, ...z } = { x: 1, y: 2, z: 3 };
// x = 1
// y = 2
// z = { z: 3 }
SyntaxError: The rest element has to be the last element when destructuring (1:10)
> 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3 };
| ^
# Previous behavior:
# x = { x: 1, y: 2, z: 3 }
# y = 2
# z = 3
Before, this was just a more verbose way of shallow copying obj since it doesn't actually do what you think.
SyntaxError: Cannot have multiple rest elements when destructuring (1:13)
> 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3 };
| ^
# Previous behavior:
# x = 1
# y = { y: 2, z: 3 }
# z = { y: 2, z: 3 }
Before y and z would just be the same value anyway so there is no reason to need to have both.
SyntaxError: A trailing comma is not permitted after the rest element (1:16)
let { x, y, ...z, } = obj;
The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense.
get / set are valid property names in default assignment (#142) (@jezell)
// valid
function something({ set = null, get = null }) {}
`` js // regression with duplicate export check SyntaxError: ./typography.js: undefined` has already been exported. Exported identifiers must be uniqu
// regression with duplicate export check
SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13)
20 |
21 | export const { rhythm } = typography;
> 22 | export const { TypographyStyle } = typography
Bail out for now, and make a change to account for destructuring in the next release.
` javascript export toString from './toString'; `
Object.prototype. @danezexport toString from './toString';
`toString` has already been exported. Exported identifiers must be unique. (1:7)
> 1 | export toString from './toString';
| ^
2 |
Disallow duplicate named exports (#107) @kaicataldo
// 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 {};
// AST
interface ClassProperty <: Node {
type: "ClassProperty";
key: Identifier;
value: Expression;
computed: boolean; // added
}
// with "plugins": ["classProperties"]
class Foo {
[x]
['y']
}
class Bar {
[p]
[m] () {}
}
static property falling through in the declare class Flow AST (#135) @danharperdeclare class X {
a: number;
static b: number; // static
c: number; // this was being marked as static in the AST as well
}
// 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 {});
> We plan to include some spec compliancy bugs in patch versions. An example was the multiple default exports issue.
We plan to include some spec compliancy bugs in patch versions. An example was the multiple default exports issue.
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.
Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8
Looks like:
var a : {| x: number, y: string |} = { x: 0, y: 'foo' };
typeParameter location in ArrowFunctionExpression (#126) (Daniel Tschinder)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.
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.
This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for exponentiationOperator, asyncFunctions
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.
Add JSX spread children (#42) @calebmer
(Be aware that React is not going to support this syntax)
<div>
{...todos.map(todo => <Todo key={todo.id} todo={todo}/>)}
</div>
declare module foo {
declare module.exports: {}
}
Fix the location of params, when flow and default value used (#68) Fixes #67 @danez
Fix performance regression introduced in 6.8.2 with conditionals #63 @danez
Fix parse error with yielding jsx elements in generators function* it() { yield ; }
function* it() { yield <a></a>; }(...props): void => {}(arg?) => {}get or set class foo { get() {} }<T>(x: T): T => x;function* it() { yield <a></a>; } (#31) @eldereal(...props): void => {} (#10) @danez(arg?) => {} (#19) @danezget or set class foo { get() {} } (#55) @vkurchatkin<T>(x: T): T => x; (#54) @gabeleviParse type parameter declarations with defaults like type Foo = T
type Foo<T = string> = T* is not a valid type parameter.* is a primary typeTypeParameter nodesTypeParameter AST Node (replaces using the Identifier node before)interface TypeParameter <: Node {
bound: TypeAnnotation;
default: TypeAnnotation;
name: string;
variance: "plus" | "minus";
}
This is also the first release of babylon outside of the main babel repo. We are able to parse two new features! This release is to correspond to the
This is also the first release of babylon outside of the main babel repo. We are able to parse two new features! This release is to correspond to the previous Babel 6.8.0 release since babylon is also compiled with Babel 6. In the future, the version numbers may not correspond the same given it's in a separate repo.
Method Parameter Decorators is now a TC39 stage 0 proposal.
Examples:
class Foo {
constructor(@foo() x, @bar({ a: 123 }) @baz() y) {}
}
export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {}
var obj = {
method(@foo() x, @bar({ a: 123 }) @baz() y) {}
};
asyncGenerators plugin) (#17)There is also a new node type, ForAwaitStatement.
Async generators and for-await are now a stage 2 proposal.
Example:
async function f() {
for await (let x of y);
}
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →