MLog
Back to posts
技术#TypeScript#Go#前端#编译器

TypeScript 7.0: The Go Rewrite Is Here, and It's 12x Faster

Published: Jul 14, 2026Reading time: 6 min

TypeScript 7.0 ships with a Go-based compiler that delivers 8-12x speedups and lower memory usage. Here's what that actually means for your workflow.

TypeScript 7.0 shipped on July 8, and it's not your typical semver bump. Microsoft rewrote the entire compiler in Go.

I've been watching this unfold since the initial announcement last year. Back then, a Go port of the TypeScript compiler felt like a distant experiment. But the 7.0 RC landed on June 18, and the stable release followed in under a month. That's faster than I expected—and the results are better than I hoped.

Not an optimization. A material change.

The TypeScript compiler (tsc) was written in TypeScript. Bootstrapped compilers aren't unusual, but the problem with JavaScript as a compiler host language is real: single-threaded execution, GC pauses, and heavy memory footprints are all bad news for CPU-bound workloads like type checking.

The team spent 2023–2025 squeezing performance out of the JS codebase—--build mode improvements, isolatedDeclarations, and so on. But as Daniel Rosenwasser (TypeScript PM) put it, they were patching things up under a low ceiling.

The Go rewrite tears the ceiling off. Shared-memory parallelism, native compilation speed, goroutine-based concurrency—none of this was possible in a JavaScript runtime.

Here's the key detail: the team didn't redesign the type checker. They translated the existing implementation, preserving the same algorithmic structure. The type-checking logic in TS 7 is structurally identical to TS 6. That means your code won't suddenly sprout new errors or silently pass checks that used to fail. Same semantics, different engine.

The numbers

Full build times, TS 6 vs. TS 7 (4 checkers):

Project TS 6 TS 7 Speedup
vscode 125.7s 10.6s 11.9x
sentry 139.8s 15.7s 8.9x
bluesky 24.3s 2.8s 8.7x
playwright 12.8s 1.47s 8.7x
tldraw 11.2s 1.46s 7.7x

Bump --checkers to 8 and vscode hits 16.7x.

What caught me off guard was the memory numbers. TS 6 peaked at 5.2 GB building vscode; TS 7 uses 4.2 GB, an 18% drop. Bluesky went from 1.8 GB to 1.3 GB, down 26%. Faster and leaner isn't the usual bargain.

The editor experience improvement is what you'll actually feel. In the vscode repo, opening a file and waiting for the first diagnostic red squiggle used to take about 17.5 seconds with TS 6—long enough to grab coffee. TS 7 delivers it in under 1.3 seconds. That's not "faster." That's "you stop noticing the wait."

How the parallelism works

TS 7 introduces two new CLI flags:

  • --checkers: number of type-checking workers (default 4)
  • --builders: number of project references built in parallel

Type-checking parallelism is tricky because files have cross-cutting type dependencies—you can't just farm each file to a different goroutine and call it a day. TS 7's approach: each worker maintains its own type view. There may be some duplicated work across workers, but as long as the partitioning strategy is consistent, results remain deterministic. There's also a --singleThreaded flag for debugging and constrained environments.

The "crazy engineering decision" behind --watch

Rewriting --watch mode turned into its own subplot.

Go's standard library doesn't include a filesystem watcher. The team evaluated third-party options and ran into stability and cross-platform issues. They knew that @parcel/watcher—used by VS Code for years—was battle-tested. But it's written in C++, and dragging in a C++ toolchain would have broken the "single Go binary" distribution model.

So they did something wild: ported Parcel's watcher from C++ to Go, keeping only minimal assembly shims. They started with a literal translation, gradually refactored into idiomatic Go, and ran it against the original test suite. Devon Govett (Parcel's author) gets a shoutout in the release notes for good reason.

Migration: what you need to know

TS 7 inherits all of TS 6's new defaults and escalates TS 6 deprecations to hard errors. Key changes:

  • target: es5 is gone
  • moduleResolution: node / node10 is gone; use nodenext or bundler
  • module: amd / umd / systemjs are gone
  • baseUrl is gone
  • strict defaults to true
  • types defaults to [] (no more auto-loading all @types/*)
  • rootDir defaults to "./" (source under src/ must be explicit)

The types and rootDir changes will trip up the most people. If you used to npm i -D @types/node and expected everything to just work:

{
  "compilerOptions": {
    "types": ["node"]
  }
}

Microsoft's recommendation is to upgrade to TS 6 first, sort out the config changes there, then move to TS 7. Two smaller steps beat one jump.

TS 7.0 also ships without a stable programmatic API—that arrives in 7.1. Tools like typescript-eslint, ts-jest, and framework integrations (Vue, Svelte, Astro, MDX) will stick with TS 6 for now. The team released @typescript/typescript6 as a compatibility package; npm aliases let both versions coexist.

On the reliability front: TS 7's language server has 80% fewer command failures and 60% fewer crashes than TS 6, based on telemetry across the tested partner codebases.

The bigger trend

TypeScript isn't the first JS ecosystem tool to leave JavaScript behind. esbuild, Bun, Oxc, Rspack, Rolldown—the list grows. There's a structural reason: compilers, bundlers, and linters are CPU-bound, highly parallelizable workloads, and JavaScript runtimes hit a hard ceiling on all three fronts.

What's interesting is that TypeScript chose Go instead of Rust. My read on this: Go's simplicity, fast compilation, and goroutine model made the port cheaper. The team wasn't rewriting the type system—they were translating it. Go makes isomorphic ports more straightforward without the friction of a borrow checker.

Real-world impact from early adopters: Slack cut merge queue wait time by 40% and CI type-checking from 7.5 minutes to 1.25 minutes. Their engineers said local type checking went from "effectively unusable" to "loads in seconds." Canva saw first-diagnostic time drop from 58 seconds to 4.8 seconds. Microsoft's News Services team is saving 400 hours of CI time per month.

Bottom line

TS 7 isn't a feature release. It's a declaration: the infrastructure bottlenecks in the JS ecosystem are breakable. You break them by building the infrastructure in a different language—while keeping everything you know intact.

The upgrade path: get to TS 6 first, clean up your config, then install TS 7. If you're not using Vue, Svelte, or Astro, you can probably switch today. Same type semantics, just faster. A lot faster.