TypeScript 6.0 is almost ready for release.

Paul Krill
3 Min Read

TypeScript’s newest update fine-tunes type-checking for function expressions in generic calls, anticipating its upcoming transition to a Go-based rewrite.

Letterpress and TypeScript.
Image Credit: Jakub Krechowicz/Shutterstock

Microsoft’s strongly-typed JavaScript dialect, TypeScript, is approaching a significant milestone with its 6.0 update now in the Release Candidate (RC) phase. This RC introduces enhanced type checking specifically for function expressions within generic calls.

As the final TypeScript version built on its JavaScript foundation before the performance-focused Go-based compiler and language service arrive with TypeScript 7.0, version 6.0 achieved its RC status on March 6. The official production release is slated for March 17, despite the RC being delayed by 10 days from its original February 24 target. Developers can install this RC, which follows the February 11 beta, using the NPM command: npm install -D typescript@rc.

A key highlight of this RC, as stated by Microsoft, is a refined type-checking mechanism for function expressions, particularly within generic JSX expressions. This enhancement aims to align TypeScript 6.0 with the forthcoming Go-based TypeScript 7.0’s intended behavior, potentially uncovering more issues in current codebases. Consequently, some generic calls might now require developers to provide an explicit type argument.

Furthermore, Microsoft has broadened the deprecation of its import assertion syntax (e.g., import ... assert {...}) to encompass import() invocations such as import(..., { assert: {...}}). Additionally, DOM types have been refreshed to conform with current web standards, incorporating several tweaks to the Temporal APIs.

Among other notable updates in TypeScript 6.0 is the introduction of the RegExp.escape function, designed to escape special regular expression characters like *, ?, and +. This function, stemming from a Stage 4 ECMAScript proposal, is now accessible within the es2025 library. Moreover, the definitions from lib.dom.iterable.d.ts and lib.dom.asynciterable.d.ts are now consolidated into lib.dom.d.ts. TypeScript’s lib setting enables developers to define the global declarations available in their target runtime.

With all its features now in place, TypeScript 6.0 also marks the deprecation of the asserts syntax. The asserts keyword was initially part of JavaScript’s import assertions proposal, but this proposal later evolved into the import attributes proposal, which has adopted the with keyword as its alternative to asserts.

Microsoft anticipates the release of TypeScript 7.0 shortly after version 6.0. This rapid succession aims to ensure a smooth transition and facilitate quicker resolution of any migration challenges encountered during its adoption.

GolangJavaScriptProgramming LanguagesSoftware DevelopmentTypeScript
Share This Article
Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *