TypeScript logo

Microsoft announced TypeScript 3.6, which introduces stricter checking for iterators and generator functions, as well as new TypeScript Playground, new editor features, and enhancements to the language and compiler.

TypeScript is a language that builds on JavaScript by adding optional static types, which can be checked by the compiler to catch common errors in programs.

According to Microsoft, in earlier versions, users of generators had no way to differentiate whether a value was yielded or returned from a generator. Now, TypeScript has a new type that it uses to represent generators called the ‘Generator’ type. Developers can narrow down values from iterators when dealing with them directly.

The language also gained more accurate array spread, improved UX around promises and better Unicode support for identifiers. Promises are one of the most common ways to work with asynchronous data nowadays, Microsoft said. To solve this, TypeScript’s error messages are now specialized, and inform the user that perhaps they should consider the correct keyword.

TypeScript 3.6 supports transforming ‘import.meta’ to ‘context.meta’ when the  module target is set to system. In addition ‘get’ and ‘set’ accessors in are allowed in ambient contexts, unlike in previous versions.

“As always, we hope that this release of TypeScript makes coding a better experience and makes you happier,” the Microsoft team wrote, encouraging users to open an issue on GitHub if they find one.

The detailed list of updates in TypeScript 3.6 is available here. Also, a detailed 6-month roadmap on what projects the team will be working on for July to December of this year is available here.