TypeScript Gets Closer To ECMAScript
- By Michael Domingo
Just as expected with the new release cadence that the TypeScript team announced a few weeks ago, there's now a new version of TypeScript in release candidate form, this one trotting out a number of new features that get it closer to ECMAScript.
Microsoft's Daniel Rosenwasser notes in a blog about the 2.3 RC that this version as yet does not support Visual Studio 2017, support that is planned for a future release. It currently supports Visual Studio 2015, and it's available as part of the VS 2015 Update 3 installation, as well as via Nuget and via an npm install.
Among the highlights of this release that Rosenwasser points to in his blog is the addition of a --strict flag to the TypeScript type system. TypeScript's type system by default is set to be "as lenient as possible to allow users to add types gradually," he said. By adding the --strict flag to a tsconfig.json file, developers can impose the strictest settings at the outset, and peel back as needed.
Rosenwasser also points to some ECMAScript feature support, by way of the addition of support for downlevel generators and interators and async generators and interators when targeting ES3 and ES5.The downlevel generator support is via the additon of a --downlevelIteration flag that Rosenwasser says "gives users a model where emit can stay simple for most users, and those in need of general iterator & generator support can opt in."
The async generator support is being built in now, in anticipation of support for them in a future version of ECMAScript, says Rosenwasser, which will allow "iterators to to produce results asynchronously." He points to this TC39 proposal on GitHub here that explains the async generator and interator support in detail.
These features are being rolled out now, with more features coming within the next few months. A TypeScript feature roadmap can be viewed here, for those who want to keep apprised of the work the group is doing.
Michael Domingo is a long-time software publishing veteran, having started up and managed several developer publications for the Clipper compiler, Microsoft Access, and Visual Basic. He's also managed IT pubs for 1105 Media, including Microsoft Certified Professional Magazine and Virtualization Review before landing his current gig as Visual Studio Magazine Editor in Chief. Besides his publishing life, he's a professional photographer, whose work can be found by Googling domingophoto.