TypeScript 7 RC Rewrites Compiler in Go, Boosting Speed ~10×
Microsoft’s TypeScript 7 RC replaces the compiler core with Go, delivering roughly a ten‑fold speed increase across CLI builds and editor services while remaining fully compatible with TypeScript 6 semantics, and provides detailed upgrade guidance and parallel‑compilation options.
Core implementation change
Microsoft released a TypeScript 7 candidate where the compiler is completely rewritten in Go. The rewrite preserves the existing type‑checking logic from TypeScript 6, so source code does not need to change.
Performance rationale
Go compiles to native binaries and provides built‑in shared‑memory parallelism. Microsoft’s internal benchmarks show roughly a ten‑fold reduction in build time compared with TypeScript 6 on comparable projects. Independent pre‑release testing by Figma, Bloomberg, Vercel, Notion, and Slack reported similar speed gains.
The acceleration applies to all scenarios, including the tsc CLI and the Language Server Protocol services that power editor features such as code completion, hover previews, and real‑time diagnostics.
Upgrade recommendation
TypeScript 7 inherits all default settings from V6, but any syntax or configuration flagged as deprecated in V6 now triggers a hard compilation error. Because V6 was intended as a transitional release, projects should first upgrade to V6, resolve all deprecation warnings, and then move to V7.
Configuration changes that become errors in V7 include: target no longer supports
es5 moduledrops amd, umd, and systemjs Defaults change to strict: true and
module: esnext moduleResolutiondefault baseUrl becomes ./ (often needs manual adjustment to ./src) types must be listed explicitly
Co‑existence of TS6 and TS7
Many third‑party tools (e.g., typescript-eslint) have not yet adapted to the new API. Microsoft provides a compatibility package @typescript/typescript6 that supplies a tsc6 command and exports the full TS6 API. Projects can install both versions side‑by‑side using npm aliases:
{
"devDependencies": {
"typescript": "npm:@typescript/typescript6@^6.0.0",
"typescript-7": "npm:typescript@rc"
}
}After configuration, tooling can use the stable TS6 API while the actual compilation runs on the high‑performance TS7 backend.
Parallel compilation, multi‑repo builds, and lightweight watch mode
TS7 can execute parsing, type checking, and output generation in parallel. File parsing and output are easily split across threads; type checking respects file‑dependency ordering, so a fixed pool of worker threads is used to guarantee deterministic results.
Default settings:
Four type‑checking threads enabled; adjustable with --checkers <N> Increasing the thread count speeds builds on multi‑core machines but raises memory usage; CI environments may lower the value.
New --builders flag enables simultaneous builds of multiple projects in a monorepo. Combined usage example: --checkers 4 --builders 4 allows up to sixteen parallel type‑checking tasks. --singleThreaded forces single‑thread execution for debugging or direct TS6 vs TS7 comparisons.
The file‑watching implementation is ported from Parcel to Go, eliminating costly polling of large node_modules trees and reducing resource consumption.
Common test commands
Install the RC version: npm install -D typescript@rc Check the installed version: npx tsc --version Standard compilation (noticeable speed boost): npx tsc Customize the number of type‑checking threads: npx tsc --checkers 8 Force single‑threaded mode for version comparison: npx tsc --singleThreaded Install both TS6 and TS7 side‑by‑side:
npm install -D typescript@npm:@typescript/typescript6
npm install -D typescript-7@npm:typescript@rc
npm install -D @typescript/native-preview
npx tsgo --versionAfter the final stable release, the tsgo binary will be merged back into the main typescript package.
Conclusion
TypeScript 7 does not alter existing code logic or type‑checking rules; all optimizations focus on build and editor performance. Feedback can be submitted to the GitHub repository https://github.com/microsoft/typescript-go. The stable version is expected around July 2026.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
