TypeScript 5.9 released — import defer, minimal tsconfig, node20 module mode

TypeScriptToolingNode.js

Key update

TypeScript 5.9 is officially released with practical features for everyday development: support for the import defer proposal (deferred module evaluation), a much leaner tsc --init that scaffolds smaller tsconfig.json files by default, a --module node20 option to match Node.js v20 module semantics, editor-focused improvements like expandable hovers, and a set of type‑argument inference changes aimed at reducing leaked type variables (which can surface new errors in some codebases). (devblogs.microsoft.com)

Why it matters

import defer changes how and when modules (and their initialization work) run, so it can measurably reduce cold‑start and page‑load costs if your code and bundler/runtime support it — but it also means bundlers, runtime shims, and libraries that relied on eager module side effects need verification. The new minimal tsc --init lowers onboarding friction for new projects and makes sensible defaults easier to adopt. The node20 module mode reduces the semantic gap between TypeScript output and the Node v20 loader, which helps server teams avoid subtle module-resolution issues. Finally, the inference fixes are the most operationally impactful item: some large codebases will see new type errors after upgrading; the usual mitigation is to run the type checker in CI on a branch, add explicit type arguments where necessary, and use the provided migration notes from the release when making the upgrade. Overall: adopt 5.9 in a staged way (editor + CI checks → fix inference regressions → opt into import defer where safe), verify third‑party toolchain compatibility (bundlers, linters, test runners), and prioritize running a full type check in CI before merging. (devblogs.microsoft.com)

Source

Read Next