Paul Krill
Editor at Large

TypeScript 2.3 gets smarter about JavaScript standards

news
Apr 13, 20172 mins

Now at a release candidate stage, the latest version of Microsoft's typed JavaScript superset supports async generators and iterators

graduate thinking
Credit: Thinkstock

TypeScript 2.3, the latest version of Microsoft’s typed superset of JavaScript, has moved to a release candidate stage.

For standards backing, version 2.3 supports async generators and iterators. “Async iterators are an upcoming ECMAScript feature that allows iterators to produce results asynchronously,” Daniel Rosenwasser, Microsoft program manager for TypeScript, said. Async generators, meanwhile, can await at any point.

TypeScript 2.3 also offers  down-level iterator and generator support. Previously, generators were not supported when targeting ECMAScript versions 3 or 5. “The new --downlevelIteration flag gives users a model where emit can stay simple for most users, and those in need of general iterator and generator support can opt in,” said Rosenwasser. TypeScript 2.3 thus makes it easier to use libraries like redux-saga, where support for generators is expected.

To address issues with strictness in TypeScript’s type system, version 2.3 introduces a --strict flag to implicitly enable common strictness options. “If you ever need to opt out, you can explicitly turn these options off yourself,” said Rosenwasser. The language has options for different levels of strictness, and it’s common to begin at the strictest settings so the language can provide the best experience, but the compiler has grown a lot of different options, such as –strictNullChecks and –noImplicitThis. “Unfortunately if you can’t remember these, it just makes TypeScript harder to use,” Rosenwasser admitted. Future plans call for possibly including other strict checks that could be manually toggled off.

TypeScript 2.3 is due to add other capabilities as well, such as error reporting in all .js files and language service extensibility, and a full release of version 2.3 is due later this month. Accessible via NuGet or npm, TypeScript 2.3 can work with Visual Studio 2015 IDE, with Microsoft planning to extend support to the newly released Visual Studio 2017 as well. TypeScript compiles to plain JavaScript while supporting practices such as code refactoring, and it gained some notoriety recently when Google’s Angular JavaScript framework was rewritten in it.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author