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

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube