188 KiB
Babel v4-v6 Changelog
6.26.3 (2018-04-27)
- Fixed a small regression from the last release if the output file contains no JS content.
6.26.2 (2018-04-26)
- Landed #7812 which backported several fixes to make sourcemaps behave better
6.26.1 (2018-02-03)
Not planning on supporting 6.x but people keep asking for backports, may do so in the future for specific bugs.
- Published a bugfix for [detrobutt/babel-plugin-import-graphql#2](https://github.com/detrohutt/babel-plugin-import-graphql/issues/2. PR #7205
6.26.0 (2017-08-16)
Backports for some folks (also other's when we accidentally merged PRs from both 6.x/master) Lesson learned: just use
masterand backport on another branch.
👓 Spec Compliancy
babel-core,babel-generator,babel-plugin-transform-flow-comments,babel-plugin-transform-flow-strip-types,babel-traverse,babel-types- #6081 Flow opaque type 6.x backport. (@jbrown215)
🚀 New Feature
babel-cli- #5796 Allow --inspect-brk option to be used with babel-node [6.x backport]. (@noinkling)
🐛 Bug Fix
babel-plugin-transform-es2015-modules-commonjsbabel-types- #5693 Hoist toSequenceExpression's convert helper. (@jridgewell)
📝 Documentation
babel-plugin-transform-class-properties- #6005 FIX access to the prototype of an instance. (@shuaibird)
babel-plugin-transform-runtime- #5857 Fix typos in README.md. (@danny-andrews)
babel-plugin-transform-regenerator- Other
babel-generator,babel-plugin-transform-es2015-arrow-functions,babel-plugin-transform-es2015-modules-commonjs,babel-plugin-transform-es2015-spread,babel-plugin-transform-runtime,babel-register
🏠 Internal
babel-traverse- Other
- #5938 Remove codecov node package and use bash uploader. (@existentialism)
Committers: 19
- Artem Yavorsky (yavorsky)
- Brian Ng (existentialism)
- Danny Andrews (danny-andrews)
- Henry Zhu (hzoo)
- Jeffrey Wear (wearhere)
- Jordan Brown (jbrown215)
- Josh Johnston (joshwnj)
- Justin Ridgewell (jridgewell)
- Konstantin Pschera (k15a)
- Malcolm (noinkling)
- Marcus Cavanaugh (mcav)
- Peeyush Kushwaha (peey)
- Philipp Friedenberger (MrSpider)
- Samuel Reed (STRML)
- Shuaibird Hwang (shuaibird)
- Suman (ssuman)
- Sven SAULEAU (xtuc)
- jonathan schatz (modosc)
- u9lyfish@gmail.com (u9lyfish)
6.25.0 (2017-06-08)
Just backporting a few things.
🚀 New Feature
babel-plugin-transform-react-display-namebabel-generator,babel-plugin-transform-flow-strip-types,babel-types
🐛 Bug Fix
💅 Polish
Committers: 5
- Bo Lingen (citycide)
- Brian Vaughn (bvaughn)
- Jan Kassens (kassens)
- Kenneth Chung (kentor)
- Sebastian McKenzie (kittens)
6.24.0 (2017-03-13)
A quick release for 2 features:
- Thanks to @rwjblue, there is now a
noInteropoption for oures2015-modulestransform to remove theinteropRequireDefaultandinteropRequireWildcardhelpers.
Input
import foo from "foo";
foo;
Regular Output
var _foo = require("foo");
var _foo2 = _interopRequireDefault(_foo);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_foo2.default;
Output with option noInterop
"use strict";
var _foo = require("foo");
(0, _foo.default)();
This also helps ember-cli migrate to Babel 6.
- @izaakschroeder has added
dirnameto the preset constructor which presets can use to resolve things relative to files.
Example usage of fileContext.dirname in a preset
module.exports = function preset (context, options, fileContext) {
if (/resolve-addons-relative-to-file$/.test(fileContext.dirname)) {
return {
plugins: ['plugin-here'],
};
}
return {};
};
This will help out with reusing a
browserslistfile for babel-preset-env and for plugins like https://github.com/tleunen/babel-plugin-module-resolver.
🚀 New Feature
babel-plugin-transform-es2015-modules-amd,babel-plugin-transform-es2015-modules-commonjsbabel-core- #4834 Pass
dirnameas extra metadata to preset constructor. (@izaakschroeder)
- #4834 Pass
🐛 Bug Fix
babel-generatorbabel-generator,babel-plugin-transform-object-rest-spread
📝 Documentation
- #5449 Fixed broken links in README.md [skip-ci]. (@sethbergman)
- #5409 Fix transform-object-rest-spread README. (@existentialism)
- #5379 Lint code snippets in READMEs. (@xtuc)
- #5334 Shorthand properties examples. (@bhoule)
- #5329 Update CONTRIBUTING.md with respect to coverage check [skip ci]. (@zjmiller)
🏠 Internal
- Other
babel-cli- #5342 Add test for passing arguments to babel-node (#5163). (@outsideris)
babel-traverse- #5296 Add test for reference paths. (@jasonLaster)
Committers: 14
- Aaron Ang (aaronang)
- Alex Kuzmenko (alxpy)
- Artem Gurzhii (artemgurzhii)
- Artem Yavorsky (yavorsky)
- Brendan Houle (bhoule)
- Brian Ng (existentialism)
- Daniel Tschinder (danez)
- Izaak Schroeder (izaakschroeder)
- Jason Laster (jasonLaster)
- JeongHoon Byun (aka Outsider) (outsideris)
- Robert Jackson (rwjblue)
- Seth Bergman (sethbergman)
- Sven SAULEAU (xtuc)
- Zachary Miller (zjmiller)
6.23.1 (2017-02-13)
Regression: Revert https://github.com/babel/babel/pull/5306 since it made a backwards-incompatible change.
6.23.0 (2017-02-13)
🚀 New Feature
babel-plugin-transform-react-constant-elementsbabel-preset-flow,babel-preset-react- #5288 Add new flow preset. (@thejameskyle)
babel-traversebabel-plugin-transform-es2015-block-scoping
🐛 Bug Fix
babel-core,babel-traversebabel-plugin-transform-es2015-for-of- #5298 Fix loose for-of with label. (@jridgewell)
babel-plugin-transform-react-constant-elements,babel-traversebabel-plugin-transform-do-expressions,babel-traverse- #5030 Prevent multiple return statements in a loop when replacing expressions. (@existentialism)
babel-registerbabel-traversebabel-plugin-transform-runtimebabel- #5258 checks if babel is installed globally and displays correct cli message. (@xtina-starr)
babel-generator- #5270 Emit parens for await of ternary expressions. (@erikdesjardins)
- #5193 Fix missing parens when function expressions is tag. (@existentialism)
babel-plugin-transform-es2015-modules-commonjs
📝 Documentation
babel-*- #5244 Normalize options sections in docs [skip ci]. (@existentialism)
- #5216 Remove link to REPL. (@xtuc)
- Other
babel-plugin-transform-es2015-spreadbabel-plugin-transform-flow-strip-typesbabel-plugin-transform-regeneratorbabel-plugin-transform-es2015-arrow-functions
🏠 Internal
babel-core- #5302 Add charset so tests work with convert-source-map@>1.4. (@loganfsmyth)
babel-core,babel-traversebabel-generatorbabel-typesbabel-*- #5265 Re-enable the max-len ESLint rule.. (@loganfsmyth)
- Other
- #5264 Add a sublime project file. (@loganfsmyth)
- #5182 Run coverage only once. (@existentialism)
- #5165 Add Node 7 to CI. (@chicoxyzzy)
Committers: 20
- Andres Suarez (zertosh)
- Ben Alpert (spicyj)
- Boopathi Rajaa (boopathi)
- Brian Ng (existentialism)
- Christina (xtina-starr)
- Erik Desjardins (erikdesjardins)
- Fabian Finke (finkef)
- Henry Zhu (hzoo)
- Jimmy Jia (taion)
- Justin Ridgewell (jridgewell)
- Logan Smyth (loganfsmyth)
- Matt Stewart (mattste)
- Samuel Reed (STRML)
- Sergey Rubanov (chicoxyzzy)
- Sven SAULEAU (xtuc)
- Vicente Jr Yuchitcho (chitchu)
- Yongxu Ren (yongxu)
- jwbay
- james kyle (thejameskyle)
- Łukasz Lityński (hex13)
6.22.2 (2017-01-19)
🐛 Bug Fix
babel-cli- Fix issue with
babel-nodethrowing errors when passed non-"-" args #5162.
- Fix issue with
6.22.1 (2017-01-19)
🐛 Bug Fix
babel-traverse- Temporary fix with
babel-traversevia #5019 for transform-react-constant-elements.
- Temporary fix with
6.22.0 (2017-01-19)
A quick update since it's been over a month already: adds support for shorthand import syntax in Flow + some fixes!
We'll be merging in our current 7.0 PRs on a 7.0 branch soon and I'l be making some more issues (most should be beginner-friendly).
To follow our progress check out our 7.0 milestone, the wiki and upcoming announcements on twitter!
We support stripping out and generating the new shorthand import syntax in Flow (parser support was added in babylon@6.15.0.
import {
someValue,
type someType,
typeof someOtherValue,
} from "blah";
🚀 New Feature
babel-generator,babel-types- #5110 Validate importKind and ensure code generation exists.. (@loganfsmyth)
babel-plugin-transform-flow-strip-types,babel-traversebabel-core
🐛 Bug Fix
babel-plugin-transform-object-rest-spread- #5151 Avoid duplicating impure expressions in object rest destructuring. (@erikdesjardins)
const { x, ...y } = foo();
Old Behavior
const { x } = foo();
const y = _objectWithoutProperties(foo(), ["x"]);
New/Expected Behavior
const _ref = foo(); // should only be called once
const { x } = _ref;
const y = _objectWithoutProperties(_ref, ["x"]);
babel-clibabel-plugin-transform-object-rest-spread- #5088 fix: plugin-transform-object-rest-spread param with default value. (@christophehurpeau)
Accounts for default values in object rest params
function fn({a = 1, ...b} = {}) {
return {a, b};
}
babel-plugin-transform-es2015-destructuring- #5093 Ensure array is always copied during destructure. (@existentialism)
const assign = ([...arr], index, value) => {
arr[index] = value
return arr
}
const arr = [1, 2, 3]
assign(arr, 1, 42)
console.log(arr) // [1, 2, 3]
babel-plugin-transform-es2015-function-name
Input
export const x = ({ x }) => x;
export const y = function () {};
Output
export const x = ({ x }) => x;
export const y = function y() {};
babel-typesbabel-cli
💅 Polish
babel-traversebabel-generator,babel-plugin-transform-exponentiation-operator- #5026 Remove unnecessary spaces around template element. (@chicoxyzzy)
📝 Documentation
- Other
babel-core- #5101 Document babelrc option. (@novemberborn)
- #5114 Update babel-core options in README. (@existentialism)
babel-plugin-syntax-class-constructor-callbabel-plugin-transform-es2015-duplicate-keys,babel-plugin-transform-es2015-parametersbabel-plugin-transform-es2015-computed-properties,babel-plugin-transform-es2015-for-of- #5096 Add examples to computed-props and for-of READMEs [skip ci]. (@existentialism)
babel-plugin-transform-class-properties- Other
babel-plugin-transform-es2015-classes,babel-plugin-transform-function-bind- #5061 Fix some doc lint issues. (@existentialism)
babel-helpersbabel-preset-react- #5051 Adding more info to the Install section. (@gitanupam)
babel-plugin-check-es2015-constants,babel-plugin-transform-es2015-modules-umd,babel-plugin-transform-es2015-typeof-symbol,babel-register- #5045 Fix some README links. (@existentialism)
babel-core
🏠 Internal
babel-*- #5129 Bump eslint-config-babel and fix lint. (@existentialism)
- #5138 Refactor packages to use ES modules instead of CJS. (@chicoxyzzy)
- #5113 Kaicataldo enable prefer const. (@hzoo)
babel-helper-transform-fixture-test-runner- #5135 Run Babel's unittests in a custom sandbox.. (@loganfsmyth)
babel-cli,babel-core,babel-generator,babel-helper-define-map,babel-register,babel-runtime,babel-typesbabel-cli,babel-generator,babel-helper-fixtures,babel-helper-transform-fixture-test-runner,babel-preset-es2015,babel-runtime,babel-traversebabel-code-framebabel-plugin-transform-react-jsxbabel-plugin-transform-decoratorsbabel-plugin-transform-es2015-computed-properties- #5053 Remove unused define-map helper from computed-properties. (@existentialism)
babel-cli
Committers: 23, First PRs: 10
- Andres Suarez (zertosh)
- Andrii Bida (nomicos) First PR!
- Anthony Zotti (amZotti) First PR!
- Anupam (gitanupam) First PR!
- Artem Yavorsky (yavorsky) First PR!
- Brian Ng (existentialism)
- Christophe Hurpeau (christophehurpeau)
- Daniel Tschinder (danez)
- Diogo Franco (Kovensky)
- Erik Desjardins (erikdesjardins)
- Henry Zhu (hzoo)
- Howard Yeh (hayeah) First PR!
- Janus Troelsen (ysangkok) First PR!
- Jeff Morrison (jeffmo)
- Karsten Gohm (kasn) First PR!
- Logan Smyth (loganfsmyth)
- Mark Wubben (novemberborn) First PR!
- Peter Mikula (peterm0x)
- Ryan Tsao (rtsao) First PR!
- Sergey Rubanov (chicoxyzzy)
- Simon Lydell (lydell)
- Sven SAULEAU (xtuc)
- Sérgio Batista (batista) First PR!
- rmacklin
6.21.1 (2016-12-17)
🐛 Bug Fix
babel-helper-builder-react-jsx,babel-plugin-transform-react-jsx- #5015 Revert the introduction of a new error message that ended up introducing its own error (@loganfsmyth)
6.21.0 (2016-12-16)
🚀 New Feature
babel-generator- #4979
babel-generator: Expose raw mappings. (@davidaurelio)
- #4979
Exposes raw mappings when source map generation is enabled. To avoid the cost of source map generation for consumers of the raw mappings only, .map is changed to a getter that generates the source map lazily on first access.
Raw mappings can be useful for post-processing source maps more efficiently by avoiding one decoding/encoding cycle of the b64 vlq mappings. This will be used in the React Native packager.
let generator = require("babel-generator");
let generated = generator(ast, { sourceMaps: true }, sources);
// generated.rawMappings
[
{
name: undefined,
generated: { line: 1, column: 0 },
source: "inline",
original: { line: 1, column: 0 }
},
...
]
🐛 Bug Fix
babel-generator,babel-plugin-transform-flow-comments,babel-plugin-transform-flow-strip-types- #4872 Print Flow optional & type annotations in function params with defaults. (@danharper)
Works with generator, transform-flow-comments, flow-strip-types.
function foo(numVal: number = 2) {}
babel-generator,babel-plugin-transform-es2015-modules-amd,babel-plugin-transform-es2015-modules-umd- #4873 Ensure directives get printed in block statements. (@existentialism)
let blockStatement = t.blockStatement(
[],
[t.directive(t.directiveLiteral("use strict"))]
);
babel-generator,babel-helper-builder-react-jsx,babel-plugin-transform-react-jsx,babel-types- #4988 Add
JSXSpreadChildrenbut throw in JSX transform plugin. (@jridgewell)
- #4988 Add
Will still error with Spread children are not supported.
<div>{...this.props.children}</div>;
babel-plugin-transform-es2015-block-scoping,babel-plugin-transform-react-constant-elements,babel-traverse
When multiple declarators are present in a declaration, we want to insert the constant element inside the declaration rather than placing it before because it may rely on a declarator inside that same declaration.
function render() {
const bar = "bar", renderFoo = () => <foo bar={bar} baz={baz} />, baz = "baz";
return renderFoo();
}
When block scoped variables caused the block to be wrapped in a closure, the variable bindings remained in parent function scope, which caused the JSX element to be hoisted out of the closure.
function render(flag) {
if (flag) {
let bar = "bar";
[].map(() => bar);
return <foo bar={bar} />;
}
return null;
}
babel-plugin-transform-es2015-parameters- #3572 Fix default parameter - rest parameter edge case. (@jridgewell)
Was erroring if the rest parameter shared the same name as a default identifier for a param, needed to be deopt'd.
const a = 1;
function rest(b = a, ...a) {
assert.equal(b, 1);
}
rest(undefined, 2)
babel-plugin-transform-es2015-for-of,babel-traverse- #5007 Bail on sharing comments with siblings if key is a string. (@existentialism)
myLabel: //woops
for (let a of b) {
continue myLabel;
}
📝 Documentation
- Other
- #4989 Fix links in CONTRIBUTING.md. (@abouthiroppy)
babel-plugin-transform-runtimebabel-plugin-transform-es2015-unicode-regex- #4983 Add example to es2015-unicode-regex. (@existentialism)
🏠 Internal
babel-helper-transform-fixture-test-runner,babel-plugin-syntax-trailing-function-commas
Allows running require() in exec.js tests like for babel/babel-preset-env#95
Committers: 9
- Andrey Marchenko (Tom910)
- Babel Bot (babel-bot)
- Brian Ng (existentialism)
- Dan Harper (danharper)
- David Aurelio (davidaurelio)
- Henry Zhu (hzoo)
- Justin Ridgewell (jridgewell)
- Scott Kyle (appden)
- Yuta Hiroto (abouthiroppy)
v6.20.3 (2016-12-08)
😢 Regression
babel-plugin-transform-async-to-generator- #4978 Calculate the correct arity for async functions with destructuring. (fixes #4977) (@loganfsmyth)
v6.20.2 (2016-12-08)
😢 Regression
Issue: https://github.com/babel/babel/issues/4972 again. Fixed by reverting part of the original PR in babel/babel#4883.
v6.20.1 (2016-12-08)
😢 Regression
Issue: https://github.com/babel/babel/issues/4972
The way that babel/babel#4883 changed visiting SpreadProperty (which didn't need to modified) caused an infinite loop. Added path.stop which ended up not fixing it correctly.
v6.20.0 (2016-12-08)
If you missed it, please check out our latest blog post: The State of Babel. Talks about where we can possibly move forward as a project and how you can help!
- Maybe fix that crazy babel-generator deopt message you've all probably seen!
- Change to
babel-code-framefor facebookincubator/create-react-app#1101 - Change to
babel-generatorfor webpack/webpack#3413 - Move implementation of Regenerator back to the original repo.
You've probably seen this more than a few times and had no idea what it meant...
[BABEL] Note: The code generator has deoptimised the styling of "app.js" as it exceeds the max of "100KB".
Generating code used to get really slow as file size increased. We've mostly fixed that, but we still automatically fall back to compact output on large files. We're going to bump the limit to 500KB and if there aren't issues just remove it.
Ben Newman, @benjamn: wrote Regenerator while at Facebook. It used a bunch of other libraries such as ast-types but has now been rewritten as a standalone Babel plugin (also thanks to Sebastian's previous work in facebook/regenerator#222). We're also moving the implementation of Regenerator back into the original repository since Ben is the creator/maintainer.
🚀 New Feature
Returns Array<Path> rather than Array<Node>.
path.getBindingIdentifierPaths()path.getOuterBindingIdentifierPaths()
traverse(parse(`
var a = 1, {b} = c, [d] = e, function f() {};
`), {
VariableDeclaration(path) {
let nodes = path.getBindingIdentifiers(); // a, d, b
let paths = path.getBindingIdentifierPaths();
},
FunctionDeclaration(path) {
let outerNodes = path.getOuterBindingIdentifiers(); // f
let outerPaths = path.getOuterBindingIdentifierPaths();
}
});
Forcibly syntax highlight the code as JavaScript (for non-terminals); overrides
highlightCode. For facebookincubator/create-react-app#1101
Usage
const result = codeFrame(rawLines, lineNumber, colNumber, {
forceColor: true
});
🐛 Bug Fix
babel-plugin-transform-es2015-block-scoping
In
try {
foo();
} catch (x) {
function harmless(x) {
return x;
}
}
Correct Out
try {
foo();
} catch (x) {
var harmless = function (x) {
return x;
};
}
babel-helper-remap-async-to-generator,babel-plugin-transform-async-generator-functions,babel-plugin-transform-async-to-generator- #4901 Only base async fn arity on non-default/non-rest params - Closes #4891. (@loganfsmyth)
// both length's should be 0
const foo = (...args) => { }
console.log(foo.length) // 0
const asyncFoo = async (...args) => { }
console.log(asyncFoo.length) // 0
babel-generator,babel-types- #4945 Add
babel-generatorsupport forImport. (@TheLarkInn)
- #4945 Add
Relevant for webpack 2 support of
Import. Just allows Babel to print it correctly.
import("module.js");
babel-plugin-transform-object-rest-spread- #4883 Fix for object-rest with parameters destructuring nested rest. (@christophehurpeau)
function a5({a3, b2: { ba1, ...ba2 }, ...c3}) {}
// should deopt if ids are referenced before the bindings
var a = b + 2; var b = 2 + 2;
babel-core,babel-generator,babel-helper-transform-fixture-test-runner,babel-plugin-transform-object-rest-spreadbabel-types- #4853 Preserve null in
babel-typest.cloneandt.deepClone(@NTillmann)
- #4853 Preserve null in
💅 Polish
babel-generator- #4862 Fix identation with empty leading
ObjectTypeProperty. (@existentialism)
- #4862 Fix identation with empty leading
📝 Documentation
Various Packages- #4938 Update babel-core documentation. (@xtuc)
- #4939 Add example to transform-react-display-name docs. (@existentialism)
- #4931 Update plugins READMEs from babel.github.io [skip ci]. (@raspo)
- #4926 Update transform-es2015 READMEs from babel.github.io [skip ci]. (@existentialism)
- #4930 Update transform-object-rest-spread's README from babel.github.io [skip ci]. (@lukyth)
- #4929 Update transform-object-assign's README from babel.github.io [skip ci]. (@lukyth)
- #4928 mention [skip ci] in PR template. (@hzoo)
- #4925 Tweak example in transform-jsx-source README [skip ci]. (@existentialism)
- #4919 Update async READMEs from babel.github.io [skip-ci]. (@existentialism)
- #4917 Fix some React transform README issues [skip-ci]. (@existentialism)
- #4903 Update React transform READMEs from babel.github.io [skip ci]. (@existentialism)
- #4884 Readme updates from babel.github.io [skip ci]. (@hzoo)
🏠 Internal
babel-plugin-transform-regeneratorbabel-traverse- #4934 Hoist
generateDeclaredUidIdentifierhelper function. (@jridgewell)
- #4934 Hoist
babel-polyfillbabel-runtimebabel-plugin-syntax-trailing-function-commas- #4936 Add
testtobabel-plugin-syntax-trailing-function-commas.npmignore(@wtgtybhertgeghgtwtg)
- #4936 Add
babel-helper-fixturesbabel-core,babel-traversebabel-generator- #4965 Raise limit on code size before compacting (@existentialism)
Committers: 17
- Ben Newman (benjamn)
- Benjamin E. Coe (bcoe)
- Boopathi Rajaa (boopathi)
- Brian Ng (existentialism)
- Christophe Hurpeau (christophehurpeau)
- Daniel Tschinder (danez)
- Denis Pushkarev (zloirock)
- Henry Zhu (hzoo)
- Joe Haddad (Timer)
- Justin Ridgewell (jridgewell)
- Kanitkorn Sujautra (lukyth)
- Logan Smyth (loganfsmyth)
- Nikolai Tillmann (NTillmann)
- Sean Larkin (TheLarkInn)
- Sven SAULEAU (xtuc)
- Tommaso (raspo)
- wtgtybhertgeghgtwtg
v6.19.0 (2016-11-16)
🚀 New Feature
babel-plugin-transform-object-rest-spread
This rewrite fixes a long standing issue where the object-rest-spread plugin was depending on 2 other plugins to compile RestProperty. This is important given the assumption that plugins should be independent and is vital for the use of babel-preset-env since new environments support destructuring natively.
RestProperty
- Parameters
function a({ b, ...c }) {}
- VariableDeclaration
const { a, ...b } = c;
- ExportNamedDeclaration
export var { a, ...b } = c;
- CatchClause
try {} catch ({a, ...b}) {}
- AssignmentExpression
({a, ...b} = c);
- ForXStatement
for ({a, ...b} of []) {}
SpreadProperty
- ObjectExpression
var a = { ...b, ...c }
babel-plugin-transform-class-properties
Usage
{
"plugins": [
["transform-class-properties", {
"spec": true
}]
]
}
- Class properties are compiled to use
Object.defineProperty - Static fields are now defined even if they are not initialized
In
class Foo {
static bar;
}
Out
var Foo = function Foo() {
babelHelpers.classCallCheck(this, Foo);
};
Object.defineProperty(Foo, "bar", {
enumerable: true,
writable: true,
value: undefined
});
We've added 2 similar "ancestry" path methods to path.findParent:
path.isAncestor/path.isDescenant
Usage:
let programPath, numberPath;
traverse(ast, {
Program(path) { programPath = path; },
NumberPath(path) { numberPath = path; },
});
programPath.isAncestor(numberPath); // true
numberPath.isDescendant(programPath); // true
Usage:
traverse.clearCache(); // clears both path's and scope cache
traverse.clearCache.clearPath();
traverse.clearCache.clearScope();
Usage:
{
"generatorOpts": {
"jsonCompatibleStrings": true // defaults to false
}
}
Set to true for the generator to use jsesc with "json": true. This will make it print "\u00A9" vs. "©";
- #3547 Added
flowUsesCommasoption for object types. (@sampepose)
Usage:
{
"generatorOpts": {
"flowCommaSeparator": true // defaults to false
}
}
Currently there are 2 supported syntaxes (, and ;) in Flow Object Types. The use of commas is in line with the more popular style and matches how objects are defined in Javascript, making it a bit more natural to write.
var a: { param1: number; param2: string }
var a: { param1: number, param2: string }
t.isNodesEquivalent
Usage:
assert(t.isNodesEquivalent(parse("1 + 1"), parse("1+1")) === true);
babel-plugin-transform-es2015-modules-systemjs- #4789 Support
import()as contextual import in system module format. (@guybedford)
- #4789 Support
Support stage-2 import() in systemjs.
It does not compile by default; you'll want to add the stage-2 preset or explicitly include babel-plugin-syntax-dynamic-import.
export function lazyLoadOperation () {
return import('./x')
.then(function (x) {
x.y();
});
}
🐛 Bug Fix
Will print the shorter of the NumericLiterals if using the minified option.
Input
5e1;
5e4;
Output
50;
5e4;
babel-plugin-transform-es2015-modules-systemjs- #4832 Fix system transformer to ensure consistent modules iteration. (@guybedford)
Fixes inconsistent modules iteration for numeric imports
import "2"; // should be imported first
import "1"; // second
babel-plugin-transform-es2015-destructuring,babel-plugin-transform-react-constant-elements
Fixes an issue with destructuring parameters being hoisted incorrectly.
Input
function render({ text }) {
return () => (<Component text={text} />);
}
Output
function render(_ref) {
let text = _ref.text;
var _ref2 = <Component text={text} />;
return () => _ref2;
}
📝 Documentation
🏠 Internal
babel-plugin-transform-async-to-generator- #4837 Fix crlf to lf. (@lion-man44)
- Other
Committers: 10
- Boopathi Rajaa (boopathi)
- Guy Bedford (guybedford)
- Henry Zhu (hzoo)
- Juriy Zaytsev (kangax)
- Moti Zilberman (motiz88)
- Sam Pepose (sampepose)
- Samuel Reed (STRML)
- Scott Stern (sstern6)
- Shine Wang (shinew)
- lion (lion-man44)
v6.18.2 (2016-11-01)
Weird publishing issue with v6.18.1, same release.
🐛 Bug Fix
The error message was actually invalid!
Invalid:
{ "presets": [{ "option": "value" }] }
Valid:
{
"presets": [
["presetName", { "option": "value" }] // the preset should be wrapped in `[ ]`
]
}
🏠 Internal
babel-helper-fixtures,babel-helper-transform-fixture-test-runner- Other
- #4796 Update eslint, use codeframe formatter. (@hzoo)
- #4792 Update flow-bin to version 0.34.0 🚀. (@greenkeeperio-bot)
- #4776 Update chai to version 3.5.0 🚀. (@greenkeeperio-bot)
babel-plugin-transform-async-to-generator- #4793 Fix async-to-generator/object-method-with-arrows line endings. (@jridgewell)
Commiters: 4
- Diogo Franco (Kovensky)
- Greenkeeper (greenkeeperio-bot)
- Henry Zhu (hzoo)
- Justin Ridgewell (jridgewell)
v6.18.1 (2016-11-01)
Weird publishing issue with v6.18.1, re-released as v6.18.2.
v6.18.0 (2016-10-24)
🚀 New Feature
babel-generator,babel-plugin-transform-flow-strip-types- #4697 Add variance node type and generate property variance annotations. (@samwgoldman)
Check out the blog post and flow docs for more info:
type T = { +p: T };
interface T { -p: T };
declare class T { +[k:K]: V };
class T { -[k:K]: V };
class C2 { +p: T = e };
// in
{['a' + 'b']: 10 * 20, 'z': [1, 2, 3]}
// out
{ab: 200, z: [1, 2, 3]}
babel-plugin-syntax-dynamic-import,babel-preset-stage-2
Parser support was added in https://github.com/babel/babylon/releases/tag/v6.12.0.
Just the plugin to enable it in babel.
// install
$ npm install babel-plugin-syntax-dynamic-import --save-dev
or use the new parserOpts
// .babelrc
{
"parserOpts": {
"plugins": ['dynamicImport']
}
}
babel-helper-builder-react-jsx,babel-plugin-transform-react-jsx- #4655 Add
useBuiltInsoption to helper-builder-react-jsx. (@existentialism)
- #4655 Add
Previously we added a useBuiltIns for object-rest-spread so that it use the native/built in version if you use a polyfill or have it supported natively.
This change just uses the same option from the plugin to be applied with spread inside of jsx.
// in
var div = <Component {...props} foo="bar" />
// out
var div = React.createElement(Component, Object.assign({}, props, { foo: "bar" }));
babel-generator,babel-traverse,babel-types- #4724 Add
EmptyTypeAnnotation. (@samwgoldman)
- #4724 Add
EmptyTypeAnnotation
Added in flow here and in babylon here.
function f<T>(x: empty): T {
return x;
}
f(); // nothing to pass...
babel-traverse
Track LabeledStatement separately (not part of bindings).
🐛 Bug Fix
Will give examples of code that was fixed below
babel-plugin-transform-react-inline-elements,babel-traverse
// issue with imported components that were JSXMemberExpression
import { form } from "./export";
function ParentComponent() {
return <form.TestComponent />;
}
babel-plugin-transform-es2015-modules-commonjs,babel-plugin-transform-react-inline-elements
import { Modal } from "react-bootstrap";
export default CustomModal = () => <Modal.Header>foobar</Modal.Header>;
if ( true ) {
loop: for (let ch of []) {}
}
class A {
prop1 = () => this;
static prop2 = () => this;
prop3 = () => arguments;
}
- #4631 fix(shouldIgnore): filename normalization should be platform sensitive. (@rozele)
babel-helper-remap-async-to-generator,babel-plugin-transform-async-generator-functions- #4719 Fixed incorrect compilation of async iterator methods. (@Jamesernator)
// in
class C {
async *g() { await 1; }
}
// out
class C {
g() { // was incorrectly outputting the method with a generator still `*g(){`
return _asyncGenerator.wrap(function* () {
yield _asyncGenerator.await(1);
})();
}
}
babel-plugin-check-es2015-constants,babel-plugin-transform-es2015-destructuring,babel-plugin-transform-es2015-modules-commonjs,babel-plugin-transform-es2015-parameters
// was wrapping variables in an IIFE incorrectly
for ( let i = 0, { length } = list; i < length; i++ ) {
console.log( i + ': ' + list[i] )
}
babel-plugin-transform-es2015-parameters- #4666 Fix error when constructor default arg refers to self or own static property. (@danharper)
// was producing invalid code
class Ref {
static nextId = 0
constructor(id = ++Ref.nextId, n = id) {
this.id = n
}
}
assert.equal(1, new Ref().id)
assert.equal(2, new Ref().id)
function first(...values) {
let index = 0;
return values[index++]; // ++ was happening twice
}
console.log(first(1, 2));
babel-plugin-transform-es2015-block-scoping
let x = 10;
if (1)
{
ca: let x = 20;
}
babel-helper-explode-assignable-expression,babel-plugin-transform-exponentiation-operator
a[`${b++}`] **= 1;
- #4642 Exclude super from being assign to ref variable. (@danez)
babel-plugin-transform-es2015-shorthand-properties,babel-plugin-transform-flow-comments,babel-plugin-transform-flow-strip-types
foo = {
bar() {
return super.baz **= 12;
}
}
- #4670 Retain return types on ObjectMethods in transform-es2015-shorthand-properties. (@danharper)
// @flow
var obj = {
method(a: string): number {
return 5 + 5;
}
};
babel-helper-define-map,babel-plugin-transform-es2015-classes,babel-plugin-transform-flow-comments,babel-plugin-transform-flow-strip-types- #4668 Retain method return types on transform-es2015-classes (Closes #4665). (@danharper)
// @flow
class C {
m(x: number): string {
return 'a';
}
}
💅 Polish
babel-plugin-check-es2015-constants,babel-plugin-transform-es2015-destructuring,babel-plugin-transform-es2015-modules-commonjs,babel-plugin-transform-es2015-parameters
// in
const [a, b] = [1, 2];
// out
var a = 1,
b = 2;
babel-plugin-transform-es2015-parameters- #4738 Avoid unnecessary +0 in transform-es2015-parameters. (@existentialism)
// was outputting an extra `index++ + 0`
function first(...values) {
var index = 0;
return values[index++];
}
babel-generator- #4646 Change babel-generator to output
booleaninstead ofboolfor theBooleanTypeAnnotationAST node. (@existentialism)
- #4646 Change babel-generator to output
var a: Promise<boolean>[];
// instead of
var a: Promise<bool>[];
babel-core- #4685 Better error messaging when preset options are given without a corresponding preset. (@kaicataldo)
We've had a few reports of users not wrapping a preset in
[]when passing in options so we added an extra error message for this.
ReferenceError: [BABEL] /test.js: Unknown option: base.loose2. Check out http://babeljs.io/docs/usage/options/ for more information about options.
A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:
Invalid:
`{ presets: [{option: value}] }`
Valid:
`{ presets: ["pluginName", {option: value}] }`
For more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.
- #4688 Update babel parser options. (@existentialism)
Documentation
- Other
- #4653 Tweak license for GitHub display. (@existentialism)
So that our MIT License shows up.
🏠 Internal
babel-cli- #4725 Remove babel-doctor from babel-cli. (@kaicataldo)
It's a one-time use tool (helpful after the initial release when upgrading from v5 to v6) that doesn't need to be a part of babel-cli. We'll publish it as a standalone package it someone asks for it.
- Other
- #4764 Add TEST_DEBUG env var option for test.sh, to enable node 6 debugger. (@DrewML)
- #4762 Update browserify to version 13.1.1 🚀. (@greenkeeperio-bot)
- #4748 Add clean-all command to reinstall node_modules. (@kaicataldo)
- #4744 Fix line endings on checkout. (@nhajidin)
- #4730 Add .gitattributes forcing LF line endings. (@motiz88)
- #4676 Remove travis short-circuit script. (@motiz88)
babel-traverse,babel-typesbabel-cli,babel-core,babel-helper-fixtures,babel-registerbabel-helper-transform-fixture-test-runnerbabel-cli,babel-code-frame,babel-core,babel-generator,babel-helper-transform-fixture-test-runner,babel-preset-es2015,babel-template,babel-traversebabel-cli,babel-code-frame,babel-core,babel-generator,babel-plugin-transform-es2015-modules-commonjs,babel-preset-es2015,babel-template,babel-traversebabel-cli,babel-corebabel-cli,babel-core,babel-plugin-transform-es2015-modules-systemjs,babel-preset-es2015babel-registerbabel-cli- #4680 Update: Eslint to 3.0 and update CI builds (Closes #4638). (@gyandeeps)
- #4662 🚀 Update fs-readdir-recursive to 1.0.0. (@danez)
babel-corebabel-generatorbabel-traverse
Commiters: 17
- Andrew Levine (DrewML)
- Brian Ng (existentialism)
- Dan Harper (danharper)
- Daniel Tschinder (danez)
- Eric Rozell (rozele)
- Greenkeeper (greenkeeperio-bot)
- Gyandeep Singh (gyandeeps)
- Henry Zhu (hzoo)
- Jordan Gensler (kesne)
- Juriy Zaytsev (kangax)
- Kai Cataldo (kaicataldo)
- Moti Zilberman (motiz88)
- Nazim Hajidin (nhajidin)
- Sam Goldman (samwgoldman)
- Simen Bekkhus (SimenB)
- Jamesernator
- sugargreenbean
v6.17.0 (2016-10-01)
👓 Spec Compliancy
Specification repo: https://github.com/tc39/proposal-async-iteration
Asynchronous Iteration was already added in 6.16.0 under stage-2 but it was moved to stage-3 at the latest TC-39 meeting.
// async generator syntax
async function* agf() {}
// for-await statement
async function f() {
for await (let x of y) {
g(x);
}
}
To use it as a standalone plugin:
{
"plugins": ["transform-async-generator-functions"]
}
With the stage-3 preset (or below):
{
"presets": ["stage-3"]
}
Similarly, object-rest-spread is now also at stage-3.
https://twitter.com/sebmarkbage/status/781564713750573056
142ac3ce7f
// Rest properties
let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
console.log(x); // 1
console.log(y); // 2
console.log(z); // { a: 3, b: 4 }
// Spread properties
let n = { x, y, ...z };
console.log(n); // { x: 1, y: 2, a: 3, b: 4 }
To use it as a standalone plugin:
{
"plugins": ["transform-object-rest-spread"]
}
With the stage-3 preset (or below):
{
"presets": ["stage-3"]
}
🚀 New Feature
References:
Adds a retainFunctionParens to babel-generator. This option will retain the parentheses around an IIFE.
// parens are stripped without the option
__d('x', (function () {}));
🐛 Bug Fix
babel-corebabel-generator- #4633 Fixed babel/babel#4632 - missing parentheses around yield expression …. (@bjouhier)
babel-plugin-transform-es2015-parametersbabel-plugin-transform-flow-comments- #4623 Fix regression in transform-flow-comments for class properties. (@danharper)
First PR!
- Bruno Jouhier (bjouhier)
v6.16.0 (2016-09-28)
Babel 6.16: Happy 2nd Birthday 🎂!
👓 Spec Compliancy
babel-core,babel-generator,babel-helper-remap-async-to-generator,babel-helpers,babel-plugin-transform-async-generator-functions,babel-types,babel-preset-stage-2, ...- #3473 via #4576 Implement support for async generator functions and for-await statements. (@zenparsing)
This change implements the async iteration proposal, currently at stage 2 (and pushing to stage 3 at the current TC-39 meeting). It includes the following features:
- Transforms async generator functions (
async function* g() { }) to wrapped generator functions, similar to the current async-to-generator transform.
async function* agf() {
this;
await 1;
yield 2;
return 3;
}
- Transforms
for-awaitstatements into for loops containing yield expressions.
async function f() {
for await (let x of y) {
g(x);
}
}
Example Usage
async function* genAnswers() {
var stream = [ Promise.resolve(4), Promise.resolve(9), Promise.resolve(12) ];
var total = 0;
for await (let val of stream) {
total += await val;
yield total;
}
}
function forEach(ai, fn) {
return ai.next().then(function (r) {
if (!r.done) {
fn(r);
return forEach(ai, fn);
}
});
}
var output = 0;
return forEach(genAnswers(), function(val) { output += val.value })
.then(function () {
assert.equal(output, 42);
});
babel-core,babel-generator,babel-plugin-transform-class-properties,babel-template,babel-traverse,babel-types
Parser support was added in babylon@6.11.0 with babel/babylon#121
// Example
class Foo {
[x]
['y']
}
class Bar {
[p]
[m] () {}
}
Parser support was added in babylon@6.10.0 with babel/babylon#104
// Example
var a : {| x: number, y: string |} = { x: 0, y: 'foo' };
🚀 New Feature
Babel will now also take the options: parserOpts and generatorOps (as objects).
parserOpts will pass all properties down to the default babylon parser. You can also pass a parser option to substitute for a different parser.
This will allow passing down any of babylon's options:
{
"parserOpts": {
"allowImportExportEverywhere": true,
"allowReturnOutsideFunction": true,
"sourceType": "module",
"plugins": ["flow"]
}
}
Another use case (the main reason for doing this), is to be able to use recast with Babel.
{
"parserOpts": {
"parser": "recast"
},
"generatorOpts": {
"generator": "recast"
}
}
{
presets: ["@org/babel-preset-name"], // actual package
presets: ["@org/name"] // shorthand name
}
useBuiltIns - Do not use Babel's helper's and just transform to use the built-in method (Disabled by default).
{
"plugins": [
["transform-object-rest-spread", { "useBuiltIns": true }]
]
}
// source
z = { x, ...y };
// compiled
z = Object.assign({ x }, y);
babel-code-frame is a standalone package that we use in Babel when reporting errors.
Now there is an option to specify the number of lines above and below the error
1 | class Foo {
> 2 | constructor()
| ^
3 | }
babel-core,babel-preset-es2015,babel-preset-es2016,babel-preset-es2017,babel-preset-latest,babel-preset-react,babel-preset-stage-0,babel-preset-stage-1,babel-preset-stage-2,babel-preset-stage-3
We previously made presets with commonjs exports
module.exports = {
plugins: [
require("babel-plugin-syntax-trailing-function-commas")
]
};
Now you can use export default as well
import transformExponentiationOperator from "babel-plugin-transform-exponentiation-operator";
export default {
plugins: [
transformExponentiationOperator
]
};
🐛 Bug Fix
babel-helpers,babel-plugin-transform-es2015-typeof-symbol- #3686 Fix
typeof Symbol.prototype. (@brainlock)
- #3686 Fix
// `typeof Symbol.prototype` should be 'object'
typeof Symbol.prototype === 'object'
babel-cli- #3456 Use the real sourcemap API and handle input sourcemaps - Fixes #7259. (@loganfsmyth)
- #4507 Only set options in cli if different from default. (@danez)
Fix an issue with defaults not being overridden. This was causing options like comments: false not to work correctly.
- #4508 Support custom ports for V8 --inspect. (@andykant)
- #4562 Fixes #2299: Prevent REPL from printing implicit 'use strict'. (@hzoo)
babel-plugin-transform-es2015-function-name,babel-traverse- #4524 Fix default export with arrows and function naming. (@danharper)
// wasn't exporting correctly before
export default ({ onClick }) => {
return <div onClick={() => onClick()}></div>;
}
babel-plugin-transform-es2015-modules-commonjs
export default class {};
// wasn't correctly transforming to
exports["default"] = class {}
// with the es3-tranforms
babel-plugin-transform-flow-strip-types,babel-types
// <X> wasn't stripped out
const find = <X> (f: (x:X) => X, xs: Array<X>): ?X => (
xs.reduce(((b, x) => b ? b : f(x) ? x : null), null)
)
babel-generator,babel-plugin-transform-flow-comments- #4504 Flow: Fix generating arrow functions with param. (@danharper)
babel-registerbabel-core- #4570 Fix fileName options passed to babylon. (@DatenMetzgerX)
babel-traverse- #4534 Fix issue with minified libraries and code coverage. (@withinboredom)
babel-plugin-transform-es2015-destructuring
We noticed that we can not make this optimizations if there are function calls or member expressions on the right hand side of the assignment since the function call or the member expression (which might be a getter with side-effect) could potentially change the variables we are assigning to.
[x, y] = [a(), obj.x];
// was tranforming to
x = a();
y = obj.x;
// now transforms to
var _ref = [a(), obj.x];
x = _ref[0];
y = _ref[1];
babel-types- #4587 Prevent flow-strip-types/flow-comments from removing entire ClassProperty. (@danharper)
💅 Polish
babel-code-frame
Before
After
babel-corebabel-helper-replace-supers- #4520 Remove unused
thisReferenceargument togetSuperProperty. (@eventualbuddha)
- #4520 Remove unused
babel-generator- #4478 babel-generator: Ensure ASCII-safe output for string literals. (@mathiasbynens)
babel-core,babel-plugin-transform-es2015-arrow-functions,babel-plugin-transform-es2015-destructuring,babel-plugin-transform-es2015-modules-commonjs,babel-plugin-transform-es2015-parameters- #4515 Flip default parameter template. (@jridgewell)
babel-core,babel-helpers
🏠 Internal
Cleanup tests, remove various unused dependencies, do not run CI with only readme changes.
babel-plugin-transform-es2015-modules-amd,babel-plugin-transform-es2015-modules-commonjs,babel-plugin-transform-es2015-modules-umd- #4543 Remove duplicate default error. (@kaicataldo)
babel-generator,babel-plugin-transform-es2015-modules-amd,babel-plugin-transform-es2015-modules-commonjs,babel-plugin-transform-es2015-modules-systemjs,babel-plugin-transform-es2015-modules-umd,babel-plugin-transform-flow-strip-types- #4538 Fix tests with duplicate named exports. (@kaicataldo)
babel-plugin-transform-es2015-function-name- #4532 Add tests for other module formats, from #4524. (@danharper)
babel-plugin-transform-es2015-parameters,babel-traversebabel-polyfillbabel-preset-es2015- #4501 Remove ES2015 tests than do not parse in ES2016. (@TimothyGu)
babel-plugin-transform-regeneratorbabel-code-framebabel-helper-transform-fixture-test-runner- Other
Commiters: 20
First PRs!
- Alberto Piai (brainlock)
- Andy Kant (andykant)
- Basil Hosmer (bhosmer)
- Bo Borgerson (gigabo)
- Dan Harper (danharper)
- Kay J. (ksjun)
- Maxime Thirouin (MoOx)
- Micha Reiser (DatenMetzgerX)
- Moti Zilberman (motiz88)
- Rob Landers (withinboredom)
- Timothy Gu (TimothyGu)
- zenparsing (zenparsing)
v6.15.0 (2016-08-31)
#3612 The main change is an option to transform-runtime for a custom path which will be used in create-react-app. Also some bug fixes.
{
"plugins": ["transform-runtime", {
"moduleName": "my-custom-babel-runtime"
}]
}
#3689 Adds a preserveComments option to babel-template.
It's @ben-eb, @d4rkr00t, and @ryb73 first PRs!
New Feature
babel-plugin-transform-runtimebabel-template,babel-traverse,babel-types
Bug Fix
babel-plugin-transform-es2015-block-scopingbabel-typesbabel-traversebabel-helper-builder-binary-assignment-operator-visitor,babel-plugin-transform-es2015-classes
Documentation
Internal
babel-traverse,babel-types- #3676 Remove the cycle from babel-types/babel-traverse.. (@loganfsmyth)
v6.14.0 (2016-08-23) TAKE ME TO FLAVOR TOWN
Lots of stuff in this release!
- #3624 A new preset for
es2017: it includes the 2 previous stage-3 plugins: async/await (via transform-async-to-generator) and trailing commas in functions. (thanks to @bettiolo for the npm package)
npm install babel-preset-es2017 --save-dev
// .babelrc
{ "presets": ["es2017"] }
- #3625, #3673 A new preset called
latestthat transforms ES2015+ (currently ES2015, ES2016, ES2017). You can also pass options down to thees2015preset.
We also will be working on getting a target/env (autoprefixer) preset soon.
npm install babel-preset-latest --save-dev
// .babelrc
{ "presets": ["latest"] }
// with options
{ "presets": [
["latest", {
"es2015": {
"modules": false
}
}]
] }
- #3671 We also are including a
specoption for thees2015preset since the arrow function/template string plugins support this option.
specfor arrow functions uses.bind(this), instead of renaming, to makethisavailable inside the transformed function. It also adds a runtime check to make sure they are not instantiated (since they transform into bound regular functions).specfor template literals wraps all expressions inStringrather than simple string concatenation.
// .babelrc
{
"presets": [
["es2015", { "spec": true }]
]
}
-
#3659 @kittens added an optional
wrapPluginVisitorMethodcallback to transform to allow for performance tracking/introspection of plugins. More docs will be added on the website soon. -
#3658 sourcemaps will also now have a
namesfield for identifiers to allow debuggers to do re-aliasing of mangled identifiers. -
#3518 For spec compilancy, we now will throw on a file with multiple export default.
Notable Bug Fixes
- #3527 Fix class inheritance in IE <=10 without
loosemode. - #3644 Support the
ignoreconfig option in.babelrc. - #3655 Flow-only class props were not be stripped without
transform-class-properties.
Guy Fieri
babel-core- #3641 Fix exports of babel-core. (@thejameskyle)
- #3646 Remove Guy Fieri from Babel's source code. (@jdan)
Commiters: 17
It's also a lot folk's first PR (or first code PR)!
- Adam Leventhal (ahl)
- Boopathi Rajaa (boopathi)
- Diogo Franco (Kovensky)
- Jordan Scales (jdan)
- Kai Cataldo (kaicataldo)
- Marcelo Jorge Vieira (marcelometal)
- Paul O’Shannessy (zpao)
- Sota Yamashtia (sotayamashita)
- Thomas Aylott (subtleGradient)
New Feature
babel-preset-es2015babel-preset-latest- #3673 add options to
babel-preset-latest. (@hzoo) - #3625 Create
babel-preset-latest. (@sotayamashita)
- #3673 add options to
babel-preset-es2017- #3624 Add es2017-preset. (@sotayamashita)
babel-core,babel-traversebabel-cli,babel-core,babel-generator,babel-plugin-transform-regenerator,babel-template,babel-traversebabel-generator,babel-types
Spec Compliancy
babel-plugin-transform-es2015-modules-amd,babel-plugin-transform-es2015-modules-commonjs,babel-plugin-transform-es2015-modules-umd- #3518 Throw error for multiple exports default. (@kaicataldo)
Bug Fix
babel-core,babel-helper-replace-supers,babel-plugin-transform-class-properties,babel-plugin-transform-es2015-classes,babel-plugin-transform-es2015-function-name,babel-plugin-transform-es2015-object-super,babel-plugin-transform-es2015-parametersbabel-cli- #3644 Fixes #6726 ignore config option. (@subtleGradient)
babel-plugin-transform-es2015-modules-systemjs- #3650 System.register update expression consistency. (@guybedford)
babel-generatorbabel-registerbabel-plugin-transform-es2015-block-scopingbabel-traversebabel-plugin-transform-flow-strip-types- #3655 Strip flow-only class props without needing transform-class-properties.. (@loganfsmyth)
Documentation
- Other
- #3651 Fixed typo in README.md. (@marcelometal)
Internal
babel-preset-es2015,babel-preset-latestbabel-preset-es2015- #3672 Fixes modules test to actually test modules. (@Kovensky)
- #3640 Update test name to reflect reality.. (@eventualbuddha)
- Other
v6.13.2 (2016-08-05)
Hi again, just fixing up logic from the backwards-compatibility fix which broke options in presets. Also added more tests and will update Babel to use the new preset options after this release.
Bug Fix
babel-core,babel-preset-es2015- #3638 [Bug Fix] option manager: val = val.buildPreset should be before the check if the preset supports options (@christophehurpeau)
v6.13.1 (2016-08-04)
We had a regression in our new babel-preset-es2015@6.13.0 that made it unexpectedly backward-incompatible. This release introduces a new alternative plugin-options approach that is uglier but supports backward-compatibility. Ideally new plugins would use the new module.exports = function(babel, options){ } approach and simple skip supporting babel-core@<6.13.x.
Bug Fix
babel-core,babel-preset-es2015- #3635 Fix backward-compatibility of babel-preset-es2015. (@loganfsmyth)
v6.13.0 (2016-08-04)
Since the last release we've created https://github.com/babel/notes to track discussions on our slack and high level features/changes that could be added - definitely check it out if you're interested in Babel's development!
Some small but very important additions in this release:
Preset options (babel/notes)
Initially, presets were supposed to be one-off sets of plugins that didn't have any configuration. If you wanted to do something different you would make your own presets. There are > 600 presets on npm now. We want to give users more flexibility in certain cases: like when you want to pass the same option to multiple presets or to remove a default plugin.
loose and modules options for babel-preset-es2015 (#3331, #3627)
This has been rather annoying. Having to install babel-preset-es2015-loose-native-modules seems rather crazy when it could be an option.
With #3627, you can pass 2 options in:
loose- Enable "loose" transformations for any plugins in this preset that allow them (Disabled by default).modules- Enable transformation of ES6 module syntax to another module type (Enabled by default to"commonjs"). Can befalseto not transform modules, or one of["amd", "umd", "systemjs", "commonjs"]
// for loose and native modules
{
presets: [
["es2015", { "loose": true, "modules": false }]
]
}
Updates to babel-preset-stage-2
- #3613 Move the decorators transform.
- #3626 Make a more informative error message when using the default decorators transform and link to the legacy transform
- #3611 Move class properties transform.
Coming Up
babel-preset-es2017,babel-preset-latest(still deciding the name), supporting codemods, and more!
New Feature
babel-core,babel-preset-es2015- #3627 es2015: transpile the preset, modify modules option to support "amd,umd,systemjs" as well, tests. (@hzoo)
- #3331 Support passing options to presets.. (@loganfsmyth)
babel-preset-stage-1,babel-preset-stage-2- #3613 Move decorators to stage 2. (@doug-wade)
- #3611 Move
babel-plugin-transform-class-propertiesto stage 2. (@kripod)
Bug Fix
babel-traverse- #3557 Fix bug where
path.evaluatetreats repeated identifiers as undefined. (@erikdesjardins)
- #3557 Fix bug where
Polish
babel-plugin-transform-decorators
Internal
babel-typesbabel-plugin-syntax-async-functions,babel-plugin-syntax-async-generators,babel-plugin-syntax-class-constructor-call,babel-plugin-syntax-class-properties,babel-plugin-syntax-decorators,babel-plugin-syntax-do-expressions,babel-plugin-syntax-exponentiation-operator,babel-plugin-syntax-export-extensions,babel-plugin-syntax-flow,babel-plugin-syntax-function-bind,babel-plugin-syntax-function-sent,babel-plugin-syntax-jsx,babel-plugin-syntax-object-rest-spread,babel-plugin-syntax-trailing-function-commasbabel-plugin-transform-inline-environment-variables,babel-plugin-transform-member-expression-literals,babel-plugin-transform-merge-sibling-variables,babel-plugin-transform-minify-booleans,babel-plugin-transform-node-env-inline,babel-plugin-transform-property-literals,babel-plugin-transform-remove-console,babel-plugin-transform-remove-debugger,babel-plugin-transform-simplify-comparison-operators,babel-plugin-transform-undefined-to-void- Other
- #3622 Update mocha to version 3.0.0 🚀. (@greenkeeperio-bot)
Commiters: 7
- Daniel Tseng (kpman)
- Douglas Wade (doug-wade)
- Erik Desjardins (erikdesjardins)
- Greenkeeper (greenkeeperio-bot)
- Henry Zhu (hzoo)
- Kristóf Poduszló (kripod)
- Logan Smyth (loganfsmyth)
v6.12.0 (2016-07-27)
- Add a
helpers: falseoption totransform-runtimeto not bundle in babel helpers. - Add a
exactGlobalsoption tomodules-umd - Fix a regression with
modules-systemjs - Fix a hoisting issue with
react-constant-elements(@kittens is back!)
Bug Fix
babel-plugin-transform-react-constant-elements,babel-traversebabel-plugin-transform-es2015-modules-systemjs
New Feature
babel-plugin-transform-runtimebabel-plugin-transform-es2015-modules-umd
Commiters: 3
v6.11.6 (2016-07-26)
- Reverts #3523 since it caused some issues with code coverage tools.
- Update readme to explain Babel packages
Bug Fix
babel-registerbabel-plugin-transform-es2015-modules-systemjs
Documentation
Commiters: 3
v6.11.5 (2016-07-23)
Thanks to Rob Eisenberg (EisenbergEffect), Keyan Zhang (keyanzhang), Rolf Timmermans (rolftimmermans), Thomas Grainger (graingert),
we have few fixes: fix babel-register file paths on error, infer class name for classes with class properties, fix export * to account for previously compiled modules.
Bug Fix
babel-plugin-transform-es2015-modules-amd,babel-plugin-transform-es2015-modules-commonjs,babel-plugin-transform-es2015-modules-systemjs,babel-plugin-transform-es2015-modules-umd- #3591 Fix buildExportAll to account for commonjs/amd/systemjs. (@hzoo) - thanks (@EisenbergEffect) and (@jmm)
babel-register- #3523 Correct source map paths for babel-register. (@rolftimmermans)
- #3588 Fix typo in config: sourceMaps -> sourceMap. (@graingert)
babel-plugin-transform-class-properties- #3589 Infer class name for classes that have static property initializer(s). (@keyanzhang)
v6.11.4 (2016-07-20)
In this release among other things are some more optimizations for babel-generator (#3584, #3580) as well as refactors.
@jamestalmage did some awesome clean for OptionsManager and some tests which may help future improvements to babel-register performance.
Bug Fix
babel-plugin-transform-remove-console,babel-plugin-transform-remove-debugger,babel-traversebabel-plugin-transform-regenerator- #3586 Avoid duplicated identifier sharing location - Fixes #7436. (@loganfsmyth)
babel-cli
Polish
babel-core- #3564 Extract config file resolution from OptionsManager . (@jamestalmage)
babel-generator,babel-plugin-transform-es2015-modules-commonjs- #3584 babel-generator: More refactoring and optimizations. (@loganfsmyth)
babel-plugin-transform-es2015-parameters- #3574 Default parameters cleanup. (@jridgewell)
babel-generator- #3581 babel-generator: Misc cleanup and stale code removal. (@loganfsmyth)
- #3580 Further optimize babel-generator Buffer. (@jridgewell)
Commiters: 6
- Daniel Tschinder (danez)
- Henry Zhu (hzoo)
- James Talmage (jamestalmage)
- Jhen-Jie Hong (jhen0409)
- Justin Ridgewell (jridgewell)
- Logan Smyth (loganfsmyth)
v6.11.3 (2016-07-13)
The main fix is @loganfsmyth's changes of some parts in babel-generator in #3565 to fix issues with exponential code generation times in certain cases.
Items: the size of the array being generated Time: The time in ms to generate the code Length: The number of characters in the output code
| Items | Old Time | New Time | Length |
|---|---|---|---|
| 2 | 9 | 7 | 239 |
| 4 | 2 | 5 | 465 |
| 8 | 6 | 5 | 917 |
| 16 | 6 | 6 | 1840 |
| 32 | 15 | 11 | 3696 |
| 64 | 25 | 3 | 7408 |
| 128 | 93 | 13 | 14917 |
| 256 | 380 | 18 | 30149 |
| 512 | 1399 | 45 | 60613 |
| 1024 | 5301 | 63 | 121614 |
| 2048 | 20676 | 117 | 246542 |
- Fix rest param optimization bug
- Allow disabling "use strict" when using the cjs module transform.
- Fix typo with es2016 preset
Bug Fix
babel-plugin-transform-es2015-parameters- #3573 Fix error in rest parameter length optimization. (@jridgewell)
babel-generator- #3567 Use the first item in the queue since it is the most recent.. (@loganfsmyth)
babel-plugin-transform-es2015-modules-commonjs,babel-plugin-transform-strict-mode- #3562 Adds strictMode option to strict-mode transform. (@thejameskyle)
babel-preset-es2016- #3563 Use the proper transform plugin for preset-es2016.. (@loganfsmyth)
Polish
babel-generator- #3566 Remove unused Position#unshift. (@jridgewell)
- #3565 Make the code generator write-only to avoid exponential time generation. (@loganfsmyth)
Commiters: 3
- James Kyle (thejameskyle)
- Justin Ridgewell (jridgewell)
- Logan Smyth (loganfsmyth)
v6.11.2 (2016-06-28)
Bug Fix
- #3558 Fix non-unique 'ref' binding name for async functions. (@loganfsmyth)
v6.11.1 (2016-06-27)
Bug Fix
Documentation
babel-typesUpdate docs + scripts @ForbesLindesay
v6.11.0 (2016-06-26)
- In this release, there's now an
es2016preset which includes the exponentiation operator (thanks for (@ysmood) for giving us the npm package). - The
trailing-function-commasplugin has been moved fromstage-2preset tostage-3preset. babel-plugin-transform-react-jsx-selfhas been added to thereactpreset indevelopmentmode. There is a new dev warning being added in react and this plugin adds the__self={this}JSX attribute to all JSX elements.babel-plugin-es2015-unicode-regexhas it'sregexpu-coredependency updated to2.x.- Babel now uses lerna 2.x!
New Feature
babel-preset-es2016- #3531 Add
es2016preset. (@chicoxyzzy)
- #3531 Add
babel-preset-stage-2,babel-preset-stage-3- #3522 Promote
trailing-function-commasto stage 3. (@jacobrask)
- #3522 Promote
babel-plugin-transform-react-jsx-self,babel-preset-react
Spec Compliancy
babel-plugin-transform-es2015-unicode-regex- #3338 Update to
regexpu-core@2.0.0for ES2016 compliance. (@mathiasbynens)
- #3338 Update to
Bug Fix
babel-plugin-transform-react-jsx-self- #3550 Fix some mistakes in the jsx-self transform. (@loganfsmyth)
babel-generator- #3548 Fix incorrect Flow object whitespacing. (@sampepose)
Internal
- Other
babel-code-frame
Commiters: 9
- Henry Zhu (hzoo)
- Jacob Rask (jacobrask)
- Jesse McCarthy (jmm)
- Jim (jimfb)
- Logan Smyth (loganfsmyth)
- Mathias Bynens (mathiasbynens)
- Sam Pepose (sampepose)
- Sergey Rubanov (chicoxyzzy)
- Simon Lydell (lydell)
6.10.4 (2016-06-21)
Bug Fix
babel-traverse- Fix NodePath#evaluate to avoid a possible max-recursion-depth from an evaluation cycle (@kittens)
Internal
babel-core- Bump the from
2.xto3.xforminimatchto avoid a deprecation warning (@theJian)
- Bump the from
6.10.3 (2016-06-18)
Bug Fix
babel-plugin-transform-es2015-modules-commonjs- #3532 Allow export statements with no export specifiers (@loganfsmyth)
6.10.2 (2016-06-17)
@loganfsmyth made some awesome optimizations and better whitespace handling for babel-generator again (~10-15% performance improvement)!
Also a small fix for babel/babel-eslint#321
Bug Fix
Internal
- Other
babel-generator- #3492 Refactor space insertion and remove some unneeded function options. (@loganfsmyth)
6.10.1 (2016-06-11)
Bug Fixes
- #3525: Remove the nonfunctional -s shorthand for
--skip-initial-build(@lxe) - #3526: Fix an issue with the switch handing from PR #3490 (@loganfsmyth)
6.10.0 (2016-06-11)
New Feature
- Do not compile files before watching
$ babel src -d dest --watch --skip-initial-build
Bug Fix
babel-plugin-transform-es2015-block-scoping: Create a new lexical environment inside switch statement blocks for identifier bindings (#3490, T7324) (@jayphelps)
let foo = false;
switch (true) {
default:
let foo = true;
}
alert(foo); // should be false
babel-types,babel-generator: Support changes in flow parsing in babylon
Add support for a TypeParameter node.
type A<T = string> = T;
class A<S = number, T: ?string = string> {};
Documentation
- Clean up language/consistency in CONTRIBUTING.md (#3517) (@kaicataldo)
- Fix up broken links in monorepo.md (#3519) (@koenkivits)
6.9.2 (2016-05-29)
Fixup missing dependency.
Bug Fix
babel-runtime: Fix an issue with gettingCannot find module 'regenerator-runtime'because it was set as a devDependency instead of a dependency.
6.9.1 (2016-05-29)
Just 2 fixes this release!
- A class property fix (set
thiscorrectly when using async arrow function class properties without a super class). - A fix for
react-constant-elementsplugin to help optimize react more (the plugin wasn't applying to JSX with text).
Also, thanks to @mucsi96 for catching the extraneous code coverage comments we were leaving when publishing!
We are removing/deprecating
babel-regenerator-runtimein favor of depending on the originalregenerator-runtimesince the differences are resolved. Thanks to (@benjamn) for the suggestion to maintain it (and for originally creating it!).
Bug Fix
babel-core
The fix correctly set this: var _this; -> var _this = this;
// input
class MyClass {
myAsyncMethod = async () => {
console.log(this);
}
}
// output
class MyClass {
constructor() {
var _this = this; // _this wasn't being set to `this`
this.myAsyncMethod = babelHelpers.asyncToGenerator(function* () {
console.log(_this);
});
}
}
babel-plugin-transform-react-constant-elements,babel-types
JSX with text in it was not being hoisted as other constant elements.
// input
var Foo = React.createClass({
render() {
return <div>Text</div>; // text wasn't considered constant
}
});
// output
var _ref = <div>Text</div>;
var Foo = React.createClass({
render() {
return _ref;
}
});
Internal
-
#3513 Make sure the env is production when publishing. (@hzoo)
-
babel-regenerator-runtime -
babel-core -
babel-polyfill,babel-regenerator-runtime,babel-runtime
6.9.0 (2016-05-17)
- Update
core-jsfrom2.1.0to2.4.0. Check the releases for more info. - Add a
systemGlobaloption in the systemjs transform.
["transform-es2015-modules-systemjs", {
// outputs scoped_system.register(...)
"systemGlobal": "scoped_system" // defaults to System.register
}]
- Bug fixes for
class-propertiesandreact-jsx-sourceplugins.
New Feature
babel-typesbabel-plugin-transform-runtime,babel-polyfill,babel-register,babel-runtimebabel-plugin-transform-es2015-modules-systemjs- #3482 Add
systemGlobaloption to allow changing theSysteminSystem.registerto besystemGlobal. Also moveuse strictwrapping. (@guybedford)
- #3482 Add
Bug Fix
babel-plugin-transform-react-jsx-sourcebabel-plugin-transform-class-propertiesbabel-traversebabel-plugin-transform-es2015-parameters- #3481 also visit
ClassPropertyfor rest param deopt check, fixes T7311. (@jayphelps)
- #3481 also visit
Documentation
- #3498 Fix grammar in CHANGELOG. (@graingert)
Internal
Upgrade to lodash 4.
babel-traversebabel-helper-fixturesbabel-generatorbabel-cli,babel-core,babel-generator,babel-helper-builder-react-jsx,babel-helper-define-map,babel-helper-fixtures,babel-helper-regex,babel-helper-transform-fixture-test-runner,babel-plugin-transform-es2015-block-scoping,babel-plugin-transform-es2015-function-name,babel-plugin-transform-proto-to-assign,babel-preset-es2015,babel-register,babel-runtime,babel-template,babel-traverse,babel-types
Thanks to amasad, dlwalsh, forivall, frantic, graingert, guybedford, jayphelps, jhen0409, loganfsmyth, shuhei, zloirock!
6.8.0 (2016-05-02)
Babel is now compiled with Babel 6!
Why this is relevant
TLDR: This fixes the npm deduping issues regarding babel-runtime 5 and 6.
- Because all Babel packages were compiled with Babel 5 and using babel-runtime@5, npm can't dedupe any of them if a consumer of Babel also added a dependency on babel-runtime@6.
Example:
└─┬ babel-plugin-transform-exponentiation-operator@6.5.0
├─┬ babel-helper-builder-binary-assignment-operator-visitor@6.6.5
│ ├─┬ babel-helper-explode-assignable-expression@6.6.5
│ │ └── babel-runtime@5.8.38
│ └── babel-runtime@5.8.38
├─┬ babel-plugin-syntax-exponentiation-operator@6.5.0
│ └── babel-runtime@5.8.38
└── babel-runtime@5.8.38
Now it should be more like:
└─┬ babel-runtime@6.8.0
└─┬ babel-plugin-transform-exponentiation-operator@6.8.0
├─┬ babel-helper-builder-binary-assignment-operator-visitor@6.8.0
│ ├─┬ babel-helper-explode-assignable-expression@6.8.0
├─┬ babel-plugin-syntax-exponentiation-operator@6.8.0
Related issues: T7252, T7275, T6689, sindresorhus/ava#660, vuejs/vue-loader#96, etc.
Internal
- #3438 Self host on babel6. (@hzoo)
- #3477 turn transform into a simple
forloop. (@mattkrick)
Misc
- #3484 Travis: add node 6, remove iojs. (@hzoo)
- #3491 babel-template is an implementation of quasiquotes. (@rektide)
- #3479 Remove unused import in README (@oliviertassinari)
6.7.7 (2016-04-20)
Bug Fix
-
babel-code-frame -
babel-core- #3422 - Insert
thisreferences inconstructoraftersuper()(@loganfsmyth)
- #3422 - Insert
-
babel-generator- #3463 - Better sourcemaps for function bodies (@loganfsmyth)
Misc
-
babel-plugin-transform-es2015-modules-commonjs -
babel-generator,babel-types- #3475 - Performance improvements for the code generator (@loganfsmyth)
6.7.6 (2016-04-08)
babel-traverse- #3458: Revert PR #3433 which introduced https://phabricator.babeljs.io/T7272 (@loganfsmyth)
6.7.5 (2016-04-07)
Bug Fix
-
babel-traverse- #3433: Only attempt to rename export declarations, not expressions. (@loganfsmyth)
-
babel-core/babel-cli- #3448: Make sure input to path.{dir,base}name is a string. (@addaleax)
- #3451: Handle input sourcemaps with mappings to nothing to better support sourcemaps from other tools in a pipeline. (@loganfsmyth)
-
babel-helper-builder-react-jsx -
babel-generator- #3421: Wrap parens around default exports starting with function/class. (@loganfsmyth)
Misc
-
babel-plugin-transform-runtime- #3258: Expanded documentation (@trodrigues)
- #3441: Improve babel-code-frame. Kill the line-numbers dependency. (@lydell)
-
babel-traverse- #3442: Remove the old NodePath validation check (@loganfsmyth)
- #3447: Stop traversing when target type is found. (@nkzawa)
6.7.4 (2016-03-22)
Bug Fix
-
babel-traverse-
#3419: Keep the context stack balanced to ensure that contexts are properly popped off. (@loganfsmyth)
This bug was causing issues internally because the context system relies on the queues being balanced when deciding what nodes need to be re-processed and which do not. When it becomes imbalanced, nodes can be forgotten or skipped, causing issues like https://phabricator.babeljs.io/T7199 which broke ES6 modules on IE8 with the ES3 transforms.
-
#3420: Invalidate the scope cache when nodes are moved. (@loganfsmyth)
This bug was causing scoping issues in some cases if a node was moved to a new location that was not nested inside a new scope. When this case was hit, the old cached scope would be used, causing issues like https://phabricator.babeljs.io/T7194, https://phabricator.babeljs.io/T6934, and https://phabricator.babeljs.io/T6728.
-
-
babel-runtime -
babel-plugin-transform-react-jsx
Misc
babel-traverse- #3432: Fix a spelling mistake in an error message. (@simeonwillbanks)
Internal
- #3400: Fix an issue that could cause a local clone of Babel to error out if the github repo was in a location with a parent
.babelrcfile. (@callumlocke) - #3431: Fix an issue that was causing the local-development watcher to occasionally rebuild with the incorrect file content. (@loganfsmyth)
- #3436: Update our linting utility version. (@hzoo)
- #3437: Remove an unused dependency. (@hzoo)
babel-core
6.7.3 (2016-03-22)
babel-code-frame- Dropped problematic
line-numbersdependency which was broken due to the unexpected unpublishing of its dependencyleft-pad@0.0.3.
- Dropped problematic
6.7.3 (2016-03-10)
Bug Fix
babel-traverse- Fix a bug which caused the new Flow binding warning to show more often than expected (@amasad).
6.7.2 (2016-03-10)
Flow fix, mention babylon move
Bug Fix
babel-traverse- #3414: Warn on Flow-based bindings and don't count as a const violation. (@amasad)
We are treating static type information as part of the runtime scope information. So a Flow type declaration was being considered a binding on the scope. This was specifically problematic when we thinking that we're overwriting a binding:
The following code:
declare class foo {}
const foo = 1;
Will result in the error: "foo" is read-only
Since removing support for flow-based bindings would be a breaking change, in this release I'm adding a warning whenever someone tries to use Flow types as bindings.
Internal
babel-code-frame,babel-generator,babel-messages,babel-plugin-undeclared-variables-check,babel-polyfill,babel-register,babel-traverse,babel-typesbabylon- #3413 move babylon to https://github.com/babel/babylon. (@kittens)
6.7.1 (2016-03-09)
Bug Fix
babel-plugin-transform-es2015-block-scoping
The following code:
let foo = () => {
foo = () => { };
};
foo();
Was generating:
var foo = function foo() {
foo = function foo() {};
};
foo();
Notice how the function name foo was is shadowing the upper scope variable. This was fixed and the generated code now is:
var _foo = function foo() {
_foo = function foo() {};
};
_foo();
6.7.0 (2016-03-08)
Notable changes:
- Various async function fixes (const read-only error, wrong this, etc)
- Proper sourcemaps for import/export statements
- Moved internal Babel cache out of the AST
New Feature
Move cache into a clearable WeakMap, adds traverse.clearCache and traverse.copyCache. This doubles as a bug fix because previously reusable AST Nodes would carry their cache with them even if they're used across multiple files and transform passes.
babel-generator,babel-plugin-transform-flow-comments,babel-plugin-transform-flow-strip-types,babylon- #3385 Add support for Flow def-site variance syntax. (@samwgoldman)
// examples
class C<+T,-U> {}
function f<+T,-U>() {}
type T<+T,-U> = {}
This syntax allows you to specify whether a type variable can appear in
a covariant or contravariant position, and is super useful for, say,
Promise. @samwgoldman can tell you more 😄.
More docs on this in the babel-generator README
Bug Fix
Make sure all existing let/const bindings are removed and replaced with vars after the block-scoping plugin is run.
This fixes: SyntaxError: src/foo.js: "baz" is read-only (This is an error on an internal node. Probably an internal error. Location has been estimated.)
async function foo() {
async function bar() {
const baz = {}; // was creating a read-only error
}
}
babel-core,babel-traverse,babel-helper-remap-async-to-generator,babel-helper-replace-supers,babel-plugin-transform-async-to-generator,babel-plugin-transform-async-to-module-method- #3405 Fix shadow function processing for async functions (@loganfsmyth)
Should fix the majority of issues dealing with async functions and use of parameters, this, and arguments.
// fixes
class Test {
static async method2() {
setTimeout(async (arg) => {
console.log(this); // was showing undefined with arg
});
}
async method2() {
setTimeout(async (arg) => {
console.log(this); // was showing undefined with arg
});
}
}
babel-helper-remap-async-to-generator,babel-plugin-transform-async-to-generator,babel-plugin-transform-async-to-module-method- #3381 Fix named async FunctionExpression scoping issue.. (@keijokapp)
The problem is that the name bar of FunctionExpression is only visible inside that function, not in foo or ref.
// input
var foo = async function bar() {
console.log(bar);
};
// before
var foo = function () {
var ref = babelHelpers.asyncToGenerator(function* () {
console.log(bar);
});
return function bar() {
return ref.apply(this, arguments);
};
}();
// now
var foo = function () {
var ref = babelHelpers.asyncToGenerator(function* () {
console.log(bar);
});
function bar() {
return ref.apply(this, arguments);
}
return bar
}();
babel-plugin-transform-es2015-parameters
Many fixes to rest params: function asdf(...rest) { ... }
-
babel-template -
babel-plugin-transform-es2015-modules-commonjs- #3409 Fix source map generation for import and export statement.
Internal
babel-plugin-transform-es2015-modules-commonjs
Commiters: 6
amasad, divmain, hzoo, jmm, keijokapp, loganfsmyth, samwgoldman
6.6.5 (2016-03-04)
And.. some more bug fixes!
Bug Fix
babel-plugin-transform-es2015-computed-properties
// lead to `ReferenceError: b is not defined` at runtime
var obj = {
["a"]: 5,
set b(x) { console.log('set b', x); }
};
obj.b = 55;
babel-plugin-transform-object-rest-spread,babel-types- #3395 Recognize object rest properties as binding identifiers - Fixes T7178. (@loganfsmyth)
import props from 'props';
console.log(props);
(function(){
const { ...props } = this.props;
console.log(props); // props was referencing the imported props rather than in object spread
})();
babel-plugin-transform-es2015-block-scoping
Scope binding info wasn't updated after converting const/let/block bindings to var which could lead to errors with other transforms.
Internal
- #3398 Revert "Remove flow". (@amasad)
- #3397 Make sure lib is clean before publishing. (@hzoo)
babel-core,babel-plugin-transform-es2015-block-scoping,babel-plugin-transform-es2015-classesbabel-plugin-transform-es2015-modules-amd,babel-plugin-transform-es2015-modules-commonjs,babel-plugin-transform-es2015-modules-umd
Commiters: 5
AgentME, amasad, benjamn, hzoo, loganfsmyth
6.6.4 (2016-03-02)
Some more fixes!
Bug Fix
babel-plugin-transform-es2015-duplicate-keys
// sample code that was erroring
const obj = {
set a (a) {
values.a = a;
},
get a () {
return values.a;
}
};
babel-core
// .babelrc
{
"plugins": ["./myPluginDir/somePlugin.js"]
}
Babel will now resolve the plugin above relative to the directory that contains the .babelrc file rather than the process.cwd().
Internal
A lot of packages- #3392 Remove flow. (@samwgoldman)
Since users were getting error reports since Babel's codebase wasn't typechecking correctly. (Ref T7114) - Will be adding it back into the codebase itself soon.
6.6.3 (2016-03-01)
Bug Fix
babel-plugin-transform-es2015-modules-commonjs,babel-traverse- #3387 Fix regression with T7165 - let is not being transpiled when using export all (block-scoping transform wasn't run) (@loganfsmyth)
// example code
`export * from './a'`
6.6.2 (2016-03-01)
Bug Fix
babel-plugin-transform-es2015-modules-commonjs,babel-traverse- #3386 Fix regression with T7160 - exported arrow functions with default parameters (@loganfsmyth)
// example code
export var bar = (gen, ctx = null) => {}
6.6.1 (2016-02-29)
Bug Fix
babel-runtime,babel-polyfill: Fix publishing issue (wasn't updated from before).
6.6.0 (2016-02-29) "core-js 2, better error feedback"
Whoo a 🐸 leap day release!
exports.default fix
We finally fixed both T2817, T6863 where using both transform-es3-member-expression-literals and transform-es2015-modules-commonjs!
exports.default = {};
// was not to transformed to
exports["default"] = {};
You should be able to remove es3ify (a useful workaround for this issue). Thanks everyone for your patience, and much thanks to @loganfsmyth for the fix!
More helpful error messages
- If you are using a .babelrc with babel 5 options that were removed (there is a specific message for each one)
# before
ReferenceError: [BABEL] unknown: Unknown option: base.stage
# now
ReferenceError: [BABEL] unknown: Using removed Babel 5 option: base.stage
- Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets
# another example
ReferenceError: [BABEL] unknown: Using removed Babel 5 option: base.externalHelpers
- Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/
- If you are trying to use a babel 5 plugin
# before
babel Plugin is not a function
# now
The object-assign Babel 5 plugin is being run with Babel 6.
core-js
core-jswas updated to^2.1.0.
New Feature
New plugin babel-plugin-transform-es2015-duplicate-keys
babel-plugin-transform-es2015-duplicate-keys,babel-preset-es2015
babel-plugin-transform-es2015-duplicate-keys is a new plugin that is included in the es2015 preset. It was added since ES5 doesn't allow duplicate properties (it is valid in ES2015 strict mode however).
It will compile objects with duplicate keys to computed properties, which can be compiled with the transform-es2015-computed-properties plugin.
Example:
// .babelrc
{ "plugins": ["transform-es2015-duplicate-keys"] }
// Input
var x = { a: 5, "a": 6 };
// Output
var x = { a: 5, ["a"]: 6 };
New globals option for transform-es2015-modules-umd
babel-plugin-transform-es2015-modules-umd- #3366 [UMD] Fixed T6832. (@clayreimann)
// Adds a new plugin option to let you override the names of globals
// .babelrc
{
"plugins": [
["transform-es2015-modules-umd", {
"globals": {
"es6-promise": "Promise"
}
}]
]
}
Bug Fix
babel-plugin-transform-es2015-modules-commonjs,babel-traverse- #3368 Fix the module plugin to properly requeue so the ES3 transforms can work. (@loganfsmyth)
babylon- #3355 Clean up babylon bundle to allow it to be re-bundled - Fixes T6930. (@loganfsmyth)
babel-generator- #3358 Fix generator with empty token list and force a newline for line comments in concise mode. (@gzzhanghao)
babel-plugin-transform-es2015-parameters
// .babelrc
{ plugins: ["transform-es2015-parameters"] }
// Fixes an internal error with the code:
function x (...items) {
items[0] = 0;
}
babel-helper-remap-async-to-generator,babel-plugin-transform-es2015-parameters- #3336 Fixes T3077 (incorrect _arguments for async arrow functions with rest params). (@erikdesjardins)
// .babelrc
{
"plugins": ["external-helpers", "transform-es2015-parameters", "transform-async-to-generator"]
}
// Fixes an issue with using incorrect `arguments`
var x = async (...rest) => {
if (noNeedToWork) return 0;
return rest;
};
babel-plugin-transform-regenerator,babel-traverse- #3359 Queue regeneratorRuntime so it is transformed before Program#exit. (@loganfsmyth)
Fixes the _regeneratorRuntime is not defined error when using transform-runtime/transform-regenerator (this happened when using polyfillable code in core-js.
babylon- #3356 Properly fail to parse >== and <== - Fixes T2921. (@loganfsmyth)
babel-plugin-transform-es2015-block-scopingbabel-generator
// input
void (() => {});
// correct output
void (() => {});
// wrong
void () => {};
babel-generator
// input
(0xFFFF).toString()
// correct output
0xFFFF.toString()
// wrong
0xFFFF..toString()
Documentation
babel-plugin-transform-regeneratorbabel-plugin-transform-object-set-prototype-of-to-assign- #3369 fix babel-plugin-transform-proto-to-assign readme url. (@tiemevanveen)
babel-cli
Internal
- #3378 Remove Flow annotations and pragmas. (@samwgoldman)
- #3361 Switch to kcheck*, fix some lint rules. (@kittens)
babel-plugin-transform-runtime,babel-polyfill,babel-register,babel-runtime
Polish
babel-core,babel-traverse- #3365 Replace arrow expression body with block statement. (@jridgewell)
babel-corebabel-core
We have 15 committers this release!
Thanks to: AgentME, clayreimann, erikdesjardins, forivall, gzzhanghao, hzoo, jmm, jridgewell, kittens, loganfsmyth, samwgoldman, schmod, siroky, tiemevanveen, zloirock
6.5.2 (2016-02-12) "Who needs semicolons anyway” ¯\(ツ)/¯
Changes to note:
- Reverting the class properties semicolon parser error.
- Fix regression with plugin ordering with
babel-register.
Spec Compliancy
babel-plugin-transform-class-properties,babylon- #3332 Revert to standard ASI behavior for class properties. (@loganfsmyth)
Bug Fix
-
babel-core,babel-register- #3348 Merge config options into list after babelrc options - fixes T7079. (@loganfsmyth)
- This fixes a regression from #3168
-
babel-plugin-transform-es2015-spread- #3326 Fix spread to work with
supermethod calls. (@eetulatja)
// input super.method(...args); // wrong output super.method.apply(super, babelHelpers.toConsumableArray(args)); // new fixed output super.method.apply(this, babelHelpers.toConsumableArray(args)); - #3326 Fix spread to work with
-
babel-plugin-transform-function-bind,babel-types- #3334 Check
BindExpressioncallee for reference - fixes T6984. (@loganfsmyth)
- #3334 Check
Documentation
babel-registerbabel-plugin-transform-async-to-module-method,babel-plugin-transform-es2015-arrow-functions,babel-plugin-transform-es2015-classes,babel-plugin-transform-es2015-computed-properties,babel-plugin-transform-es2015-for-of,babel-plugin-transform-es2015-modules-commonjs,babel-plugin-transform-es2015-spread,babel-plugin-transform-es2015-template-literals,babel-plugin-transform-react-jsx,babel-plugin-transform-regenerator,babel-plugin-transform-runtime,babel-plugin-transform-strict-mode- #3352 Fix a typo. (@pra85)
Internal
babel- #3337 Don't preferGlobal on the
babelpackage.. (@loganfsmyth)
- #3337 Don't preferGlobal on the
babylon- #3344 Travis: Remove 0.10, since it's covered by Circle. (@hzoo)
- #3343 Travis CI: Switch from deprecated
stableNodeJS to latest 4.x.x & 5.x.x. (@ntwb) - #3341 bin-version-check is unnecessary now. (@chicoxyzzy)
- #3339 Know how to write good shell scripts. (@hzoo)
6.5.1 (2016-02-08) Daddy does a release.
- Bug Fix
bc2f84f371Fix options being ignored inbabel-register.- #3329 Fix
ExportSpecifiernode validator validatingimportedinstead ofexported.
- Polish
- #3333 Improve the error messaging for using the wrong CLI script.
6.5.0 (2016-02-07)
Happy Superbowl Sunday! There's many contributors (17 + core) this release!
A traversal per preset (Experimental)
This is an experimental feature that will most likely change. Depending on usage/feedback, we will switch the way this is used to instead define a explicit preset-level config flag (rather than the global one below). This will give more control over how you want to use this option.
@DmitrySoshnikov added a new option you can put in your .babelrc!
{
passPerPreset: true,
presets: [
{
plugins: ['plugin-1']
},
'preset-2',
{
plugins: ['plugin-2']
}
]
}
// this will create 3 traversals
passPerPreset: true will modify how babel traverses through plugins. Instead of a single traversal in which all plugins/presets are merged together, each preset will get their own traversal.
This allows users to have a specific order to how presets/plugins are applied and can help avoid potential collisions between plugins (and probably some known issues).
More Speeeeeeed
@gzzhanghao made some awesome changes to improve our code generator's performance (babel-generator). The original issue is here.
Based on his test (on parsing jquery.js), performance improved ~3x.
===== origin/master (ms) =====
babylon 265
babel generator 2238 <-- old
acorn 107
escodegen 355
esprima 95
escodegen 322
===== Optimized (ms) =====
babylon 296
babel generator 662 <-- new
acorn 113
escodegen 355
esprima 106
escodegen 317
A big change had to do with keeping this.last as an instance variable in the buffer instead of this.buf[this.buf.length -1].
You can read more about his changes here. Hoping to see more PR's like this!
We will try to setup some perf tests soon to track these stats for the future (or you can help!).
New Feature
babel-core- #3168 Use the
babelrcoption inbabel-register. (@CrocoDillon)
- #3168 Use the
babel-core- #3281
passPerPresetoption in.babelrc: iftrue, babel will create a new traversal for each preset. (@DmitrySoshnikov)
- #3281
babel-helper-transform-fixture-test-runner,babel-plugin-transform-react-jsx-source
This plugin (useful for tooling) will turn
// this/file.js
<sometag />
into
var _jsxFileName = "this/file.js"; // the output will be an absolute path
var x = <sometag __source={{
fileName: _jsxFileName,
lineNumber: 1
}} />;
babel-template- #3304 Allow passing in
babylonoptions intobabel-template. (issue T7046) (@jamestalmage)
- #3304 Allow passing in
babel-core
// analyse not analyze :D
// usage
babel.analyse("foobar;", {}, {
Program: function (path) {
path.mark("category", "foobar");
}
}).marked[0].message // outputs "foobar"
// allows for either `|` or `&`
type union =
| {type: "A"}
| {type: "B"}
;
This was added in flow in
7fb56ee9d8.
Bug Fix
Code samples below each bullet
babel-helper-define-map,babel-helper-function-name,babel-plugin-transform-es2015-classes
// When the same name as a method in a class is used
class Foo {
constructor(val) {
this._val = val;
}
foo2() {
return foo2(this._val); // was erroring since foo2 is used
}
}
babel-helper-remap-async-to-generator,babel-plugin-transform-async-to-generator- #3297 Fixes the wrong
thisfor nested arrow functions. (Issue T2765#72428) (@horpto)
- #3297 Fixes the wrong
// nested arrow functions
class A {
async method() {
() => {
() => this; // `this` in nested arrow function was incorrect
}
}
}
-
babel-template- #3314 Only strip node info if no
node.loc. Fixes an issue with sourcemap generation for SystemJS withbabel-template. (Issue T6903) (@guybedford)
- #3314 Only strip node info if no
-
babel-traverse- #3300 Fix an issue with transpiling generator functions with default arguments. (Issue T2776) (@gzzhanghao)
// a generator with a default argument
export class Test {
*memberGenerator(arg = 0) {
console.log(arg);
}
start() {
this.memberGenerator(1).next();
}
}
babel-generator
var fn = () => ({}).key;
babel-helper-remap-async-to-generator,babel-plugin-transform-es2015-modules-commonjs- #3312 Fix async functions not being hoisted. (Issue T6882) (@erikdesjardins)
foo();
async function foo() {} // this should be hoisted above foo();
babel-generator
// nested for loop
for (function(){for(;;);} && (a in b);;);
babylon- #3305 Fix: Arrow functions with trailing comma + return type parsing error. (Issue T7052) (@jviereck)
const X = (
props: SomeType,
): ReturnType => (
3
);
Documentation
- #3321 Docs: add information on writing tests in babylon. (@hzoo)
- #3308 Update compiler-environment-support.md. (@sappharx)
- #3293 ast/spec: update
Decoratorproperty. (@hzoo) - #3295 ast/spec: add
BindExpression. (@hzoo) - #3287 Correct use of possessive case. (@nettofarah)
- #3301 ast/spec: add
LiteralandPatterninterfaces, updateIdentifierinterface. (@jmm)
Internal
- #3317
make publish: addmake buildin case it wasn't run. (@hzoo) babel-generatorbabel-core,babel-generator,babel-traverse,babel-types,babylonbabel-corebabel-plugin-transform-async-to-generatorbabel-generator- #3299 Add a test to ensure that we do not break mutli-byte handling. (@robcolburn)
babel-clibabel-typesbabel-types
Polish
babel-generator- #3283 Improve generator performance. (Issue T6884) (@gzzhanghao)
6.4.6 (2016-01-20)
- Bug Fix
babel-helper-remap-async-to-generator: #3288 Async arrow functions should compile to regular functions because they referencearguments.
6.4.5 (2016-01-19)
-
Bug Fix
-
babel-plugin-transform-es2015-modules-commonjs: #3118 Fix bad import hoisting interaction (copy_blockHoistvalues) regarding import statements. (T6738). Thanks @benjamn for your patience for this one!- This fixes:
var _templateObject = (0, _taggedTemplateLiteral3.default)(["foo"], ["foo"]); // this should come after _taggedTemplateLiteral 2 and 3 var _taggedTemplateLiteral2 = require("babel-runtime/helpers/taggedTemplateLiteral"); var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2); tag(_templateObject); -
babel-types,babel-plugin-transform-es2015-modules-commonjs,babel-generator: #3183 Fix various source map issues. (T6851). Thanks for your work @kpdecker! Committed asde51bf5 -
babel-helper-remap-async-to-generator: #3257 Fix issue with usingthisinside an arrow function (T2765). Thanks @horpto!- This fixes:
class A { async method() { () => this; // this `this` wasn't being transpiled correctly } } -
babylon: #3272 Dedupe parser opts from passsed in multiple times. (T3084). Thanks @AgentME!- This fixes a specific issue with the react preset since it includes
syntax-flowandtransform-flow-strip-typeswhich caused an issue with the flow types not to be stripped and the general case of other people are including the flow syntax option in their own plugins.
- This fixes a specific issue with the react preset since it includes
-
babel-helper-define-map,babel-traverse,babel-plugin-transform-es2015-classes: #3274 Prevent method names in classes from being locally bound to the transformed function body. (T6712). Thanks @willheslam for helping to debug and coming up with alternative solutions for this issue!- This fixes:
SyntaxError: index.js: "foo" is read-only (This is an error on an internal node. Probably an internal error. Location has been estimated.) 1 | class Component { 2 | foo() { 3 | const foo = obj; 4 | } 5 | } 6 | -
babel-helpers: #3276 Add missing return statements toasyncToGeneratorhelper. -
babel-plugin-transform-es2015-modules-commonjs: #3282 Fixes an issue with usingdefaultas a specifier in an export.- This fixes an issue with:
export {default as foo} from "foo"; -
Documentation
-
babel-traverse: #3269 Document visitors.explode. Thanks @forivall! -
Internal
-
babel-plugin-transform-es2015-parameters: #3263 Test coverage. -
#3275 Temporarily change flow types to fix lint.
-
#3277 Fixup Makefile
.binreferences. Thanks @charliesome! -
#3278 Use local bin references instead of implied global in Makefile.
-
babylon: #3284 Add some more flow types. Thanks @bmeck! -
Polish
-
babel-plugin-transform-es2015-parameters: #3264 Simplify code, add comments.
6.4.4 (2016-01-13)
babel-plugin-transform-regenerator: Publishing issue (T2892).
6.4.3 (2016-01-13)
-
Bug Fix
-
babel-plugin-transform-es2015-typeof-symbol: #3250 The typeof transform should always use the globalSymbol. -
babel-plugin-transform-es2015-modules-amd: #3252 Stop leaking directives -
babel-pluginn-transform-es2015-unicode-regex: #3259 Use onlyregexpu-coreinstead of all ofregexpu -
babel-generator: Fix minified labeledStatement printing -
babel-plugin-transform-regenerator: #3162 Make sure babel helper picks upregeneratorRuntime -
Polish
-
babel-types: #3261 Add ArrayExpression.elements.default -
babel-register: #3232 Make sure the cache file's directory exists -
Documentation
-
babel-generator-options: #3251 Document babel-generator options
6.4.2 (2016-01-06)
- Bug Fix
babylon: #3244 fix error location for class properties with a missing semicolon (Ref #3225).babel-plugin-transform-es2015-parameters: #3246 Support expressions in rest arg access forarguments.lengthoptimization.babel-generator: #3247 Parenthesize await/yield expression inBinaryExpression(Ref #3229).
6.4.1 (2016-01-06)
6.4.0 (2016-01-06)
Thanks to @samwgoldman for all the new flow support!
-
New Feature
-
babylon,babel-types,babel-generator: #3202 Add support forthisflow type. -
babylon,babel-types,babel-generator: #3236 Add support forexport interfaceflow syntax. -
babylon,babel-types,babel-generator,babel-plugin-transform-flow-strip-types,babel-plugin-transform-flow-comments: #3230 Add support fordeclare typeanddeclare interfaceflow syntax. -
babylon,babel-types,babel-generator,babel-plugin-transform-flow-strip-types,babel-plugin-transform-flow-comments: #3203 Add support for flow mixins. -
babel-cli: #3221: Handle--nolazyflag. -
babel-plugin-transform-es2015-modules-systemjs: #3166 Add__moduleNamesupport toSystem.register. Thanks @guybedford! -
Bug Fix
-
babel-plugin-transform-es2015-parameters: #3214 Bugfix forarguments.lengthoptimization having the wrong length. Thanks @fabiomcosta! -
babylon: #3220 Don't parse parenthesized string as aDirective. -
babel-helpers: #3218 Defer to the built-intypeofif support for Symbols exists. Thanks @jdalton! -
babel-generator: #3213 Fix various parentheses bugs. -
babel-plugin-transform-react-display-name: #3216 More relaxeddisplayNameinference. -
babel-helper-function-name: #3215 Set function names fromAssignmentExpression. Thanks @spicyj! -
babel-generator: #3210 Use a print stack to determine in parenthesis needs to be added. -
babel-plugin-transform-runtime: #3235 Ensureopts.polyfill = falsebehaves correctly for all visitors. Thanks @guybedford! -
babel-plugin-transform-runtime: Ensureregeneratoroption doesn't cancel out core-js polyfill. -
babel-generator: #3229 Check for parentheses forAwaitExpressionsand fix over-parentheses inYieldExpressions. -
Breaking Change (Accidental)
-
babylon: #3225 throw parse error if class properties do not have a semicolon. -
babel-types: #3195 AllowJSXTextnode inJSXElementchildren property and removeStringLiteral. -
Documentation
-
babel-generator: #3240 Fix small in babel-generator README sample code. Thanks @athaeryn! -
Internal
-
babel-plugin-external-helpers: #3205 Renamed frombabel-plugin-external-helpers-2due to someone taking the npm name beforehand. -
#3233 Update LICENSE end date to 2016. Thanks @maclover7!
-
babylon: #3204 Prevent users from patching by building it. -
babel-types: #3217 AddBinaryalias toAssignmentExpression.
6.3.26
-
Bug Fix
-
babel-plugin-transform-es2015-parameters: #3191 Fix the order of arguments initialization (fixes T6809) -
babel-traverse: #3198 Inevaluate(), it should not mistake lack of confidence for falsy -
Spec Compliancy
-
babylon,babel-generator,babel-plugin-transform-regenerator: #3190: Removeawait *frombabylonand raise an error for that syntax since it was removed from the proposal and was causing an issue at runtime but not at compile time (fixes T6688). -
Internal
-
Fix gulp build path to work on windows (fixes T6855).
-
babel: #3193 Point users to the cli docs -
babel-core: #3196 Add a test for checking plugins/presets are resolved relative tofilename
6.3.25
-
Bug Fix
-
babylon: #3187 Multiple"use strict"in function causes outer scope to be parsed as strict -
babel-generator: #3188 Correctly setformat.quotestoopts.quotes -
babel-generator: #3189 JSX attributes should use double qoutes -
babel-traverse: #3192 Fixed static evaluation bug -
Internal
-
babel-plugin-transform-es2015-parameters: #3165 Optimizeargumentsaccess
6.3.24
- Bug Fix
- #3184 Fixed overly permissive type inference.
6.3.22-6.3.23
Skipped 6.3.22.
- Internal
- Renamed the
Flow Commentsplugin frombabel-plugin-flow-commentstobabel-plugin-transform-flow-commentsfor naming consistency.
6.3.21
-
Bug Fix
-
babel-generator: #3173 Fix unhandled new-precedence edge cases regarding parentheses (fixes T6829). -
babel-generator: #3180 Handle nestedIfStatementwith an `alternate. -
babel-generator: #3182 ParenthesizeArrowFunctionExpressionwhen part of aLogicalExpressionorBinaryExpression(fixes T6836). -
babel-traverse: #3171 Fix infinite recursion bug withintrospectionmethod. -
transform-es2015-function-name: #3176 Stop transformingObjectMethod(MethodDefinition) to aFunctionExpressionsince thetransform-es2015-shorthand-propertiesplugin already does it. -
transform-es2015-parameters: #3143 Optimizations forRestElementsuch as usingarguments.length(fixes T6774). -
Documentation
-
babel-core: #3177 Clarify description ofcommentsfile config. -
Internal
-
*: #3179 Update flow to 0.20.0 and add@noflowuntil types are added in. -
babel-generator: #3178 Fix type annotation forshouldPrintComment.
6.3.20
- Bug Fix
babel-generator: #3170 Fix invalid code generation for numericMemberExpression(5.toString()->5..toString()).babel-types: #3172 AddExpressionalias toBindExpression.
6.3.19
-
New Feature
-
babel-plugin-flow-comments: #3157 Movebabel-plugin-flow-commentsto the babel repo and update for babel 6. -
Bug Fix
-
babel-runtime: #3142 Add a custom transform forbabel-runtimebuilds to avoid circular dependencies (Fixes thebabel-runtime/helpers/typeofissue). -
babel-traverse: #3161 Only rename the *outer function bindings on name conflict. -
babel-generator: #3167 Use the left most node from the right to check if we need spaces inBinaryExpressions.
6.3.18
-
Bug Fix
-
babylon: #3107 Fix incorrect directive parsing -
babel-generator: #3158 Parenthesize object expression when it may end up at the start of an expression -
babel-plugin-transform-regenerator: #3160 Fix typo -
Polish
-
babel-types: #2933 Generate documentation for babel-types. -
babel-plugin-transform-es2015-parameter: #2833 Optimizeargumentsusage. -
babel-messages: #3123 clarifytraverseNeedsParentmessage.
6.3.17
-
Bug Fix
-
babel-types: #3153 DoWhileStatement should take node typeStatementas body. -
New Feature
-
babel-generator: #3152 Add a new minified format option to do possibly dangerous byte saving. -
Internal
-
babel-traverse: #3151 Support ObjectProperty inScope.isPure -
Polish
-
babel-cli: #3150 Do not prefer global when installing babel-cli
6.3.16
-
Bug Fix
-
babel-traverse:- #3137 Set the correct
parentandparentPathfor new aNodePath(fixes an issue withexport * from './a'andes2015-modules-commonjs).
- #3137 Set the correct
-
babel-generator: -
Internal
-
babel-traverse:- #3138 Support
UnaryExpressioninisPurecheck.
- #3138 Support
6.3.15
- Bug Fix
babel-generator:- #3111 Compact Mode: remove unnecessary
()from aNewExpressionswhen possible (new x()->new x).
- #3111 Compact Mode: remove unnecessary
babel-helper-function-name:- #3138 Skip name inference on certain uses of classes until we can handle them.
babel-traverse:- #3141 Fix bug with evaluating an expression on its own binding.
babel-plugin-transform-es2015-destructuring:- #3136 Seperate the destructuring statement from the export statement before converting.
babel-plugin-transform-es2015-classes:
6.3.14
- Bug Fix
babel-traverse:
6.3.8-6.3.13
Testing lerna - A tool for managing JavaScript projects with multiple packages.
- Bug Fix
babylon,babel-types,babel-generator:- #3130 Add support for
NullLiteralTypeAnnotation(nullliteral type) in flow.
- #3130 Add support for
6.3.2
- Bug Fix
babel-core:- #3108 Omit sourcemaps that cannot be used and fix source path.
babel-register:- #3116 Disable processing
.babelrca second time.
- #3116 Disable processing
babel-traverse:- #3127 Ensure we always push into a
BlockStatement(fixes ababel-plugin-transform-class-propertiesissue).
- #3127 Ensure we always push into a
babel-plugin-transform-class-properties:- #3113 Fix issue with using static class properties.
babel-plugin-transform-es2015-classes:- #3112 Fix issue with
return super()in class constructor causing asuper() hasn't been callederror.
- #3112 Fix issue with
babel-plugin-transform-inline-environment-variables:- Fix typo with
replaceWith.
- Fix typo with
babel-plugin-transform-regenerator:- #3119 Ensure that generator functions always have an
Identifier(fixes an issue with exporting a generator as a default).
- #3119 Ensure that generator functions always have an
6.3.1
- Bug Fix
babel-generator:- #3121 Fix spacing in binary expression when right is a binary expression and has a unary on the left in compact mode. Ex:
(a+(+b*2))should be ->a+ +b*2
- #3121 Fix spacing in binary expression when right is a binary expression and has a unary on the left in compact mode. Ex:
6.3.0
-
Bug Fix
-
Fix use of old
literalto usestringLiteralin babel-types. -
Fix issue with
babel-templatecrashing in IE due to unpopulated error stack. -
Check for empty decorators list in
transform-class-properties -
Fix babylon parser not allowing multiple parameters in arrow functions with flow types
-
Fix exported async functions being hoisted and as a result being undefined.
-
Polish
-
Add validation to more JSX node types.
-
Add validation for CallExpression, NewExpression, SequenceExpression, ArrayExpression, and TemplateLiteral.
-
Add
ObjectMemberabstract type to AST forObjectPropertyandObjectMethod. -
Optimize
asyncToGeneratorhelper template. -
Respect spacing for assignment, binary expressions, and while loop in compact mode.
-
Fix up semicolon omission in compact mode.
6.2.2
- Bug Fix
- Fix ES2015 classes being revisited twice causing state issues when inside.
6.2.1
- Polish
- Add
dirnameto unknown plugin resolution error.
6.2.0
- New Feature
- Add support for
function.sent. - Internal
- Bump
invariantdependency version. - Polish
- Infer filename from the base directory when resolving plugins and presets.
- Allow JSX pragma to be specified in line comments.
- Bug Fix
- Print a block when encountering consequents that are if statements.
- Fix some issues related to printing of auxiliary comments.
6.1.21
- Bug Fix
- Add check to avoid revisiting classes.
- Internal
- Add internal aliases for plugins for debugging.
- Bug Fix
- Avoid duplicate auxiliary starts if inside an aux section.
6.1.20
- Polish
- Only infer whitespace when we've been passed tokens in the code generator.
- Refactor JSX inlining to reduce parsing cost.
- Bug Fix
- Fix queueing of nested paths being pushed onto the priority queue.
6.1.19
- Bug Fix
- Add config check to
package.jsonbabelreading. - Fix source maps merging.
- Ignore callee supers when doing spread compilation
- Polish
- Add hard error when we see decorators.
6.1.4
- Bug Fix
- Fix class transformation bug for export declarations with no
id. - Fix regenerator plugin being passed an invalid function
id. - Add support for async to generator helper on object and class methods.
- Fix looking up undefined nodes when walking back up the tree in typeof symbol plugin.
- Fix accidental serialisation of template literals in the code generator when the object of a member expression.
- Add missing
Expressionalias toTypeCastExpression. - Move
childrenprop pushing to after props to ensure correct order in the react inline elements plugin. - Fix
buildExternalHelpersscript ignoring non-underscored helpers. - Fix exported classes with static class properties.
- Spec Compliancy
- Add support for computed mutators in
babel-plugin-transform-es2015-computed-properties. - Polish
- Make interop for plugins with the
__esModulework for all plugins no matter how they're imported/specified. - Make it illegal for plugins to specify a catch-all
enter/exitvisitor method. - Ignore
babel-runtimeversion mismatch inbabel-doctor. - Omit
defaultPropshelper when there are no props in the react inline elements plugin. - Add validators for ES2015 export nodes.
- Add missing core node validators.
- Update
runtimeplugincore-jsdefinitions. - Internal
- Add
babel-plugin-transform-react-display-nameto thereactpreset. - Clean up scope cache.
- Move
babel/registerinto a separatebabel-registerpackage. - Add
react-jsx-sourceplugin and add it to thereactpreset.
6.1.3
- Internal
- Add
allowTopLevelThisoption tobabel-plugin-transform-es2015-modules-commonjs.
6.1.2
- Bug Fix
- Fix bug where the parser wouldn't allow typed annotated default parameters in arrow functions.
- Add existence check to
NodePath#hasto ensure safeness when making comparisons. - Protect against replacing a class expression with a name inferred version that would result in it never being transformed.
- When transforming JSX to an inline object, make sure invalid identifier keys are quoted.
- Fix recursion in async to generator transforms due to referring to the inner generator function.
- Convert arrow functions to normal functions when remapping to a generator.
- Fix source map merging.
- Add line break test to the
updateContextofnametokens in the parser to fix parsing of JSX and regexs with ASI. - Fix object rest/spread in arrow function parameters not being allowed in the parser.
- Ensure that unaries are parenthesised the same as function expressions.
- Internal
- Move
Symbol.hasInstancetransform out ofbabel-plugin-es2015-symbolstobabel-plugin-es2015-instanceofas it has nothing to do with symbols. - Add
babel-browserpackage with the browser build. - Polish
- Add npm 3 check to
babel-doctor. - Autoclear the
babel/registercache when it gets too big to be serialised. - Spec Compliancy
- Add support for flow existential type parameters.
6.1.1
- Bug Fix
- Stop looking for configs in
babel-doctorwhen we get to the root.
6.1.0
- New Feature
- Add
babel-doctorCLI.
6.0.20
- Bug Fix
- In the callable class constructor plugin, don't transform derived classes as the constructor call cannot be inherited.
- Fix JSX inline elements plugin from attempting to create properties out of JSX containers.
- Fix infinite recursion error when attempting to resolve the execution status of functions that contain references to themselves.
6.0.19
- Bug Fix
- Fix function paths not being accurate.
- Polish
- Change
t.getOuterBindingIdentifiersto completely ignore function expressions as they cause no outer bindings to be set. - Clean up
auxiliaryCommentoption.
6.0.18
- Polish
- Add error when calling builder methods with too many arguments than it can take.
- Rename
RegexLiteralnode toRegExpLiteral. - Rename
NumberLiteralnode toNumericLiteral. - Bug Fix
- Make all fields of a
ForStatementoptional.
6.0.17
- Polish
- Add
Symbolexistence check totypeofhelper. - Bug Fix
- When merging options, take precedence over the current array.
- Fix export of parameters when renaming the binding of exported functions.
- Fix minify booleans plugin.
- Fix simplify comparison operator plugin.
- Don't include children if it's empty in react inline elements plugin.
6.0.16
- Internal
- Instead of throwing on a foreign node path. Ignore it and create a new one.
- Bug Fix
- Ensure there's a newline after prepended original shebang.
- Ignore non-origin template nodes when replacing placeholders in
babel-template. - Fix
runtimeplugin helper generation. - Fix bug where async class methods weren't having their
awaits converted toyields in the async to generator helper.
6.0.15
- Bug Fix
- Fix async function remap helper from outputing incorrect calls causing wrong scoping.
6.0.14
- Spec Compliancy
- Update exponentiation operator precedence.
- Fix parser bug where arrow functions have a higher precedence than they should.
- Bug Fix
- Fix SystemJS module formatter exporting function parameters.
- Ensure that invalid identifier JSX attribute keys are quoted when transforming to calls.
- Fix ES3 property literal plugin.
- Fix parameters after defaults in arrow functions referring to the wrong
arguments.
6.0.13
- Bug Fix
- Don't consider uncomputed object method property identifier to be a reference.
6.0.12
- Bug Fix
- Rename misspelt
babel-plugin-transform-class-constructor-callpackage. - Add strict mode plugin to module transforms.
- Only ignore cloning of plugin instances when cloning babelrc configs.
- Add shebang to bin file in
babelcomplain package. - Remove asserts from
babel-transform-regeneratoras we may have multiple packages interacting. - Add
babel-plugin-transform-es2015-modules-commonjstobabel-preset-es2015.
6.0.0
- Internal
- Split up internals into packages.
- Breaking Change
- Remove
looseoption in favor of plugin options. - Remove
optional,whitelistandblacklistoptions since plugins are now explicitly defined. - Plugins now just return a plain object rather than construct a
Plugininstance. - Change the signature of visitor methods to
.call(state, path, state)rather than.call(path, node, parent, scope, state). - All plugin traversals are now merged for performance.
- The
MethodDefinitionnode type has been renamed toClassMethodand it'sFunctionExpressionvalueproperty has been coerced into the main method node. - The
Propertynode type has been renamed toObjectProperty. - The
Propertynode type with the boolean flagmethodhas been renamed toObjectMethodand it'sFunctionExpressionvalueproperty has been coerced into the main method node. - The
Literalnode type has been unoverloaded and split intoBooleanLiteral,RegExpLiteral,NumericLiteral,StringLiteralandNullLiteral. - The
SpreadProperty(fromobject-rest-spread) node type has been split intoRestProperty(forObjectPattern) andSpreadProperty(forObjectExpression) - Remove
module.exportsexport interop for CommonJS module formatter. externalHelpersoption has been moved into the pluginbabel-plugin-external-helpers-2.- Remove ability to use
enter/exitcatch-all handlers in plugins. - New Feature
- Add plugin options.
- Add callable class constructor.


