HeadlinesBriefing favicon HeadlinesBriefing.com

TypeScript 6.0 RC: Final Release Before Major Compiler Rewrite

Hacker News •
×

Microsoft has released the Release Candidate for TypeScript 6.0, marking the final version based on the current JavaScript codebase before a major architectural shift. The RC is available now via npm with the command `npm install -D typescript@rc`. This release serves as a bridge between TypeScript 5.9 and the upcoming TypeScript 7.0, which will be built on a new Go-based compiler and language service.

TypeScript 6.0 includes several improvements beyond alignment work, such as enhanced type-checking for generic function expressions in JSX contexts and extended deprecation of import assertion syntax. The DOM types have been updated to reflect the latest web standards, including adjustments to the Temporal APIs. These changes aim to catch more bugs in existing code, though some generic calls may require explicit type arguments.

The release also addresses a subtle inference issue with this-less functions, allowing TypeScript to better infer types when arrow functions are used in object literals. Additionally, support for subpath imports starting with `#/` has been added, aligning with newer Node.js 20 releases. Developers can now use this simpler syntax for internal package aliases, eliminating the need for extra segments after the hash symbol.