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.
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.