TypeScript 6.0 Release Candidate Is Out
Microsoft has shipped the TypeScript 6.0 Release Candidate, a major update for full-stack developers. The new version promises better type inference, streamlined configuration, and deeper editor integration. The changes are expected to speed up development cycles and reduce runtime errors in complex applications.
This release is primarily a transitional one, designed to bridge the gap to TypeScript 7.0. TypeScript 7.0 will feature a completely new compiler and language service rewritten in Go to leverage native code speed and multi-threading for significant performance gains. TypeScript 6.0 will be the final version built on the current JavaScript codebase. To prepare for the move to the Go-based architecture, this release introduces several deprecations and breaking changes. For instance, `strict` mode is now enabled by default, the default module system is now `esnext`, and the target is the current ECMAScript year, ES2025. A key performance improvement comes from changing the default for the `types` compiler option to an empty array. Previously, TypeScript would automatically include all type packages found in `node_modules/@types`, which could slow down large projects. Explicitly declaring necessary types has been shown to improve build times by 20-50% in some projects. This version also adds support for new and upcoming JavaScript features. It includes built-in types for the Temporal API, a modern replacement for the `Date` object that is expected to be added to JavaScript soon. Additionally, there is now support for `RegExp.escape`, and new "upsert" methods for `Map` and `WeakMap` objects. Incremental builds for large codebases are reported to be up to 40% faster with this release. The memory consumption during type checking has also been reduced. These optimizations are particularly impactful for projects with over 100,000 lines of code. The update enhances compatibility with the broader JavaScript ecosystem, including improved module resolution for ESM, Deno, and Bun. It also introduces support for Node.js subpath imports that start with `#/`, which simplifies internal module aliasing. Error messages have been revamped to be more contextual and actionable, aiming to reduce debugging time. Instead of generic type mismatch errors, the compiler now provides more specific feedback, such as identifying a missing property.