BT

TypeScript 1.3 and the March Toward ECMAScript 6

| by David Iffland Follow 4 Followers on Nov 19, 2014. Estimated reading time: 2 minutes |

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

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT