Babel v7.0.0-alpha.15 Release Notes
Release Date: 2017-07-11 // almost 7 years ago-
This is a Stage 0 TC39 Proposal (subject to change/removal and your feedback!)
const obj = { foo: { bar: { baz: 42, }, }, }; const baz = obj?.foo?.bar?.baz; // 42 const safe = obj?.qux?.baz; // undefined // Optional chaining and normal chaining can be intermixed obj?.foo.bar?.baz; // Only access `foo` if `obj` exists, and `baz` if // `bar` exists
function Foo() { console.log(new.target); } Foo(); // => undefined new Foo(); // => Foo
- π better
for of
optimization (if inferred array)
// these kinds of scenarios will compile to a regular for loop const x = []; for (const y of x) {} const arr = Object.entries(x); for (const y of arr) {}
- loose mode for classes is a lot looser
Input
class A {}
Output (loose)
let A = function A() {}; // loose
Output (normal)
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var A = function A() { _classCallCheck(this, A); };
:boom: Breaking Change
This is just the babel-generator output, not a big deal.
:rocket: New Feature
babel-traverse
- #5914 babel-traverse: Mark appropriate template literals as pure. (@ashsearle)
- #5681 Add support for evaluating
String.raw
expressions. (@josephfrazier)
- π
babel-plugin-transform-new-target
- #5906 Add new.target transform. (@jridgewell)
- π
babel-core
,babel-generator
,babel-plugin-syntax-optional-chaining
,babel-plugin-transform-optional-chaining
,babel-preset-stage-1
,babel-template
,babel-traverse
,babel-types
- #5813 Optional Chaining Operator (Stage 1). (@jridgewell)
- π
babel-core
,babel-plugin-transform-es2015-for-of
- π
babel-helpers
,babel-plugin-transform-es2015-classes
,babel-plugin-transform-flow-comments
,babel-plugin-transform-flow-strip-types
- π
babel-generator
,babel-plugin-transform-flow-strip-types
,babel-types
:bug: Bug Fix
- π
babel-helpers
,babel-plugin-transform-class-properties
,babel-plugin-transform-es2015-classes
- #5885 Fix returning an object in a derived class constructor without super. (@jridgewell)
- π
babel-helper-remap-async-to-generator
,babel-plugin-transform-async-to-generator
- #5932 Fix async-to-generator ForAwait transform. (@jridgewell)
- π
babel-plugin-transform-es2015-modules-commonjs
- π
babel-plugin-transform-es2015-classes
- #5801 Fix bug
super
ref check doesnβt honor spec evaluation order. (@buunguyen) - #5802 Remove check for super calls in arrow function. (@existentialism)
- #5801 Fix bug
babel-cli
- #5861 Pass SIGINT signals to the spawned child process. (@bill-improbableio)
- #5867 fix issue as a result of refactor. (@hzoo)
babel-types
babel-generator
- #5830 Fix parens issues with exponentiation in generator. (@existentialism)
- #5820 Wrap an arrow function in parentheses if it the test of a conditional expression. (@nicolo-ribaudo)
- π
babel-plugin-transform-numeric-separator
- #5825 Fix numeric separator Number transform. (@jridgewell)
- π
babel-plugin-transform-es2015-template-literals
,babel-preset-es2015
- π
babel-plugin-transform-es2015-parameters
- #5810 Fix bug incorrect dereferencing rest argument. (@buunguyen)
- π
babel-plugin-syntax-optional-chaining
π :nail_care: Polish
- π
babel-plugin-transform-es2015-parameters
- #5721 Fix optimisation of shadowed rest parameters. (@Qantas94Heavy)
- π
babel-helper-builder-react-jsx
,babel-plugin-transform-es2015-spread
,babel-traverse
- #5837 Hoist several closures. (@jridgewell)
babel-traverse
,babel-types
- #5826 Matches pattern cleanup. (@jridgewell)
babel-types
- #5821 babel-types: avoid recreating validator closures. (@jridgewell)
π :memo: Documentation
babel-types
- #5941 Update babel-types docs [skip ci]. (@existentialism)
- #5940 Removed update operators from number unary operators. (@maurobringolf)
- #5855 Minor enhancements around spacing. (@sarupbanskota)
:house: Internal
babel-polyfill
- #5939 Change trailing comma option for polyfill scripts. (@existentialism)
- Other
- #5937 Remove codecov node package and use bash uploader. (@danez)
- #5918 Gitignore package-lock. (@sarupbanskota)
babel-core
,babel-generator
- #5892 Fix some unneeded semis in test fixtures. (@existentialism)
babel-*
babel-core
,babel-generator
,babel-traverse
,babel-types
babel-*
- #5412 Use prettier. (@existentialism)
babel-generator
,babel-traverse
babel-generator
babel-cli
- #5807 Include node 8.0 to travis config & update tests. (@sarupbanskota)
- β
babel-core
,babel-helper-transform-fixture-test-runner
,babel-traverse
babel-core
,babel-traverse
- π better