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-js
was 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-scoping
babel-generator
// input
void (() => {});
// correct output
void (() => {});
// wrong
void () => {};
babel-generator
// input
(0xFFFF).toString()
// correct output
0xFFFF.toString()
// wrong
0xFFFF..toString()
Documentation
babel-plugin-transform-regenerator
babel-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-core
babel-core
We have 15 committers this release!
Thanks to: AgentME, clayreimann, erikdesjardins, forivall, gzzhanghao, hzoo, jmm, jridgewell, kittens, loganfsmyth, samwgoldman, schmod, siroky, tiemevanveen, zloirock