TypeScript 7.0 (Project Corsa): Native Performance and Enhanced Development Experience Updates
Explore the latest advancements in TypeScript 7.0 (Project Corsa), which brings native performance to the compiler and language service. This update details significant progress in editor support, dramatically faster builds, key compatibility changes, and confirms TypeScript 6.0 as the final JavaScript-based release. Developers are encouraged to try the stable native previews for an enhanced development experience and to provide feedback.
The TypeScript team previously announced a significant initiative to port the compiler and language service to native code, aiming for substantial improvements in raw performance, memory usage, and parallelism. This ambitious undertaking, codenamed "Project Corsa" (and destined to become "TypeScript 7.0"), has seen remarkable progress in recent months. We are thrilled to provide an update on its current status, demonstrating the tangible advancements of this new TypeScript toolset. Additionally, we will share insights into our roadmap and how we are prioritizing efforts to bring TypeScript 7.0 to full completion.
Editor Support and Language Service
For many developers, a project rewrite can seem abstract until its official release. However, this is not the case with TypeScript 7.0. Its native previews are already fast, stable, and readily available for use, including within your editor. The TypeScript language service, which powers your editor's TypeScript and JavaScript functionalities, is a critical component of this native port. You can easily experience it by installing the latest daily updated version from the Visual Studio Code Marketplace. While the team continues to port features and resolve minor bugs, the core elements of the established TypeScript editing experience are already functional and performant. This includes a comprehensive set of features:
- Code Completions (including auto-imports)
- Go-to-Definition
- Go-to-Type-Definition
- Go-to-Implementation
- Find-All-References
- Rename
- Quick Info/Hover Tooltips
- Signature Help
- Formatting
- Selection Ranges
- Code Lenses
- Call Hierarchy
- Document Symbols
- Quick Fixes for Missing Imports
Notably, recent updates have reintroduced crucial features such as auto-imports, find-all-references, and rename, addressing previous limitations that deterred some developers from adopting the native previews. These operations now function seamlessly across all TypeScript and JavaScript codebases, including those utilizing project references. Furthermore, a re-architected language service enhances reliability and leverages shared-memory parallelism. While initial experiences sometimes reported occasional crashes, which users tolerated for the speed benefits, the new architecture offers superior robustness, handling diverse codebase sizes without issues. Although ongoing porting and polishing are still in progress, teams will likely find the native TypeScript previews highly beneficial, offering faster load times, reduced memory consumption, and a noticeably more responsive editor experience. The extension also provides a convenient toggle to switch between VS Code's built-in TypeScript experience and the new native one. We strongly encourage you and your team to try out the native preview extension for VS Code today!
Compiler
The native port of the TypeScript compiler has also achieved significant milestones. Similar to the VS Code extension, nightly preview builds of the new compiler are published under the @typescript/native-preview package. You can install it via npm:
# local dev dependency
npm install -D @typescript/native-preview
# global install
npm install -g @typescript/native-preview
This package introduces the tsgo command, which functions comparably to the existing tsc command, allowing both to run side-by-side. A frequent inquiry concerns the safety and reliability of TypeScript 7 for build validation – specifically, whether it identifies the same errors as TypeScript 5.9. The answer is a resounding yes. TypeScript 7's type-checking capabilities are nearly complete. Out of approximately 20,000 compiler test cases, where about 6,000 produce at least one error in TypeScript 6.0, TypeScript 7 also produces at least one error in all but 74 cases. These remaining 74 cases are attributed to known incomplete work (e.g., regular expression syntax checking or isolatedDeclarations errors) or intentional changes (deprecations, default settings modifications). Therefore, you can confidently use TypeScript 7 today for type-checking your project.
Beyond single-pass/single-project type checking, the command-line compiler has achieved significant feature parity. Essential features like --incremental, project reference support, and --build mode are now fully ported and operational. This enables most projects to adopt the native preview with minimal adjustments.
# Running tsc in --build mode...
tsc -b some.tsconfig.json --extendedDiagnostics
# Running the *new compiler* in --build mode...
tsgo -b some.tsconfig.json --extendedDiagnostics
These newly available features are expected to be dramatically faster than their counterparts in TypeScript 5.9 and older (the "Strada codebase"). As previously detailed, this performance boost stems from native code execution and the implementation of shared-memory parallelism. This means TypeScript can now execute fast multi-threaded builds on single projects and build multiple projects in parallel. Combined with the re-implementation of --incremental, TypeScript builds for minor changes in large projects are approaching near-instantaneous speeds. Even without --incremental, TypeScript 7 often demonstrates up to a 10x speedup over the 6.0 compiler on full builds, as illustrated in the following table:
| Project | tsc (6.0) | tsgo (7.0) | Delta | Speedup Factor |
|---|---|---|---|---|
sentry | 133.08s | 16.25s | 116.84s | 8.19x |
vscode | 89.11s | 8.74s | 80.37s | 10.2x |
typeorm | 15.80s | 1.06s | 14.20s | 9.88x |
playwright | 9.30s | 1.24s | 8.07s | 7.51x |
Expected Differences from TypeScript 5.9
While the new compiler offers significant advantages, there are some important considerations for users. Many current issues are temporary and slated for resolution before the final 7.0 release, while others reflect long-term decisions to enhance the default TypeScript experience. The advent of TypeScript 7.0 necessitates a concentrated shift towards the new codebase to bridge existing gaps and accelerate the adoption of the new toolchain. Let's explore some of the current changes and limitations.
Deprecation Compatibility
TypeScript 7.0 will eliminate behaviors and flags scheduled for deprecation in TypeScript 6.0. A comprehensive list of upcoming deprecations for 6.0 is available on our issue tracker. Key examples include:
--strictwill be enabled by default.--targetwill default to the latest stable ECMAScript target (e.g.,es2025).--target es5will be removed, withes2015becoming the lowest supported target.--baseUrlwill be removed.--moduleResolution node10(ornode) will be replaced bybundlerandnodenext.rootDirwill default to the current directory; usingoutDirwill require either an explicitrootDiror for top-level source files to reside in the same directory as thetsconfig.json.
This list is not exhaustive; please refer to the issue tracker for the most current information. Projects relying on any of these deprecated behaviors will need to modify their codebase or tsconfig.json to ensure compatibility with TypeScript 7.0. To assist with this transition, our team has developed ts5to6, a tool designed to automatically update your tsconfig.json.
This utility employs heuristics based on extends and references to facilitate updates across various projects within your codebase. Currently, it supports updating baseUrl and rootDir settings, with potential for more functionalities in the future. To use it:
npx @andrewbranch/ts5to6 --fixBaseUrl your-tsconfig-file-here.json
npx @andrewbranch/ts5to6 --fixRootDir your-tsconfig-file-here.json
Emit, --watch, and API Considerations
Despite its readiness for TypeScript 6.0, the new compiler has specific limitations that prevent its immediate universal adoption. Firstly, the JavaScript emit pipeline is not yet fully complete. If your workflow does not require JavaScript emit from TypeScript (e.g., using Babel, esbuild, or similar tools) or if you target modern browsers/runtimes, tsgo will function effectively for your builds. However, for projects relying on TypeScript to target older runtimes, downlevel compilation currently only extends to the es2021 target, with no support for compiling decorators. Full --target support, extending back to es2015, is a planned but ongoing effort.
Secondly, the new --watch mode may exhibit reduced efficiency compared to the existing TypeScript compiler in certain scenarios. Alternative solutions, such as running nodemon alongside tsgo with the --incremental flag, can mitigate this.
Finally, Project Corsa (TypeScript 7.0) will not support the existing Strada API. The Corsa API is still under development, and stable tooling integrations are not yet available. Consequently, tools like linters, formatters, or IDE extensions that depend on the Strada API will not be compatible with Corsa. A temporary workaround for these issues involves installing both the typescript and @typescript/native-preview packages side-by-side, utilizing the ≤6.0 API for necessary tooling, and tsgo for type-checking.
JavaScript Checking and JSDoc Compatibility
Notably, JavaScript type-checking support, partially driven by JSDoc annotations, has undergone a complete rewrite. To streamline internal processes, some support for complex and less frequently used patterns previously recognized has been removed. For instance, TypeScript 7.0 no longer recognizes the @enum and @constructor tags. Additionally, certain "relaxed" type-checking rules in JavaScript have been discontinued, including the interpretation of:
ObjectasanyStringasstringFooastypeof Foo(when valid in a TypeScript file)- All
any,unknown, andundefined-typed parameters as optional
And other similar behaviors. Some of these changes are being reviewed and documented, though the documentation may require further updates. Consequently, some JavaScript codebases may encounter more errors than before, necessitating updates to ensure compatibility with the new compiler. Conversely, this new implementation is considered more robust and maintainable, aligning TypeScript's JSDoc support more closely with its native type syntax. If you believe a specific functionality should be working or is absent from JavaScript type-checking support, we encourage you to file an issue on our GitHub repository.
Focusing on the Future
When the TypeScript rewrite commenced last year, it was accompanied by significant uncertainties regarding community reception, stabilization timelines, adoption rates, and compatibility levels. We are delighted to report that the project has exceeded expectations on all fronts. A type-checker with exceptionally high compatibility has been implemented, leading projects both within and outside Microsoft to report seamless adoption of the native compiler. Stability is progressing well, and most language service features are on track for completion by year-end. Many teams are already using Corsa for daily operations without critical issues.
With TypeScript 6.0 on the horizon, the future of the JavaScript codebase requires strategic consideration. Our initial plan involved continuing development on the 6.0 line "until TypeScript 7+ reaches sufficient maturity and adoption." However, recognizing the remaining work needed to unblock more developers (e.g., expanding the API surface), we've determined that transitioning away from the Strada line—our JavaScript-based compiler—is the most effective path to expedite the removal of these blockers.
To achieve this as swiftly as possible, several key decisions have been made for the Strada project:
TypeScript 6.0 is the Last JavaScript-Based Release
TypeScript 6.0 will be the final release based on the existing TypeScript/JavaScript codebase. This means there are no plans for a TypeScript 6.1, though patch releases (e.g., 6.0.1, 6.0.2) may occur in rare, critical circumstances. Consider TypeScript 6.0 a "bridge" release between the TypeScript 5.9 line and 7.0. It will deprecate features to align with 7.0 and maintain high compatibility in type-checking behavior. Most codebases requiring editor-side Strada-specific functionalities (like language service plugins) can use 6.0 for editor features and 7.0 for rapid command-line builds without significant disruption. Conversely, developers can leverage 7.0 for a faster editor experience while using 6.0 for command-line tooling that relies on the TypeScript 6.0 API.
Post-release servicing for TypeScript 6.0 will be limited to patch releases, issued only for:
- Security issues.
- High-severity regressions (new and critical bugs that were not present in 5.9).
- High-severity fixes related to 6.0/7.0 compatibility.
As with previous releases, patch releases will be infrequent and reserved for absolute necessity. Our immediate focus is to maximize compatibility between TypeScript 6.0 and 7.0. A stringent merging policy for open pull requests into the 6.0 line is now in effect, meaning developers should adjust expectations regarding issues addressed in TypeScript 6.0. Contributors should also understand that merging pull requests into 6.0 is highly improbable, as our primary focus is achieving parity and stability for 7.0. This transparency aims to prevent "wasted" effort and avoid complications when porting changes between codebases.
Resetting Language Service Issues
While most core type-checking code has been ported without behavioral changes, the language service presents a different scenario. Due to its new architecture, much of the code powering features like completions, hover tooltips, and navigation has been extensively rewritten. Additionally, TypeScript 7.0 adopts the standard LSP (Language Server Protocol) instead of the custom TSServer protocol, which may alter some behaviors specific to the TypeScript VS Code Extension. Consequently, bugs or suggestions related to language service behavior are unlikely to reproduce in the 7.0 line or require a fresh evaluation. Manually verifying these issues is time-consuming, so existing issues related to language service behavior will be closed under the "7.0 LS Migration" label. If you encounter such an issue, please log a new issue after confirming its reproducibility with the native nightly extension. For functionality not yet ported to 7.0, please await its implementation before raising new issues.
What's Next?
Upon the initial unveiling of our native previews months ago, expectations regarding project status needed careful management. We have now reached a stage where we can confidently declare the native TypeScript experience as real, stable, and prepared for widespread adoption. Nevertheless, we are actively seeking user feedback. We strongly encourage you to install the VS Code native preview extension, utilize the @typescript/native-preview compiler package whenever feasible, and integrate it into your projects. Share your insights and file issues on our GitHub repository to help us address problems and prioritize future development. We are enthusiastic about the future of TypeScript and eagerly anticipate the full release of TypeScript 7.0! Happy Hacking!