MacMusic  |  PcMusic  |  440 Software  |  440 Forums  |  440TV  |  Zicos
typescript
Recherche

TypeScript 5.9 supports deferred module evaluation

vendredi 11 juillet 2025, 18:52 , par InfoWorld
TypeScript 5.9, an update to Microsoft’s JavaScript superset with syntax for types, has arrived in beta, bringing support for the ECMAScript 2005’s deferred module evaluation.

Announced July 8, TypeScript 5.9 also offers capabilities such as a preview of expandable hovers, allowing developers to more easily view the details of variable types. Current users who want to update to TypeScript 5.9 can use the NPM command npm install -D typescript@beta.

With backing for ECMAScript’s deferred module evaluation, TypeScript 5.9 uses the new import defer syntax, allowing developers to import a module without immediately executing the module and its dependencies. This provides better control over when work and side effects occur, according to Microsoft. The key benefit of import defer is the module only will be evaluated on the first use. This feature is viewed as particularly useful for conditionally loading modules with expensive or platform-specific initialization. It also can improve startup performance by deferring module evaluation for app features until they are actually needed.

The preview of the expandable hovers feature, meanwhile, offers “quick info verbosity.” Developers using an editor like Visual Studio Code now will now see + and – buttons on the left of these hover tooltips. Clicking on the + button will expand out types more deeply, while clicking on the – button will return to the previous view, according to Microsoft.

Also in TypeScript 5.9, the language server supports a configurable hover length, which can be configured in VS Code via the js/ts.hover.maximumLength setting. This addresses a situation in which quick info tooltips become so long that TypeScript will truncate them to make them more readable.

Other features in TypeScript 5.9:

TypeScript 5.9 can cache many intermediate instantiations when work has already begun on a specific type instantiation, avoiding unnecessary work and allocations.

Support for --module node20 gives developers a setting intended to model Node.js 20. Specifying --module node20 implies --target es2023, whereas --module nodenext implies --target esnext, Microsoft said.

An updated, minimal tsc --init command results in a leaner tsconfig.json file, which now omits commented-out settings and their descriptions.

TypeScript 5.9’s beta arrives nearly after two months following the release of TypeScript Native Previews, which preview versions of a planned native TypeScript compiler based on the Go language. The intent is to speed up TypeScript and reduce build times and memory usage. That project will come to fruition in a planned TypeScript 7 release.
https://www.infoworld.com/article/4020579/typescript-5-9-supports-deferred-module-evaluation.html

Voir aussi

News copyright owned by their original publishers | Copyright © 2004 - 2025 Zicos / 440Network
Date Actuelle
sam. 12 juil. - 20:14 CEST