What’s new in TypeScript 4.5
Blog post from LogRocket
TypeScript 4.5 introduces several new features and enhancements aimed at improving both the language and the developer experience. Key updates include the Awaited type, which enhances asynchronous programming by refining how promise-related operations are handled, and the addition of support for ES modules in Node.js, albeit currently as an experimental feature in nightly builds. Tail-recursion elimination improves performance in recursive conditional types, while the --preserveValueImports flag prevents the removal of necessary imports in frameworks like Svelte and Vue. TypeScript also enhances the handling of template string types and introduces private field presence checks, aligning with JavaScript proposals. Other notable features include snippet completions for method implementation and JSX attributes, better editor support for unresolved types, and performance optimizations with realpathSync.native. The release also includes improvements in JSDoc support with const assertions and default type arguments, catering to both developers' productivity and code robustness.