v6.20.0 (2016-12-08)
If you missed it, please check out our latest blog post: The State of Babel. It talks about where we can possibly move forward as a project and how you can help!
Also just wanted to reiterate that Babel is a community-lead project that is run by volunteers - many of us came into the project to learn about JavaScript rather than because we knew it already. Let's work together to make it sustainable!
- Maybe fix that crazy babel-generator deopt message you've all probably seen!
- Change to
babel-code-frame
for facebookincubator/create-react-app#1101 - Change to
babel-generator
for 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-generator
support 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-spread
babel-types
- #4853 Preserve null in
babel-types
t.clone
andt.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-regenerator
babel-traverse
- #4934 Hoist
generateDeclaredUidIdentifier
helper function. (@jridgewell)
- #4934 Hoist
babel-polyfill
babel-runtime
babel-plugin-syntax-trailing-function-commas
- #4936 Add
test
tobabel-plugin-syntax-trailing-function-commas
.npmignore
(@wtgtybhertgeghgtwtg)
- #4936 Add
babel-helper-fixtures
babel-core
,babel-traverse
babel-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