Microsoft has released TypeScript 5.9 Beta, which encompasses various enhancements, featuring a streamlined and modernized tsc --init flag, support for import defer, and the inclusion of the --module node20 capability. The updated tsc --init command produces a tsconfig.json file that is now more detailed and user-friendly. The newly introduced import defer syntax facilitates module evaluation without immediate execution, thereby enhancing control over the timing of work and side effects. This feature is advantageous for conditionally loading modules that require costly or platform-specific initialization. It enhances startup performance by postponing module evaluation for application features until they are genuinely required. The beta remains unaltered or "downleveled" by TypeScript and is designed for deployment in native runtimes or bundlers.
TypeScript 5.9 introduces a stable option named node20 for the --module and --moduleResolution settings, designed in accordance with Node.js v20. This option is expected to remain consistent moving forward. TypeScript now features summary descriptions for numerous DOM APIs derived from the MDN documentation. The "quick info verbosity" feature enables users to delve deeper into types within quick info tooltips. The language server offers a configurable maximum hover length, enabling a greater amount of information to be presented in hover tooltips by default. TypeScript 5.9 enhances cache instantiations on mappers, minimizing unnecessary work and allocations, while also preventing closure creation in file or directory existence checks using source.
TypeScript 5.9 introduces a stable option named node20 for the --module and --moduleResolution settings, designed in accordance with Node.js v20. This option is expected to remain consistent moving forward. TypeScript now features summary descriptions for numerous DOM APIs derived from the MDN documentation. The "quick info verbosity" feature enables users to delve deeper into types within quick info tooltips. The language server offers a configurable maximum hover length, enabling a greater amount of information to be presented in hover tooltips by default. TypeScript 5.9 enhances cache instantiations on mappers, minimizing unnecessary work and allocations, while also preventing closure creation in file or directory existence checks using source.
TypeScript 5.9 Beta
Today we are excited to announce the availability of TypeScript 5.9 Beta.
To get started using the beta, you can get it through npm with the following command:
Copynpm install -D typescript@beta
Let’s take a look at what’s new in TypeScript 5.9!