Dev Encyclopedia
ArticlesTools

Get notified when new content drops

No spam. Just new articles, tools, and updates straight to your inbox.

Dev Encyclopedia

A reference for builders

Content

  • Articles
  • Tools
  • Contact

Connect

  • support@devencyclopedia.com
  • RSS Feed

© 2026 Dev Encyclopedia

Privacy PolicyTermsDisclaimer
  1. Home
  2. /Blog
  3. /TypeScript 7 Migration Guide: tsgo, Breaking Changes, Build Times
typescript9 min read

TypeScript 7 Migration Guide: tsgo, Breaking Changes, Build Times

Migrate to TypeScript 7 (tsgo): install the beta, fix the 4 breaking changes, update tsconfig, and decide if upgrading now is worth it.

By Dev EncyclopediaPublished June 15, 2026
On this page

On this page

  • What Actually Changed Under the Hood
  • Real Performance Numbers
  • How to Install and Try tsgo Today
  • What Actually Breaks When You Upgrade
  • tsconfig Compatibility: Removed Options
  • Monorepos and Project References
  • CI/CD: What to Update
  • Should You Upgrade Now?
  • Frequently Asked Questions

TypeScript 7.0 Beta is out. The compiler is rewritten in Go, and the numbers are real: VS Code's 1.5M-line codebase goes from 78 seconds to 7.5 seconds. Sentry's monorepo drops from 133 seconds to 16.

We covered the original announcement in our post on TypeScript 7 (Project Corsa) and what it means for Next.js projects. This guide is the sequel for developers already running TypeScript 5.x or 6.x: what do you actually need to do to move your existing project to TypeScript 7, what breaks, and is it worth doing today?

💡 TL;DR

Install @typescript/native-preview@beta, run npx tsgo --noEmit against your existing project, and compare the output to tsc --noEmit. If the results match, you can start using tsgo in CI today while waiting for the stable typescript@7.0.0 release.

What Actually Changed Under the Hood

The headline change is simple: the compiler was ported from TypeScript (running on Node.js) to Go. That's it. It is not a new type system, not a new syntax, not a new set of compiler options.

Type-checking semantics, error messages, and behavior on both valid and invalid code are structurally identical to TypeScript 6. If your code compiles cleanly under TS6, it will compile the same way under TS7 (with a small set of exceptions covered below).

What changed is execution, not behavior:

  • Go compiles to native machine code: no V8 JIT warmup on every invocation, which matters most for short-lived CLI runs and editor startup.
  • No garbage collector pauses interrupting type-checking on large codebases.
  • True parallelism via goroutines: independent files and packages get checked across multiple CPU cores at once, something Node's single-threaded model could never do.

The new binary is tsgo. The legacy tsc binary still works through an interop shim, so existing scripts won't break overnight. But tsc is now a compatibility layer, not the primary implementation: future performance work goes into tsgo, not tsc.

Real Performance Numbers

These are measured numbers from real codebases, not synthetic micro-benchmarks:

ProjectTS 6 (tsc)TS 7 (tsgo)Speedup
VS Code (1.5M lines)78s7.5s10.4x
Sentry (large monorepo)133s16s8.3x
Medium Node.js backend (~100k lines)12s2.1s5.7x
Small app (~20k lines)3.2s1.1s2.9x

Notice the pattern: the speedup gets bigger as the project gets bigger. That's expected, parallelism gains are most pronounced at scale, where there are more independent files and packages to spread across cores.

Smaller projects still benefit, just less dramatically. A 20k-line app going from 3.2s to 1.1s is a real improvement to editor responsiveness and incremental builds, even if it doesn't make headlines.

ℹ Info

These numbers won't match your project exactly. Estimate your own project's speedup with tsgoCalc, based on your file count, lines of code, monorepo structure, and available CPU cores, including projected CI time savings.

How to Install and Try tsgo Today

The stable typescript@7.0.0 npm package isn't out yet, it's expected late June or early July 2026. But the native preview package is functionally equivalent for most projects, and you can run it side by side with your existing setup right now.

  1. 1

    Install the native preview package

    Add @typescript/native-preview as a dev dependency. It ships the tsgo binary alongside your existing TypeScript install, so nothing in your current setup changes yet.

    bash
    # npm
    npm install --save-dev @typescript/native-preview@beta
    
    # pnpm
    pnpm add -D @typescript/native-preview@beta
    
    # yarn
    yarn add -D @typescript/native-preview@beta
  2. 2

    Run tsgo and compare against tsc

    Confirm the binary is installed, then run a full type check against your existing tsconfig.json:

    bash
    npx tsgo --version
    
    # Run a first type check against your existing config
    npx tsgo --project tsconfig.json

    Now run tsc the same way and diff the output. For most projects, the error list (or lack of one) will be identical. If you see differences, jump to the breaking changes section below before assuming something is wrong.

    bash
    # Compare side by side
    npx tsc --noEmit
    npx tsgo --noEmit
  3. 3

    Install the VS Code Native Preview extension

    If the command line output matches, switch your editor over too. This gets you faster IntelliSense, faster project-wide error checking, and faster startup on large projects.

    1. Install the TypeScript Native Preview extension from the VS Code marketplace.
    2. Open the command palette (Cmd+Shift+P or Ctrl+Shift+P).
    3. Run TypeScript: Select TypeScript Version.
    4. Choose Use TypeScript Native Preview Version.

    VS Code will now use tsgo for in-editor type checking. If something looks off, you can switch back to the workspace version of TypeScript from the same menu at any time.

What Actually Breaks When You Upgrade

TypeScript 7 has 99%+ feature parity with TypeScript 6. But a handful of legacy patterns that were already deprecated are now fully gone. Here's the complete list.

Import assertions are replaced by import attributes

The assert keyword for import attributes has been deprecated since TypeScript 5.3 and is now mandatory to replace. Use with instead of assert.

typescript
// TS 6: deprecated, still worked with a warning
import data from "./config.json" assert { type: "json" };

// TS 7: required syntax
import data from "./config.json" with { type: "json" };

JSDoc @enum is removed for .js files

This only affects .js files that use JSDoc-based types, not .ts or .tsx files. If you were relying on @enum to get enum-like behavior in plain JavaScript, replace it with a @typedef over a typeof key-union.

javascript
// TS 6: JSDoc @enum (now removed)
/** @enum {number} */
const Direction = {
  Up: 0,
  Down: 1,
  Left: 2,
  Right: 3,
};

// TS 7: typedef over a typeof key-union
const Direction = {
  Up: 0,
  Down: 1,
  Left: 2,
  Right: 3,
};

/** @typedef {Direction[keyof typeof Direction]} DirectionValue */

Prototype reassignment loses special type inference

Reassigning MyClass.prototype to an object literal used to get special-cased type inference in the old compiler. tsgo doesn't replicate that special case. This pattern is rare in modern codebases, but if you have it, refactor to a proper class body or object literal.

typescript
// TS 6: special-cased prototype reassignment
function MyClass() {}
MyClass.prototype = {
  greet() {
    return "hello";
  },
};

// TS 7: use a proper class instead
class MyClass {
  greet() {
    return "hello";
  }
}

Legacy this aliasing patterns may need refactoring

Some older code captures this into a variable (const self = this;) to work around callback scoping issues from before arrow functions were common. tsgo may type these patterns slightly differently than tsc did.

This is less common than the other three changes, since arrow functions have made this aliasing largely unnecessary for years. If tsgo --noEmit flags one of these, the fix is almost always replacing the callback with an arrow function.

tsconfig Compatibility: Removed Options

A few deprecated compiler options are removed entirely in TypeScript 7, not just deprecated.

  • `importsNotUsedAsValues` and `preserveValueImports`, both replaced by verbatimModuleSyntax.
  • `noImplicitUseStrict`, just remove it. Modules are always strict in TypeScript 7.

To find every removed option in your config before you upgrade, run tsgo against your project and grep for the removal warning:

bash
npx tsgo --listFilesOnly 2>&1 | grep "Option .* has been removed"

If you'd rather start clean, the TSConfigBuilder tool generates a tsconfig.json that's compatible with TypeScript 7 defaults from the ground up, useful for new projects or as a reference when auditing an existing config.

Monorepos and Project References

Monorepos are where tsgo's parallel type-checking shows up most. Independent packages get checked simultaneously across CPU cores instead of one after another, sometimes more than 10x faster on the parallel portion of the build.

Project references (the references: [] array in tsconfig.json) and --incremental work the same way they did in TypeScript 6. The relative gain from --incremental is smaller under TS7 though, since the non-incremental baseline is already so much faster that there's less room left to save.

CI/CD: What to Update

The mechanical change is swapping tsc --noEmit for tsgo --noEmit in your type-check step. You don't have to do this as a single cutover.

yaml — .github/workflows/ci.yml
- name: Type check (tsc, baseline)
  run: npx tsc --noEmit

- name: Type check (tsgo, preview)
  run: npx tsgo --noEmit
  continue-on-error: true

Running both side by side lets you treat tsgo errors as warnings during migration. Once the two steps consistently agree, drop the tsc step and remove continue-on-error from the tsgo step.

If you're setting up GitHub Actions for type checking for the first time, our GitHub Actions tutorial covers general workflow setup, triggers, and caching.

Should You Upgrade Now?

SituationRecommendation
New project, no legacy patternsUse tsgo from day one
Existing project, compile time > 30sTry the beta today
Existing project, compile time < 5sWait for stable (late June 2026)
Project uses `importsNotUsedAsValues` or JSDoc `@enum`Fix deprecated patterns first, then upgrade
Large monorepo on a tight timelineRun both in CI, plan migration for Q3 2026
Legacy patterns present (prototype reassignment, `assert` imports)Audit first with `tsgo --noEmit` to see error count

Microsoft describes the Beta as "highly stable, highly compatible, and ready to be put to the test in your daily workflows and CI pipelines today."

Greenfield projects and teams comfortable running a beta compiler have no real reason to wait. Everyone else can run tsgo --noEmit alongside their existing setup this week and know within minutes whether the migration is trivial or needs cleanup first.

Frequently Asked Questions

When will TypeScript 7 be stable?

Late June or early July 2026 is the current target for the stable typescript@7.0.0 release. The Beta is already described by Microsoft as production-ready for daily workflows and CI pipelines, so the stable release is mostly about removing the beta label rather than major behavioral changes.

Is TypeScript 7 backward compatible with TypeScript 6?

Yes, with 99%+ feature parity and identical type-checking semantics for the vast majority of code. The small list of breaking changes (import attributes, JSDoc @enum removal for .js files, prototype reassignment, and this aliasing edge cases) is covered in full above.

What is tsgo?

tsgo is the new compiler binary written in Go, shipped as part of TypeScript 7 and currently available through the @typescript/native-preview package. It replaces the Node.js-based compiler for type-checking and emit.

The tsc binary still works through an interop shim for backward compatibility, but it won't receive future performance work. New optimizations land in tsgo.

How do I install the TypeScript 7 beta?

Install the native preview package as a dev dependency, then run a type check with tsgo:

bash
npm install --save-dev @typescript/native-preview@beta
npx tsgo --noEmit
Does TypeScript 7 support all TypeScript 6 features?

Yes, except for the small set of removed legacy patterns: import assertions (use import attributes with with instead of assert), JSDoc @enum in .js files, and special-cased prototype reassignment inference.

All four are covered above with migration paths. For most projects on modern syntax, none of these apply and the upgrade is just a version bump.

Related Articles

typescript

TypeScript 7 (Project Corsa): What Next.js Devs Need to Know

TypeScript 7 rewrites the compiler in Go for 10x faster builds. Here's what it means for your Next.js project and what to do right now.

May 30, 2026·7 min read
devops

GitHub Actions Tutorial: CI/CD from Push to Deploy (2026)

Learn GitHub Actions: write your first workflow, run tests automatically, use secrets safely, deploy via SSH, cache dependencies, and run matrix builds.

Jun 12, 2026·13 min read

On this page

  • What Actually Changed Under the Hood
  • Real Performance Numbers
  • How to Install and Try tsgo Today
  • What Actually Breaks When You Upgrade
  • tsconfig Compatibility: Removed Options
  • Monorepos and Project References
  • CI/CD: What to Update
  • Should You Upgrade Now?
  • Frequently Asked Questions
Advertisement