DEV Community

Cover image for TypeScript 7 Is Up to 10x Faster. Should You Upgrade Now?
𝗝𝗼𝗡𝗻
𝗝𝗼𝗡𝗻

Posted on AI-assisted

TypeScript 7 Is Up to 10x Faster. Should You Upgrade Now?

TypeScript 7 makes an unusually attractive promise:

The same kind of type checking, much faster.

The compiler and language service have been ported to Go. Microsoft reports typical full-build improvements between 8x and 12x in large codebases, along with lower aggregate memory use in its published benchmarks.

That sounds like an automatic upgrade.

It is not.

A faster compiler is useful only if your framework build, declaration output, editor, project references, linting, and surrounding tools still behave correctly.

Fortunately, you do not need a week-long migration project to find out.

You need a temporary branch, your existing verification commands, and two comparable timings.

The goal of this test is not to reproduce Microsoft's benchmark.

The goal is to learn whether TypeScript 7 improves your project without breaking the workflow around it.

Why TypeScript 7 is different

This is not a routine compiler release.

TypeScript 7 replaces the previous JavaScript-based compiler and language service with a native implementation written in Go. The new implementation uses native code, shared-memory multithreading, and other optimizations intended to preserve familiar TypeScript behavior while substantially reducing wait times.

Microsoft's published full-build results include:

  • VS Code: 125.7 seconds to 10.6 seconds
  • Sentry: 139.8 seconds to 15.7 seconds
  • Playwright: 12.8 seconds to 1.47 seconds
  • tldraw: 11.2 seconds to 1.46 seconds

Those are impressive results, but they are not a promise about every repository. A small application that spends most of its build time bundling assets or running tests may see a less dramatic end-to-end improvement.

The useful question is not:

Is TypeScript 7 fast?

It is:

How much of my development time is actually controlled by TypeScript?

Benchmark your current project

Start from a clean working tree and record the current compiler version:

npx tsc --version
Enter fullscreen mode Exit fullscreen mode

Then time the command your project already uses for type checking.

On macOS or Linux:

time npx tsc --noEmit
Enter fullscreen mode Exit fullscreen mode

For a project using references:

time npx tsc --build --force
Enter fullscreen mode Exit fullscreen mode

Also run the commands that represent the complete project workflow:

npm run lint
npm test
npm run build
Enter fullscreen mode Exit fullscreen mode

Do not compare a cold first run with a warm second run and call the difference a compiler improvement. Run each measurement several times under similar conditions.

A small note is enough:

Current TypeScript version:
Cold type check:
Second type check:
Production build:
Tests:
Declaration build:
Editor project load:
Enter fullscreen mode Exit fullscreen mode

The editor measurement can be approximate. Open the same workspace and observe how long it takes before diagnostics, references, and completions become useful.

Test the upgrade on a branch

Create an isolated branch:

git switch -c test/typescript-7
Enter fullscreen mode Exit fullscreen mode

Install TypeScript 7:

npm install --save-dev typescript@latest
Enter fullscreen mode Exit fullscreen mode

Verify that the local executable changed:

npx tsc --version
Enter fullscreen mode Exit fullscreen mode

Now repeat the same commands you recorded earlier:

time npx tsc --noEmit
npm run lint
npm test
npm run build
Enter fullscreen mode Exit fullscreen mode

If the repository uses project references, declaration generation, API extraction, code generation, or framework-specific builds, run those too.

A successful tsc --noEmit result is necessary, but it is not the whole migration test.

Compare more than type-check time

Record the results without polishing them into a marketing claim.

| Check | Before | TypeScript 7 | Result |
|---|---:|---:|---|
| Cold type check | your result | your result | compare |
| Second type check | your result | your result | compare |
| Production build | your result | your result | compare |
| Tests | passed/failed | passed/failed | compare |
| Declarations | passed/failed | passed/failed | compare |
Enter fullscreen mode Exit fullscreen mode

The most useful observations may not fit in a timing table:

  • Did the editor load the project faster?
  • Did auto-imports behave normally?
  • Did find-all-references return complete results?
  • Did declaration files change unexpectedly?
  • Did the framework build use the new compiler?
  • Did linting or another tool report an incompatible peer dependency?
  • Did CI use the same TypeScript version as the local test?

For many developers, faster diagnostics in the editor will matter more than shaving another second from an already short production build.

Know the main compatibility boundary

TypeScript 7.0 does not ship a stable programmatic compiler API.

That matters when a tool imports TypeScript as a library instead of simply invoking tsc. Custom transformers, compiler plugins, embedded-language tooling, declaration tools, and some framework integrations may still depend on the TypeScript 6 API.

Microsoft provides the @typescript/typescript6 compatibility package for tools that still need programmatic access while TypeScript 7 handles compilation.

A side-by-side setup can look like this:

{
  "devDependencies": {
    "@typescript/native": "npm:typescript@^7.0.2",
    "typescript": "npm:@typescript/typescript6@^6.0.2"
  }
}
Enter fullscreen mode Exit fullscreen mode

In this arrangement, the TypeScript 6 compatibility package remains available to tools expecting the established API, while the aliased native package supplies the TypeScript 7 compiler.

Do not add this workaround automatically. First identify whether any tool in your project actually needs it, then follow that tool's current migration guidance.

Projects that should test especially carefully

Take extra care if your project uses:

  • custom TypeScript transformers,
  • tools that import the compiler API,
  • framework-specific template type checking,
  • MDX or embedded languages,
  • declaration bundlers,
  • compiler-based code generation,
  • complex project references,
  • editor plugins tied to the older language service,
  • build systems that pin a particular TypeScript range.

This does not mean the project cannot upgrade. It means npx tsc --noEmit is not enough evidence by itself.

Check the editor separately

TypeScript 7 uses the Language Server Protocol, which makes the new language service available beyond one editor. Microsoft also provides dedicated TypeScript 7 support for VS Code, while other editors may have their own enablement instructions.

Verify the editor rather than assuming the workspace dependency controls everything.

Test a few ordinary actions:

  1. Open a large file with a known type error.
  2. Trigger auto-completion.
  3. Find all references for a widely used symbol.
  4. Rename a symbol across several files.
  5. Add an import using a quick fix.
  6. Restart the editor and observe project-load time.

The best upgrade result is not merely a faster CI number. It is a shorter feedback loop throughout the day.

Keep it or roll it back

Keep the upgrade when:

  • the same checks pass,
  • declaration output remains acceptable,
  • the framework build behaves correctly,
  • editor features work as expected,
  • CI uses the intended compiler,
  • the measured improvement matters to the project.

Roll it back for now when:

  • a critical tool needs the older compiler API,
  • generated output changes unexpectedly,
  • editor support is incomplete for your setup,
  • the framework has not yet documented support,
  • the performance gain does not justify the migration work.

Rolling back the experiment is simple:

git switch -
git branch -D test/typescript-7
Enter fullscreen mode Exit fullscreen mode

Alternatively, keep the branch and open an issue listing the blockers. A measured β€œnot yet” is a useful result.

A ten-minute upgrade checklist

  • [ ] Record the current TypeScript version.
  • [ ] Time the existing type-check command more than once.
  • [ ] Run tests, linting, and the production build.
  • [ ] Create a separate upgrade branch.
  • [ ] Install TypeScript 7 and verify the active executable.
  • [ ] Repeat the same measurements.
  • [ ] Compare editor behavior.
  • [ ] Check declaration output and project references.
  • [ ] Identify tools that import TypeScript programmatically.
  • [ ] Confirm that CI uses the intended version.
  • [ ] Keep the change only when correctness and tooling still hold.

The takeaway

TypeScript 7 is exciting because the improvement is not a small optimization around the edges. It replaces the compiler and language service with a native implementation designed for speed and parallelism.

But a headline benchmark is not a migration plan.

The safest approach is short and practical:

Measure the current project
          ↓
Create a temporary branch
          ↓
Install TypeScript 7
          ↓
Run the same checks
          ↓
Verify editor and tooling behavior
          ↓
Keep the upgrade or document the blocker
Enter fullscreen mode Exit fullscreen mode

If you test TypeScript 7, share four details in the comments:

  • approximate project size,
  • previous TypeScript version,
  • old type-check time,
  • new type-check time.

Small applications and large monorepos may tell very different stories.

Read the official TypeScript 7 announcement


Sources and further reading


Connect with Me

If you found this article helpful, let's connect!

Top comments (0)