Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News TypeScript 1.3 and the March Toward ECMAScript 6

TypeScript 1.3 and the March Toward ECMAScript 6

This item in japanese

Microsoft announced that TypeScript, their typed superset of JavaScript, has reached version 1.3 and gave a preview of 1.4. These releases are part of TypeScript's steps to becoming a true superset of ECMAScript 6 (ES6) and providing a set of tools that others can build upon.

Developers can install TypeScript 1.3 as a Visual Studio 2013 power tool, via NPM, or as part of the Visual Studio 2015 preview and get access to two new features:

  • protected access modifier
  • tuples

Microsoft also gave a preview of features to come in version 1.4:

  • union types
  • type guards
  • stricter generics
  • better type inference
  • type aliases

The addition of types and type checking to JavaScript is gaining steam in the industry. AtScript, the language AngularJS 2.0 is written in, is a superset of TypeScript and builds upon the type annotations. Facebook's just released Flow also adds type checking to JavaScript and all three projects have said they are looking forward to working together. Axel Rauschmayer wrote about the various industry efforts on typed JavaScript. In an interview with InfoQ, Rauschmayer said:

Type annotations and static typing are features that make JavaScript acceptable to many enterprise developers.

Asana, makers of collaborative tools for teams, announced that they were switching to TypeScript after finding that their large code base became more difficult to work with. They decided that they "needed a different language, one that compiles to clean, predictable JavaScript and supports optional strong types."

For now, TypeScript is not yet ES6 compliant. Rauschmayer noted that it "does not yet support the final ES6 module syntax and is only a subset of ECMAScript 6." This compliance is something the team is working on -- one of their main goals as they near TypeScript 2.0 is to:

align with ES6. Aligning with ES6 allows TypeScript to become a superset of the next JavaScript, opening the way for working with new code patterns like destructuring, string templates, promises, iterators and more.

The TypeScript team also announced they have started formalizing their compiler API which will allow others to build on it. For example, due to the initial limitations of the TypeScript compiler, the AngularJS team is instead using Traceur to compile AtScript. According to Misko Hevery, "one of the goals for us [AtScript] was that we need to be able to generate Dart code and because of the way Traceur was written it was more 'hackable' at the beginning."

Jonathan Turner, Program Manager for TypeScript, indicated in the TypeScript 2.0 Roadmap that they are trying to put out a release "every 6-8 weeks" and build more language and tooling features, some of which are already available in the TypeScript GitHub repository.

Rate this Article