TypeScript 7.0: The Go Compiler That Makes TS 10x Faster
Source: Dev.to
If you’ve worked on a large TypeScript codebase, you know the pain: hitting save triggers a type‑checker that grinds through hundreds of files, causing IDE lag spikes and CI runs that take minutes just to execute tsc --noEmit. The language has always balanced expressiveness with performance, but that trade‑off is about to be renegotiated.
A Go‑Powered Compiler
TypeScript 7.0 (currently in beta) ships with a complete rewrite of the compiler in Go. The result is build times roughly 10× faster—not just a modest improvement.
Why Go?
- The existing compiler runs on Node.js, inheriting V8’s garbage collector and single‑threaded execution model. This works for small projects but becomes a bottleneck at scale.
- Go compiles to native binaries, eliminating Node.js startup overhead.
- Goroutines make parallel processing across files straightforward.
- Go’s memory model is more predictable than V8’s heap.
Benchmark
Using the VS Code codebase (~1.5 M lines of TypeScript):
| Compiler | Time |
|---|---|
tsc (current) | ~78 seconds |
tsgo (TS 7 beta) | ~7.5 seconds |
Memory consumption drops by about 57 %, translating to real cost and developer‑time savings in CI pipelines.
Getting Started
The beta is distributed via the @typescript/native-preview package.
# Local dev dependency
npm install -D @typescript/native-preview
# Or install globally
npm install -g @typescript/native-preview
After installation, a tsgo executable is available as a drop‑in replacement for tsc.
# Type‑check your project
tsgo --noEmit
# Watch mode
tsgo --watch
# Check the version
tsgo --version # → 7.0.0-beta
VS Code Integration
Install the TypeScript Native Preview extension to use the faster language server inside the editor. Hover types and “go‑to‑definition” feel instant even on mid‑sized codebases.
Compatibility Notes
-
Test coverage – The Go compiler passes over 95 % of the TypeScript test suite. Remaining gaps involve legacy emit modes and decorator metadata, which most modern projects don’t rely on.
-
Strict mode –
strict: trueis now the default. If yourtsconfig.jsonomits strict settings, you may see new errors. Disable it explicitly if needed:{ "compilerOptions": { "strict": false } } -
Tooling APIs – The compiler now exposes a different internal API surface (codenamed Strada). Third‑party tools that reach into TypeScript’s internals (certain linters, formatters, or custom language‑service plugins) may need updates. Most teams using
tscdirectly or through tools likets-jestandtsxshould transition smoothly.
Looking Ahead
TypeScript 7 isn’t introducing sweeping new type‑system features; it’s investing in the foundation. Faster type‑checking improves feedback loops in editors, speeds up CI pipelines, and creates headroom for richer checks without hitting performance walls.
The stable release is expected late June or early July 2026. In the meantime, the beta is safe to experiment with on a branch or a greenfield project.
Follow the progress on the TypeScript blog and file issues on the typescript-go GitHub repository.