News

TypeScript Gets Closer To ECMAScript

The release candidate for version 2.3 of the JavaScript-like language adds more support for several ECMAscript features and capabilities, including downlevel generator and iterator support when targeting ES versions 3 and 5.

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.

About the Author

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.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube