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

›All Blog Posts

All Blog Posts

  • 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

2to3

January 27, 2015

James Kyle

These past few weeks we’ve seen lots of activity on 6to5; thousands are downloading it every day from all corners of the world. In the past month, over 200 issues have been closed. Since the 2.0 release, there have been 867 commits and 60 minor and patch releases. It’s now among the top 1% of most downloaded packages on npm, with nearly 100k downloads in the last month alone.

Today we are releasing 3.0.

Note: 6to5 doesn't hold onto bug fixes or new backwards compatible features for major releases. Some of the features listed are from later 2.x releases.

Loose Mode

6to5 is very focused on spec-compliancy in everything that it does. Sometimes the spec requires a lot of complexity around edgecases that don't affect most code.

We’ve added Loose Mode for ignoring some of these edgecases in order to create cleaner, smaller, and faster executing output.

For example, calling super() inside a constructor would normally be compiled to:

function Foo() {
  _get(Object.getPrototypeOf(Foo.prototype), "constructor", this).call(this);
}

However, with Loose Mode it is compiled to:

function Foo() {
  Bar.call(this);
}

Before you use Loose Mode, you should be aware that it doesn't line up with the spec completely, it may lead to incompatible code if you aren't aware of these inconsistencies. Check out the docs for more info.

Performance Improvements

In the past few weeks @gaearon has done some amazing work to improve 6to5 compilation time by over 200%. These kinds of improvements are extremely important to us and we’re happy to see such great contributions from community members.

Playground: Mallet Operator

As seen in Ruby and CoffeeScript, the Mallet operator allows you to conditionally assign values based on their falsy-ness.

a ||= b

will behave like

if (!a) a = b;

This one comes to you from @jridgewell. We encourage proposal authors to come forward in order to get their ideas implemented alongside all of the latest language and API features.

selfContained

We’ve also introduced a new optional transformer that negates the need for a polyfill and bypasses all 6to5 caveats. It will automatically alias ES6 static methods and built-ins as well as include regenerator whenever you use async functions or generators. This is great for libraries that don't want to pollute the global scope.

This replaces the coreAliasing transform and the includeRegenerator option. Check out the docs for more info.

Namespaced Transformers

In 3.0, we’ve renamed all of the transformers, not just for consistency but in order to namespace them.

For example, we’ve renamed all of the es7 transformers to be things like es7.comprehensions or es7.objectSpread so if you would like to blacklist all of the es7 transformers you can simply:

$ 6to5 --blacklist es7

For a full list of the renamed transformers see the Changelog.


There are many new features and bug fixes that makes v3 an excellent release. Be sure to review them all in the Changelog.

We’d like to thank everyone who has been involved in the 6to5 community and especially those who have contributed to making 3.0 happen.

The future is looking bright.

— The 6to5 team

Recent Posts
Babel
Docs
Learn ES2015
Community
VideosUser ShowcaseStack OverflowSlack ChannelTwitter
More
BlogGitHub OrgGitHub RepoWebsite RepoOld 6.x SiteOld 5.x Site