- add-module-exports - babel/babel#5127
- babel/babel#5128
We highly encourage you to use a newer version of Node.js since these versions are in end of maintenance.
Along npm Babel supports Yarn. See Yarn's documentation on how to use it.
Before:
var { ...y, } = { a: 1};
This will now throw a SyntaxError.
After:
var { ...y } = { a: 1};
or:
var { ...y, b } = { a: 1};
Relying on babel-core/register is deprecated and will be removed in Babel 7.
Upgrade with Mocha:
mocha --compilers js:babel-core/register
to:
mocha --compilers js:babel-register
We need to add babel-register
as a new dependecy:
npm install --save-dev babel-register
See babel-register documentation for more informations.
babel-plugin-syntax-trailing-function-commas
, babel-plugin-transform-async-to-generator
and babel-plugin-transform-exponentiation-operator
are moved into babel-preset-stage-4
.
Babel recently created babel-preset-env
which based on your environment use the right presets. If you have issue with this changes we suggest you using the env preset.
Example:
let cubed = 2 ** 3;
If you rely on this syntax, we suggest you using rather the env preset.
TC39 decided to drop this proposal.
Before:
class Point {
constructor(x, y) {
this.x = x;
this.y = y;
}
call constructor(x, y) {
return new Point(x, y);
}
}
let p1 = new Point(1, 2);
let p2 = Point(3, 4);
You can move your logic into the constructor or into a static method.