|TypeScript 4.5 Adds Awaited|
|Thursday, 25 November 2021|
TypeScript 4.5 has been released with improvements including support for the Awaited type, improvements to the support promises, and new snippet completions.
Another improvement means that TypeScript 4.5 now can narrow values that have template string types, and also recognizes template string types as discriminants. TypeScript 4.5 also now provides snippet completions when overriding or implementing methods in classes, and for JSX attributes.
The new version also has a new feature that carries out tail-recursion elimination on conditional types. The team says that TypeScript needs a way to fail gracefully when it detects possibly infinite recursion, or any type expansions that can take a long time and affect your editor experience. To handle this, TypeScript has heuristics that identify when these problems are occurring, but some valid types trigger the 'potential problem' heuristics. To overcome this, TypeScript 4.5 performs some tail-recursion elimination on conditional types.
Other improvements include Private Field presence checks that work out whether an object has a private field on it; and import assertions that make sure that an import has an expected format.
TypeScript 4.5 is available now.
Summer SALE Kindle 9.99 Paperback $10 off!!
or email your comment to: email@example.com