Babel
  • Docs
  • Setup
  • Try it out
  • Videos
  • Blog
  • Donate
  • Team
  • GitHub

โ€บAll Blog Posts

All Blog Posts

  • 7.13.0 Released: Records and Tuples, granular compiler assumptions, and top-level targets
  • 7.12.0 Released: TypeScript 4.1, strings as import/export names, and class static blocks
  • 7.11.0 Released: ECMAScript 2021 support in preset-env, TypeScript 4.0 support, printing config and the future of `babel-eslint`
  • The State of babel-eslint
  • 7.10.0 Released: Class Fields in preset-env, '#private in' checks and better React tree-shaking
  • 7.9.0 Released: Smaller preset-env output, Typescript 3.8 support and a new JSX transform
  • 7.8.0 Released: ECMAScript 2020, .mjs configuration files and @babel/cli improvements
  • Babel's Funding Plans
  • 7.7.0 Released: Error recovery and TypeScript 3.7
  • 7.6.0 Released: Private static accessors and V8 intrinsic syntax
  • 7.5.0 Released: dynamic import and F# pipelines
  • The Babel Podcast
  • 7.4.0 Released: core-js 3, static private methods and partial application
  • 7.3.0 Released: Named capturing groups, private instance accessors and smart pipelines
  • 7.2.0 Released: Private Instance Methods
  • TC39 Standards Track Decorators in Babel
  • 7.1.0 Released: Decorators, Private Static Fields
  • Babel 7 Released
  • Removing Babel's Stage Presets
  • What's Happening With the Pipeline (|>) Proposal?
  • Announcing Babel's New Partnership with trivago!
  • On Consuming (and Publishing) ES2015+ Packages
  • Nearing the 7.0 Release
  • Babel Turns Three
  • Planning for 7.0
  • Zero-config code transformation with babel-plugin-macros
  • Contributing to Babel: Three Lessons to Remember
  • Personal Experiences at Babel #1 โ€” A PR with Unusually High Number of Reviews
  • Babel and Summer of Code 2017
  • Upgrade to Babel 7 (moved)
  • Upgrade to Babel 7 for Tool Authors (WIP)
  • 6.23.0 Released
  • The State of Babel
  • 6.19.0 Released
  • 6.18.0 Released
  • 6.16.0 Released
  • Babili (babel-minify)
  • 6.14.0 Released
  • Babel Doctor
  • Setting up Babel 6
  • 6.0.0 Released
  • React on ES6+
  • Function Bind Syntax
  • 5.0.0 Released
  • Babel <3 React
  • Not Born to Die
  • 2to3
  • 6to5 + esnext

6.18.0 Released

October 24, 2016

Henry Zhu

More flow updates, and lots of fixes!

We've added 4 new collaborators to Babel since the last release!

All of the hard work goes to them and our new contributors!

  • Moti Zilberman: ๐Ÿ™ @motiz88, ๐Ÿฆ @motiz88
  • Dan Harper: ๐Ÿ™ @danharper, ๐Ÿฆ @DanHarper7
  • Kai Cataldo: ๐Ÿ™ @kaicataldo, ๐Ÿฆ @kai_cataldo
  • Andrew Levine: ๐Ÿ™ @DrewML, ๐Ÿฆ @drewml

They've been helping keep this project afloat with @loganfsmyth, @danez, and me!

v6.18.0 Summary (2016-10-24)

Again if you haven't checked recently, we've moved back to Github Issues! This is all thanks to @danez

๐Ÿš€ New Feature

#4697 Add variance node type and generate property variance annotations. (@samwgoldman)

Check out the blog post and flow docs for more info:

type T = { +p: T };
interface T { -p: T };
declare class T { +[k:K]: V };
class T { -[k:K]: V };
class C2 { +p: T = e };

#4746 Support ObjectExpression in static path evaluation. (@motiz88)

Useful for babel/babili and other plugins.

// in
{['a' + 'b']: 10 * 20, 'z': [1, 2, 3]}
// out
{ab: 200, z: [1, 2, 3]}

#4699 import(): Initial support for dynamic-import. (@kesne)

Parser support was added in babel/babylon#v6.12.0.

Just the plugin to enable it in babel.

// install
$ npm install babel-plugin-syntax-dynamic-import --save-dev

or use the new parserOpts

// .babelrc
{
  "parserOpts": {
    "plugins": ['dynamicImport']
  }
}

#4655 Add useBuiltIns option to helper-builder-react-jsx. (@existentialism)

Previously we added a useBuiltIns for object-rest-spread so that it use the native/built in version if you use a polyfill or have it supported natively.

This change just uses the same option from the plugin to be applied with spread inside of jsx.

// in
var div = <Component {...props} foo="bar" />
// out
var div = React.createElement(Component, Object.assign({}, props, { foo: "bar" }));

#4724 Add EmptyTypeAnnotation. (@samwgoldman)

Added in flow here and in babylon here.

function f<T>(x: empty): T {
  return x;
}
f(); // nothing to pass...

#4758 Make getBinding ignore labels; add Scope#getLabel, Scope#hasLabel, Scope#registerLabel. (@kangax)

Track LabeledStatement separately (not part of bindings).

๐Ÿ’… Polish

#4690 Consolidate contiguous var declarations in destructuring transform. (@motiz88)

// in
const [a, b] = [1, 2];
// out
var a = 1,
    b = 2;

#4685 Better error messaging when preset options are given without a corresponding preset. (@kaicataldo)

We've had a few reports of users not wrapping a preset in [] when passing in options so we added an extra error message for this.

// incorrect, and current gives a unexpected error message
{
  "presets": [
    "preset",
    { "presetOptions": 'hi' } // gets parsed as another preset instead of being part of the "preset"
  ]
}
// correct
{
  "presets": [
    ["preset",
      {
        "presetOptions": 'hi'
      }
    ]
  ]
}
ReferenceError: [BABEL] /test.js: Unknown option: base.loose2. Check out http://babeljs.io/docs/usage/options/ for more information about options.

A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

Invalid:
  `{ presets: [{option: value}] }`
Valid:
  `{ presets: [["presetName", {option: value}]] }`

For more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.

#4646 Change babel-generator to output boolean instead of bool for the BooleanTypeAnnotation AST node. (@existentialism)

var a: Promise<boolean>[];
// instead of
var a: Promise<bool>[];

๐Ÿ“ Documentation

#4653 Tweak license for GitHub display. (@existentialism)

So that our MIT License shows up.

๐Ÿ› Bug Fixes

#4765 Don't treat JSXIdentifier in JSXMemberExpression as HTML tag. Closes #4027. (@DrewML)

// transform-react-inline-elements
// issue with imported components that were JSXMemberExpression
import { form } from "./export";

function ParentComponent() {
  return <form.TestComponent />;
}

#4763 Handle remapping of JSXIdentifier to MemberExpression in CommonJS transform. Closes #3728. (@DrewML)

// transform-react-inline-elements
import { Modal } from "react-bootstrap";
export default CustomModal = () => <Modal.Header>foobar</Modal.Header>;

#4736 Fix replacing for-of if inside label. (@danez)

if ( true ) {
  loop: for (let ch of []) {}
}

#4502 Make special case for class property initializers in shadow-functions. (@motiz88)

class A {
  prop1 = () => this;
  static prop2 = () => this;
  prop3 = () => arguments;
}

#4719 Fixed incorrect compilation of async iterator methods. (@Jamesernator)

// in
class C {
  async *g() { await 1; }
}
// out
class C {
  g() { // was incorrectly outputting the method with a generator still `*g(){`
    return _asyncGenerator.wrap(function* () {
      yield _asyncGenerator.await(1);
    })();
  }
}

#4690 Consolidate contiguous var declarations in destructuring transform. (@motiz88)

// was wrapping variables in an IIFE incorrectly
for ( let i = 0, { length } = list; i < length; i++ ) {
    console.log( i + ': ' + list[i] )
}

#4666 Fix error when constructor default arg refers to self or own static property. (@danharper)

// was producing invalid code
class Ref {
  static nextId = 0
  constructor(id = ++Ref.nextId, n = id) {
    this.id = n
  }
}

assert.equal(1, new Ref().id)
assert.equal(2, new Ref().id)

#4674 Handle side effects correctly in rest params index expressions (#4348). (@motiz88)

function first(...values) {
    let index = 0;
    return values[index++]; // ++ was happening twice
}

console.log(first(1, 2));

#4669 Fix block scoping transform for declarations in labeled statements. (@motiz88)

let x = 10;
if (1)
{
    ca: let x = 20;
}

#4672 Avoid repeating impure (template) literals when desugaring **= (#4403). (@motiz88)

a[`${b++}`] **= 1;

#4642 Exclude super from being assign to ref variable. (@danez)

foo = {
  bar() {
    return super.baz **= 12;
  }
}

#4670 Retain return types on ObjectMethods in transform-es2015-shorthand-properties. (@danharper)

// @flow
var obj = {
  method(a: string): number {
    return 5 + 5;
  }
};

#4668 Retain method return types on transform-es2015-classes (Closes #4665). (@danharper)

// @flow
class C {
  m(x: number): string {
    return 'a';
  }
}

๐Ÿ  Internal

#4725 Remove babel-doctor from babel-cli. (@kaicataldo)

It's a one-time use tool (helpful after the initial release when upgrading from v5 to v6) that doesn't need to be a part of babel-cli. We'll publish it as a standalone package it someone asks for it.

#4764 Add TEST_DEBUG env var option for test.sh, to enable node 6 debugger. (@DrewML)

Will be useful for contributors: TEST_DEBUG=true make test to run node --inspect on node v6+.

#4735 Automatically generate missing expected.js fixtures. (@motiz88)

Also amazing for contributors: if you create an actual.js test file without the expected.js it will generate it for you (like snapshot tests but with babel output).

#4734 Change usage of "suite"/"test" in unit-tests to "describe"/"it". (@DrewML)

#4564 Enable babel for tests. (@danez)

The non-fixture tests finally are also transpiled as well!

#4732 Run ESLint on test files, and fix lint errors in test files.. (@DrewML)

#4680 Update: Eslint to 3.0 and update CI builds (Closes #4638). (@gyandeeps)

Allows us to use the latest version of eslint which drops support of node < 4 by only running lint on the lastest node which should save CI time.

๐ŸŽ‰ First Merged Pull Request!

  • Andrew Levine (DrewML)
  • Eric Rozell (rozele)
  • Gyandeep Singh (gyandeeps)
  • Jamesernator
  • Jordan Gensler (kesne)
  • Nazim Hajidin (nhajidin)
  • Simen Bekkhus (SimenB)
  • sugargreenbean

๐ŸŒ Committers: 17

  • Brian Ng (existentialism)
  • Dan Harper (danharper)
  • Daniel Tschinder (danez)
  • Greenkeeper (greenkeeperio-bot)
  • Henry Zhu (hzoo)
  • Juriy Zaytsev (kangax)
  • Kai Cataldo (kaicataldo)
  • Moti Zilberman (motiz88)
  • Sam Goldman (samwgoldman)

Check out Github for the whole changelog!

Recent Posts
  • v6.18.0 Summary (2016-10-24)
  • ๐Ÿš€ New Feature
  • ๐Ÿ’… Polish
  • ๐Ÿ“ Documentation
  • ๐Ÿ› Bug Fixes
  • ๐Ÿ  Internal
  • ๐ŸŽ‰ First Merged Pull Request!
  • ๐ŸŒ Committers: 17
Babel
Docs
Learn ES2015
Community
VideosUser ShowcaseStack OverflowSlack ChannelTwitter
More
BlogGitHub OrgGitHub RepoWebsite RepoOld 6.x SiteOld 5.x Site