News
TypeScript 5.9 RC Brings Deferred Imports, Node.js 20 Module Target
TypeScript 5.9 has reached the release candidate (RC) stage with enhancements for modern module behavior, hover tooltips, and deferred module evaluation. Microsoft announced the RC on July 25, ahead of the final release coming within a week.
Minimal, Modernized tsc --init
Running tsc --init now generates a streamlined tsconfig.json with modern default settings. The file emphasizes module-based structure ("module": "nodenext"), ECMAScript Next targeting, and strict typing features such as noUncheckedIndexedAccess and exactOptionalPropertyTypes. JSX is preset to "react-jsx", and TypeScript will enforce isolated modules and skip library type checks by default.
New import defer for Deferred Module Evaluation
TypeScript 5.9 introduces support for ECMAScript's import defer syntax, allowing module evaluation to be deferred until the first property access. This enables side-effect-heavy modules to be loaded but not executed until used, which can improve startup time or conditionally load expensive features.
Only namespace-style imports are allowed with import defer:
import defer * as feature from "./some-feature.js";
Default and named imports are not supported. The feature works only under the preserve or esnext module options and is not downleveled by TypeScript. It requires native support in runtimes or bundlers.
Stable Node.js 20 Module Mode
The new --module node20 option provides a locked-in configuration that aligns with Node.js v20 behavior. Unlike nodenext, which evolves over time and uses --target esnext, node20 implies a fixed --target es2023. This setting is intended for developers who want consistent, predictable interop between CommonJS and ESM modules.
DOM API Summaries in Tooltips
DOM APIs now include summary descriptions derived from MDN, improving developer experience during hover interactions in editors like Visual Studio Code. These summaries are visible alongside the usual type information.
Expandable Hovers in VS Code
TypeScript 5.9 debuts a preview of expandable hover tooltips. Developers using Visual Studio Code can now expand or collapse type definitions directly within the Quick Info popups using + and - buttons. This feature is designed to allow deeper inspection of types without navigating away from the current file.
Configurable Hover Length
The language server now supports a configurable setting, js/ts.hover.maximumLength, which controls the maximum tooltip length. The default has also been increased, allowing more type information to appear by default. This change addresses prior complaints about overly truncated hover data.
Compiler Performance Improvements
TypeScript 5.9 introduces internal optimizations that improve performance in large-scale codebases:
- Caches for repeated type instantiations reduce redundant work in generics-heavy libraries like Zod and tRPC.
- Redundant closures have been eliminated in file system operations, with one reported optimization improving speed by 11%.
Breaking and Behavioral Changes
Some DOM types have been updated. Notably, ArrayBuffer is no longer a supertype of various typed array types, including Buffer from Node.js. This may cause new type errors in projects that implicitly relied on those relationships. Developers are advised to update @types/node and specify more precise buffer types when needed.
Changes in type argument inference may also trigger previously unseen errors, especially when generics leak unresolved types. Adding explicit type parameters to function calls is the recommended fix.
Next Up: TypeScript Native and v7
While TypeScript 5.9 final is imminent, Microsoft is directing more focus toward the ongoing development of the native port of TypeScript, eventually expected as TypeScript 7. Developers can experiment with nightly builds of TypeScript Native now.
For complete release notes, visit the official blog post .
About the Author
David Ramel is an editor and writer at Converge 360.