TypeScript Roundup: New Features, Tools, and a Roadmap
Our last report was on version 0.9, which added generics. Since then Microsoft has added three minor features as part of version 0.9.1. The first is the “typeof” operator can now be used in a variable declarations type position. For example, if you have a module named M, then “var m: typeof M = M;” would create a strongly typed variable named “m” whose value is that module. Jonathan Turner says that this is “especially handy for working with the shapes of modules, the static side of a class, and enums, which don’t otherwise have a name you can refer to.”
Next up is ‘this’. The rules for using this in field initializers have been relaxed. In practical terms this means that callback functions that refer to an instance of the class can be created and stored in member of that instance.
Version 0.9.1 also includes a “no implicit any” option. Like Visual Basic’s Option Strict, this will raise a compile time error if there are any variables whose type cannot be inferred.
The next two versions of TypeScript, tagged 0.9.5 and 1.0RC, will focus on:
- User-report issues
- CPU- and memory-usage
- Conformance with the 1.0 spec
After the final release of TypeScript 1, Microsoft plans to start working on async/await support. Presumably this would be comparable to what we see in C# and Visual Basic. This should prove useful for both client-side and Node.js programming. Also in planning is support for mixins and protected access.
As the syntax for ECMAScript 6 solidifies, TypeScript 1.x will also be adopting more features from it.