Skip to main content

JournalTypeScript

TypeScript 7 in Practice: What the Go Compiler Changes, and What It Breaks

TypeScript 7 moved the compiler to Go and type-checks about 10x faster. I ran it on this site's own codebase, broke an old tsconfig on purpose, and found the parts of the toolchain that aren't ready yet. Real numbers, real error messages, and a migration order that works.

By LearnWebCraft Team20 min read

I've been typing tsc --noEmit and then going to get coffee for about eight years. Not because the projects were huge. On a mid-sized app, the check takes long enough that you stop watching it, so you switch tabs, and then you've lost the thread.

TypeScript 7.0 went stable on July 8, 2026, and the coffee break is gone. The compiler has been ported from TypeScript to Go, and Microsoft says full builds are typically 8x to 12x faster. I wanted to see what that looks like on a real project rather than on a benchmark slide, so I ran it against the codebase of this site, which is a Next.js 16 app with about 38,000 lines of TypeScript.

The short version: the speedup is real and I'm not going back. But "upgrade TypeScript" is not a one-line change this time, and several tools you probably use still can't talk to the new compiler. This post covers both halves.

What actually changed in TypeScript 7

The most important thing to understand is that TypeScript 7 is a port, not a rewrite. The team translated the existing compiler into Go more or less file by file. The release post says the type-checking logic is structurally identical to TypeScript 6.0, and that practically any code that compiles cleanly with 6.0 will compile the same way in 7.0.

That matters for how you think about risk. You are not adopting a new type checker with new opinions. You are adopting the same type checker, compiled to native code, running on several threads at once. Most of the speed comes from those two things: native code instead of JavaScript running in V8, and parallel type-checking instead of one thread doing everything.

The version history is short but worth knowing, because a lot of blog posts and Stack Overflow answers were written during the preview and are now out of date:

Release Date How you installed it Binary name
6.0 March 23, 2026 npm i -D typescript@6 tsc
7.0 beta April 21, 2026 npm i -D @typescript/native-preview@beta tsgo
7.0 RC June 18, 2026 npm i -D typescript@rc tsc
7.0 July 8, 2026 npm i -D typescript tsc
7.1 beta October 20, 2026 npm i -D typescript@beta tsc

If you see instructions telling you to run tsgo, they're from the beta period. The binary is called tsc again, and it ships in the normal typescript package. The @typescript/native-preview package still exists, but it's for nightly builds now. As I write this, npm view typescript dist-tags reports 7.0.2 as latest and 7.1.0-beta as beta.

TypeScript 6.0 was the warning shot

You can't really talk about 7.0 without talking about 6.0, because 6.0 did most of the breaking. Microsoft described it as the bridge between 5.9 and 7.0, and it was the last version of the compiler written in TypeScript.

6.0 did two things. It changed a set of defaults, and it deprecated a list of old options. Deprecated options still worked in 6.0 if you added "ignoreDeprecations": "6.0" to your tsconfig. In 7.0, that escape hatch is gone, and every one of those options is a hard error.

So if your project went through 6.0 and you silenced the warnings instead of fixing them, 7.0 is where the bill arrives.

The new defaults, which 7.0 keeps:

Option New default What it used to be
strict true false
module esnext depended on target
target latest stable ECMAScript version es5
types [] every package under node_modules/@types
rootDir ./ inferred from your input files
noUncheckedSideEffectImports true false
stableTypeOrdering true, and you can't turn it off opt-in in 6.0

And the options that are gone in 7.0:

  • target: "es5". The lowest target is now ES2015.
  • downlevelIteration.
  • moduleResolution: "node" (also called node10) and moduleResolution: "classic". Use bundler or nodenext.
  • module: "amd", "umd", "systemjs" and "none".
  • baseUrl. Your paths entries have to be relative to the project now.
  • esModuleInterop: false, allowSyntheticDefaultImports: false and alwaysStrict: false. You can't turn any of them off any more.
  • outFile. 6.0 removed it and pointed people to a bundler.

A couple of syntax changes came with it. The old module Foo {} namespace keyword is an error (use namespace; declare module "x" for ambient modules still works). Import assertions with assert { type: "json" } are an error too, and you write with { type: "json" } instead.

The benchmark: this site's codebase

Microsoft's numbers come from large, well-known projects. Here's a sample from the 7.0 release post, using the default of four type-checking threads:

Project TypeScript 6 TypeScript 7 Speedup
VS Code 125.7s 10.6s 11.9x
Sentry 139.8s 15.7s 8.9x
Playwright 12.8s 1.47s 8.7x
tldraw 11.2s 1.46s 7.7x

Most of us don't work on VS Code, though. So here is what I measured on the LearnWebCraft repo, which is 334 .ts and .tsx files and 37,697 lines of our own TypeScript. Including type definitions from node_modules, the compiler loads about 1,400 files.

The setup: an AMD Ryzen 7 5800H laptop (8 cores, 16 threads), Windows 11, Node 24.22. I installed TypeScript 6.0.3 and 7.0.2 in separate scratch folders so the project's own node_modules stayed untouched, and ran each one against the project's tsconfig:

Fig. 1bash
tsc --noEmit --incremental false -p tsconfig.json

--incremental false matters here, because otherwise the second run reads the build info file from the first and you end up measuring a cache. I ran each version three times after one warm-up run and timed the whole process from the shell:

Compiler Run 1 Run 2 Run 3
TypeScript 5.9.3 7.17s 8.75s 9.28s
TypeScript 6.0.3 8.78s 8.90s 8.79s
TypeScript 7.0.2 (default, 4 checkers) 1.16s 1.22s 1.15s
TypeScript 7.0.2 --checkers 8 1.08s 1.11s 1.15s
TypeScript 7.0.2 --singleThreaded 2.56s 2.55s 2.55s

That's about 7.5x faster in wall-clock time, from almost nine seconds to just over one. The --extendedDiagnostics output tells a slightly bigger story:

TypeScript 6.0.3 TypeScript 7.0.2
Parse time 0.96s 0.12s
Bind time 0.47s 0.04s
Check time 4.48s 0.45s
Total time (reported) 6.45s 0.62s
Memory used about 533 MB about 384 MB

The compiler's own clock shows a 10x speedup, close to Microsoft's average. The gap between that and my 7.5x is fixed cost: starting the process, reading the tsconfig, Windows being Windows. On a small project, fixed cost is a big share of the total, so the ratio looks worse. On a big project, it disappears into the noise.

A few things surprised me.

First, --checkers 8 did almost nothing. Microsoft's table shows VS Code going from 10.6s to 7.5s with eight checkers, but our project just isn't big enough to keep eight threads busy. If your project type-checks in a second or two, leave the default alone.

Second, even single-threaded, TypeScript 7 was more than three times faster than 6.0. So the native code alone gets you a lot before parallelism adds anything. That's useful to know if you run CI on small machines with one or two cores.

Third, memory went down, not up. I expected a parallel compiler to use more. The release post reports the same thing on its projects, with reductions between 6% and 26%.

One small trap if you compare diagnostics yourself: TypeScript 7 reported 129,693 types where 6.0 reported 76,106 for the same code. That doesn't mean it's doing more work. The two compilers count differently, and the release post doesn't treat that number as comparable, so neither should you.

Why this repo needed zero changes

Both 6.0 and 7.0 type-checked our project with zero errors on the first try. I'd love to say that was good planning, but mostly it's because the tsconfig was created recently by Next.js and already looks like the future:

Fig. 2json
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "esnext",
    "moduleResolution": "bundler",
    "strict": true,
    "esModuleInterop": true,
    "isolatedModules": true,
    "paths": { "@/*": ["./*"] }
  }
}

There's no baseUrl, no node resolution, no ES5 target, and the paths entry already starts with ./. If your tsconfig looks like this, the compiler upgrade itself will probably be boring. The tooling around it is a different story, and I'll get to that.

Breaking an old config on purpose

Most real projects aren't that tidy, so I made a small project with the kind of tsconfig I still see all the time in older Node services:

Fig. 3json
{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "baseUrl": "./src",
    "paths": { "@utils/*": ["utils/*"] },
    "downlevelIteration": true,
    "outDir": "dist"
  },
  "include": ["src"]
}

TypeScript 6.0 complains, but it tells you what's coming:

Fig. 4text
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0.
Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0.
error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0.
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0.

TypeScript 7 doesn't negotiate:

Fig. 5text
error TS5108: Option 'target=ES5' has been removed. Please remove it from your configuration.
error TS5108: Option 'moduleResolution=node10' has been removed. Please remove it from your configuration.
error TS5102: Option 'baseUrl' has been removed. Please remove it from your configuration.
  Use '"paths": {"*": ["./src/*"]}' instead.
error TS5090: Non-relative paths are not allowed. Did you forget a leading './'?
error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration.

Note the TS5090 error on line 7. Once baseUrl is gone, "utils/*" has nothing to be relative to, so the paths entry breaks as well. You fix both at once by writing the full path:

Fig. 6json
{
  "compilerOptions": {
    "target": "es2022",
    "module": "nodenext",
    "paths": { "@utils/*": ["./src/utils/*"] },
    "outDir": "dist",
    "types": ["node"]
  },
  "include": ["src"]
}

Switching to nodenext has a knock-on effect if your code is ESM: relative imports need real file extensions, so import { port } from "@utils/env" becomes "@utils/env.js". That's the change that touches the most files in older codebases. If you use a bundler and don't want to rewrite imports, moduleResolution: "bundler" is the lower-effort choice.

The types trap

Look at that last line of the fixed config, "types": ["node"]. Without it, here's what I got, even though @types/node was installed:

Fig. 7text
src/utils/env.ts(1,28): error TS2591: Cannot find name 'process'. Do you need to install
type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the
types field in your tsconfig.

This one will confuse people. The error tells you to install a package you already have. The real cause is that types now defaults to [], so TypeScript no longer loads everything in node_modules/@types automatically. You list what you want: "types": ["node"] for a Node service, maybe ["node", "vitest/globals"] if your tests use globals. If you just want the old behaviour back, "types": ["*"] restores it.

I'd actually recommend keeping the explicit list. The 6.0 release notes say some projects saw 20% to 50% faster builds just from setting types, because the compiler stops loading type packages nobody uses.

A small change you probably won't notice

There's one change in type behaviour itself, and it's a nice one. Template literal inference now treats an emoji, or any character outside the Basic Multilingual Plane, as a single character instead of two UTF-16 halves:

Fig. 8ts
type HeadTail<S extends string> = S extends `${infer H}${infer T}` ? [H, T] : never;

const x: HeadTail<"😀abc"> = ["😀", "abc"];

TypeScript 6.0 rejects this, because it splits the emoji into two halves that aren't valid characters on their own. In my terminal the error message printed one of them as "�". TypeScript 7 accepts it. If you have a type-level Length<S> helper or something similar, its answers for emoji will change. Most of us will never notice.

The part that isn't ready: tools that import TypeScript

This is the section I wish someone had written before I tried it.

The tsc command is only one way TypeScript runs in your project. Lots of tools import the compiler as a library and call its API: typescript-eslint, ts-morph, many webpack and Rollup plugins, Vue's Volar, the Angular compiler, and older versions of Next.js. TypeScript 7.0 doesn't ship that API.

You can see it directly. With 7.0.2 installed:

Fig. 9js
const ts = require('typescript');
console.log(Object.keys(ts)); // [ 'version', 'versionMajorMinor' ]
console.log(typeof ts.createProgram); // 'undefined'

That's the whole main export. The package still has a bin/tsc that launches a native binary, plus some exports under typescript/unstable/* that preview the new API, but anything that does require('typescript') and expects the old compiler object gets nothing useful.

I expected that to break next build, so I tested it instead of assuming. I made a fresh Next.js 16.4.6 app with typescript@7.0.2 as its only TypeScript package and ran a production build. It worked. The type-check step reported Finished TypeScript in 642ms, and when I added a deliberate error (const greeting: number = 'hello'), the build failed the way it should:

Fig. 10text
Running TypeScript ...
app/page.tsx(1,7): error TS2322: Type 'string' is not assignable to type 'number'.
Failed to type check.

The reason is in Next's source. Version 16.4 has an experimental.useTypeScriptCli option that defaults to true, and with it on, Next runs your project's tsc binary instead of importing the compiler API. If you turn it off, Next looks for the API, doesn't find it, and throws an error telling you to set the option back or install TypeScript 6. So for the build itself, a current Next.js app is fine on 7.0. Older Next.js versions that don't have this option will need TypeScript 6.

Linting is where I hit the wall. The typescript-eslint packages installed in this repo (8.73) declare a peer range of typescript >=4.8.4 <6.1.0, and they import the compiler API to get type information. Typed lint rules can't run on 7.0 as your typescript package. There is an experimental tsgo backend in typescript-estree, but it needs a TypeScript 7.1 build installed under the alias @typescript/native, with classic 6.0 still installed as typescript. That's the side-by-side layout described below, and it tells you where the tooling is heading.

Editors are the other gap. The 7.0 release notes recommend the new language server only where you don't need language service plugins, which is a polite way of saying plugins don't work there yet. Next.js ships one (it's the "plugins": [{ "name": "next" }] entry in your tsconfig). The release notes tell Vue, Svelte, Astro, MDX and Angular users to stay on 6.0 for their editor and framework tooling for now.

The workaround: run both

Microsoft saw this coming and published a compatibility package, @typescript/typescript6. It contains the 6.0 compiler and its API, under a binary called tsc6. The trick is to install it under the name typescript, so every tool that imports typescript gets 6.0, and install 7.0 under a different name so you still get the fast tsc:

Fig. 11json
{
  "devDependencies": {
    "typescript": "npm:@typescript/typescript6@^6.0.2",
    "@typescript/native": "npm:typescript@^7.0.2"
  }
}

With this setup, typescript-eslint and anything else that imports the compiler keep using 6.0, and npx tsc runs 7.0. Your CI type-check step gets the 10x speedup and nothing else notices. The type checking logic is the same in both, so the two compilers agree about your code.

It's a bit ugly. Two compilers in one node_modules is not something I'd normally accept. But it's a temporary state, and it's much better than waiting.

One more thing to watch in CI: the native binary arrives through platform-specific optional dependencies (@typescript/typescript-linux-x64, @typescript/typescript-darwin-arm64 and so on). If your pipeline installs with --omit=optional, or your lockfile was generated in a way that skipped the Linux package, tsc will have no binary to run. If you've ever had esbuild or Rollup fail the same way, it's the same problem.

When this gets better

TypeScript 7.1 is in beta and it ships the new programmatic API. It has a synchronous entry point (typescript/sync) and a Promise-based one (typescript/async), plus modules for working with the AST. It's a new and different API, not the old one with a new engine, so tools have to be ported to it. That's why typescript-eslint and friends can't simply flip a switch.

7.1 also adds a plugin point called content mappers, which is how Vue, Svelte, Astro and MDX files will get type-checked by the native compiler. The 7.1 beta post links prototypes for most of them, but none of them are released packages yet. A content mapper is an external program that TypeScript runs, so tsc needs a --runExternalCode flag before it will run one, and VS Code asks for workspace trust first. I like that it's opt-in.

The team said the 7.1 release candidate would follow the beta in about a month, which puts it around now. Even after 7.1 is stable, give your tools a little time to adopt the new API before you drop the 6.0 alias.

How I'd migrate a real project

Here's the order that worked for me, and that I'd use on a client project.

Step 1: get clean on 6.0 first

Upgrade to the latest 6.0 and fix every deprecation error. Don't add ignoreDeprecations. If you already did, delete it now and see what breaks. Every warning you silence in 6.0 turns into an error in 7.0, and 6.0 gives you much better error messages for fixing them.

If you have a lot of baseUrl and rootDir changes, the 6.0 release post mentions an experimental codemod, ts5to6, that can rewrite those for you. I haven't used it on a big project, so check the diff.

Step 2: write your types list

Decide what goes in types. Run the check and add packages as the "Cannot find name" errors appear. It's tedious for ten minutes and then you never think about it again.

Step 3: check your tsconfig against 7.0 without installing it

You don't need to change package.json to try 7.0. Run it once with npx:

Fig. 12bash
npx -p typescript@7 tsc --noEmit -p tsconfig.json

If that passes, the compiler side is done. If you get TS5102 or TS5108 errors, you missed something in step 1.

Step 4: install the side-by-side setup

Add the two aliases from the previous section. Point your CI type-check step at tsc, which is now 7.0. Leave lint and editor tooling on 6.0. Then run your build and your linter once and read the output, because that's the fastest way to find a tool that imports typescript and didn't tell you.

Step 5: switch the editor, if your stack allows it

For plain TypeScript and React projects without language service plugins, the 7.0 language server is a big improvement. Microsoft says the time to the first error after opening the VS Code codebase dropped from about 17.5 seconds to under 1.3 seconds. Install the "TypeScript Native Preview" extension in VS Code and it takes over. If something feels off, the command palette has "Disable TypeScript 7 Language Server" to switch back.

For Next.js, Vue, Svelte, Astro and Angular projects, I'd wait. You lose framework-specific checks in the editor, and that's not worth a faster hover tooltip.

Step 6: pin --checkers in CI

The default is four checker threads, and it's fine for most projects. But the release notes mention that in rare cases, changing the number of checkers can change the order of results. That shouldn't affect whether your code passes, but if you diff compiler output or snapshot error messages, pick one value and use it everywhere:

Fig. 13bash
tsc --noEmit --checkers 4

If you use project references with tsc --build, there's also --builders, which controls how many projects build in parallel. It multiplies with --checkers, so --checkers 4 --builders 4 can mean sixteen type-checkers at once. That can be too many on a CI runner with limited memory.

A few JavaScript-specific changes

If you use allowJs and checkJs to type-check JavaScript with JSDoc, there are more changes, because 7.0 now analyses JavaScript files closer to how it analyses TypeScript. A few that are likely to bite:

  • You can't use a value as a type any more in JSDoc. Write typeof foo instead of foo.
  • @enum has no special meaning.
  • A standalone ? as a type is gone, so use any or unknown.
  • @class no longer turns a function into a constructor.
  • Closure-style function types like function(string): void aren't supported.

The full list lives in CHANGES.md in the typescript-go repository. If you have a large JSDoc codebase, read it before you start.

Is it worth it right now?

For CI type-checking: yes, today. The side-by-side setup takes about fifteen minutes and every pipeline gets faster. Slack's engineers reported their CI type-check going from about 7.5 minutes to 1.25 minutes. Our check went from nine seconds to one, which is less dramatic, but I notice it every time I run it locally.

For the editor: yes, if you write plain TypeScript or React and don't rely on a language service plugin. Opening a big project and getting errors in a second instead of twenty is the change you feel most.

For a full switch, where typescript in your package.json means 7: not yet, unless nothing in your toolchain imports the compiler. A Next.js 16.4 build is fine with it, as I found out, but typed linting isn't. Wait for 7.1 to go stable and for typescript-eslint and your framework to announce support.

What I keep thinking about is that the type system didn't change. Same rules, same errors, same any leaks. The only difference is that it answers you before you have time to look away. That turns out to change how you work more than most new language features have.

If you're still deciding how much TypeScript is worth in the first place, our TypeScript vs JavaScript post covers the cost side, and the JavaScript to TypeScript migration guide walks through moving an existing project over. And if you're upgrading Next.js at the same time, do that first with the Next.js 16 upgrade guide, then come back for the compiler.

§98Tools

Tools for this topic

Interactive tools that match this article's subject.