v7.0.0-alpha.15 (2017-07-11)
Ignore alpha.13/14
Summary
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);
};
💥 Breaking Change
This is just the babel-generator output, not a big deal.
🚀 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 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
💅 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)
📝 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)
🏠 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
Committers: 18
- Artem Yavorsky (yavorsky)
- Ash (ashsearle)
- Brian Ng (existentialism)
- Buu Nguyen (buunguyen)
- Daniel Tschinder (danez)
- Henry Zhu (hzoo)
- Joseph Frazier (josephfrazier)
- Josh Johnston (joshwnj)
- Justin Ridgewell (jridgewell)
- Karl Cheng (Qantas94Heavy)
- Mathias Bynens (mathiasbynens)
- Mauro Bringolf (maurobringolf)
- Nicolò Ribaudo (nicolo-ribaudo)
- Ryan Gaus (1egoman)
- Sarup Banskota (sarupbanskota)
- Simen Bekkhus (SimenB)
- MarckK
- bill-improbableio