TypeScript 5.9, an update to Microsoft’s JavaScript superset with syntax for types, has moved to a release candidate stage. The new TypeScript release brings support for ECMAScript’s deferred module evaluation and a preview of expandable hovers for viewing variable type details.
The TypeScript 5.9 release candidate (RC), announced July 25, follows the July 8 beta. The RC also restores AbortSignal.abort()
to the DOM library, among other reported fixes. Current TypeScript users can update to TypeScript 5.9 by running the NPM command npm install -D typescript@rc
.
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.