BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News TypeScript 1.5 Boosts ES6 Transpilation Features

TypeScript 1.5 Boosts ES6 Transpilation Features

Bookmarks

Seven months after the previous version, Microsoft released TypeScript 1.5, taking a big step towards their goal of full ES6 support.

When TypeScript 1.4 was released in January of 2015, its Kangax ES6 compatibility was at 8%. With the features added in TypeScript 1.5, that compatibility is up to 53% (as of 2015-07-26).

As expected, the 1.5 release adds support for the ES6 style module syntax. The compiler is now capable of outputting modules in SystemJS and UMD syntax. Beyond this, the team has taken the opportunity to rename what they used to call "internal modules" to "namespaces" to reduce confusion.

Also in version 1.5 is support for decorators, which were added to the language as part of the collaboration with the Angular, Ember, and Aurelia teams. The decorators are used to provide the attributes necessary to run an Angular 2.0 app. The joint teams hope that decorators will be part of ES7 but, for now, it's considered experimental. To enable the feature with Angular 2.0 apps, developers will need to turn on the --experimentalDecorators compiler flag.

Steve Ognibene, author of a Pluralsight course on TypeScript, is excited about version 1.5's ES6 transpilation ability:

TypeScript is now a perfectly good ES6 to ES5 transpiler. Teams that use TypeScript 1.5 not only get the traditional TypeScript benefits of develop-time errors, proper IntelliSense/documentation, and great refactoring/code navigation support; but they also get to use ES6 features in code intended to run in today's ES5 environments. TypeScript 1.5 has very good ES5 transpilation support for ES6-style syntax so I can use my favorite new features let, const, destructuring, spread, rest, string templates, and ES6-style module syntax today in production.

Some developers were disappointed that async/await still hasn't made it into the language. The feature is currently listed under the "2.0" part of the TypeScript Roadmap, but in previous revisions, it was slated for an earlier release. In a comment response, Program Manager Jonathan Turner said this about the feature and its schedule:

We're doing some refactoring in the compiler to handle compiling async/await down to ES5. Ideally, both the compiler code and the output code would be clean, so we're taking our time to get it right. To get there, we knew it probably won't make it into 1.6, which we want to release sooner rather than later.

The comment implies that it won't be another 7 months before the next version of TypeScript is released. Features planned for 1.6 include:

  • JSX support
  • abstract classes and methods
  • ES6 Generators

Developers can use TypeScript 1.5 in the newly released Visual Studio 2015. Downloads are also available for Visual Studio 2013 and npm.

Rate this Article

Adoption
Style

BT