Skip to main content

Guide

What is tsgo? TypeScript's Go-native compiler vs tsc

tsgo is TypeScript's Go-native compiler preview. Learn what it does, how it relates to TypeScript 7, how it compares with tsc, and safe CI testing steps.

·PkgPulse Team·
0
Hero image for What is tsgo? TypeScript's Go-native compiler vs tsc

tsgo is the command-line entry point for Microsoft's native TypeScript compiler preview: the TypeScript 7 generation being ported to Go. It is not a new language, a new type system, or a replacement for every tsc workflow yet. If you searched for "tsgo" broadly, start with the definition below; if you are comparing tsgo vs tsc, the practical question is narrower: can you use the native preview to make type-checking cheaper while classic tsc remains your compatibility fallback?

Fast answers for tsgo searchers

QuestionShort answer
What is tsgo?tsgo is the CLI for Microsoft's Go-native TypeScript compiler preview, distributed through @typescript/native-preview. It aims to run the same TypeScript language and type model faster than classic tsc.
Is tsgo TypeScript 7?It is the preview path for the TypeScript 7 native compiler generation. TypeScript 6 keeps the JavaScript compiler line; TypeScript 7 is the Go-native line Microsoft is working toward.
Should I replace tsc with tsgo?Not as a flag-day migration. Try tsgo beside tsc first, keep tsc for the blocking gate, and only promote tsgo where diagnostics, emit needs, editor behavior, and tooling integrations match.
How do I test tsgo safely in CI?Add @typescript/native-preview, run tsgo --noEmit --pretty false as a non-blocking parallel job next to tsc --noEmit --pretty false, collect timing and diagnostic diffs for several PRs, then decide whether a no-emit check can move to tsgo.

For the broader release path, see the TypeScript 6 and TypeScript 7 Go rewrite guide. For build-pipeline context, compare best TypeScript build tools before changing transpilation or declaration emit.

TL;DR: what tsgo is and when to try it

Try tsgo now if tsc --noEmit is a real bottleneck in a large app or monorepo. Keep classic tsc as the required gate until your own diagnostics match. Microsoft's announcement showed roughly order-of-magnitude checking improvements across projects such as VS Code, Playwright, TypeORM, date-fns, tRPC, and rxjs, but those are announcement benchmarks, not a guarantee for your repository.

For broad tsgo searchers: install the preview package, run npx tsgo --noEmit beside your existing npx tsc --noEmit, compare diagnostics on the same lockfile and machine class, and only promote tsgo after repeated parity runs. For tsgo vs tsc searchers: tsgo is the faster native engine; tsc is still the mature JavaScript implementation with the safest API, editor, plugin, and ecosystem assumptions.

Decision matrix: quick tsgo vs tsc choice

DecisionUse tsgo / native previewKeep classic tsc
Large monorepo type checksYes, as a measured parallel CI job firstKeep as the blocking gate until parity is proven
Small package or appTry it if feedback loops hurtUsually fine until the native compiler is stable for your workflow
Declaration emit and JavaScript emitTest carefully against your package outputsKeep if release artifacts must be identical today
Watch modeTreat as experimental/prototype behaviorKeep for daily local development when watch stability matters
Language service / editorTrack the preview extension and opt in cautiouslyKeep for team-wide editor defaults
Compiler API, custom transformers, tool integrationsAvoid depending on preview API compatibilityKeep; this is where ecosystem assumptions are deepest

Key takeaways

  • tsgo means TypeScript's Go-native compiler preview, distributed as @typescript/native-preview with the tsgo CLI.
  • TypeScript 7 is the native compiler generation. Microsoft's March 2025 roadmap says TypeScript 6 continues the JavaScript codebase while TypeScript 7 arrives when the native codebase reaches sufficient parity.
  • The headline value is speed, especially for type checking. Microsoft reported order-of-magnitude improvements on several public repositories, including VS Code at 77.8s with current tsc versus 7.5s with the native implementation.
  • The language does not change. The safe expectation is the same TypeScript source and type model, with compatibility gaps concentrated in implementation maturity, tooling, API, and workflow support.
  • Adoption should be a side-by-side migration, not a flag-day replacement. Compare diagnostics, emit artifacts, project references, editor behavior, and CI performance before making tsgo required.

At-a-glance comparison

Areatsgo / TypeScript native previewclassic tsc
ImplementationGo-native compiler codebaseJavaScript/TypeScript compiler codebase
CLItsgo from @typescript/native-previewtsc from typescript
Current npm signal@typescript/native-preview latest observed 7.0.0-dev.20260514.1typescript latest observed 6.0.3
Last-month npm downloads24,172,001 for the preview package813,328,241 for typescript
Type checkingMain early-adoption use caseMature default
Build mode / project referencesListed as done in the TypeScript Go README, but still validate your graphMature default
Watch modeListed as prototype behaviorMature default
Language serviceListed as in progress; preview VS Code integration existsMature default in editors
Public API / custom toolingListed as not readyMature ecosystem dependency
Best role in CINon-blocking or measured fast path firstBlocking fallback and release gate

Benchmark evidence, with the caveat that matters

Microsoft's original native-port announcement reported these examples for checking public codebases:

CodebaseApprox. sizeCurrent compilerNative compilerReported speedup
VS Code1,505,000 LOC77.8s7.5s10.4x
Playwright356,000 LOC11.1s1.1s10.1x
TypeORM270,000 LOC17.5s1.3s13.5x
date-fns104,000 LOC6.5s0.7s9.5x
tRPC server plus client18,000 LOC5.5s0.6s9.1x
rxjs observable2,100 LOC1.1s0.1s11.0x

Those numbers are strong enough to justify a trial, but they should not be copied into your planning as a guaranteed CI reduction. Your result depends on project references, cold versus warm cache, filesystem speed, lockfile state, machine class, framework type-generation steps, and whether your build is actually blocked by TypeScript checking rather than tests, lint, bundling, or package installs.

Package health snapshot

PkgPulse readers usually need the package-level view before changing CI:

Package / repoSnapshot accessed 2026-05-15What it means
@typescript/native-previewlatest observed 7.0.0-dev.20260514.1, Apache-2.0, 24,172,001 downloads in the last-month npm window ending 2026-05-12Preview package is actively published and visible, but versioning is still dev-preview shaped.
typescriptlatest observed 6.0.3, Apache-2.0, 813,328,241 downloads in the same npm windowClassic compiler remains the ecosystem default and should stay installed during migration.
microsoft/typescript-goabout 25,428 GitHub stars, 956 forks, active push observed 2026-05-15 UTCThe native compiler repo is active and public, but its README still marks API as not ready.
microsoft/TypeScriptabout 108,863 GitHub stars, 13,395 forks, active developmentThe existing TypeScript repo remains the baseline for the JavaScript compiler line.

Migration notes: the safe CI pattern

Start with a parallel check. Do not remove typescript from the repo just because tsgo runs quickly.

# Keep your existing compiler.
npm install --save-dev typescript @typescript/native-preview

# Baseline output from the mature compiler.
npx tsc --noEmit --pretty false

# Preview output from the native compiler.
npx tsgo --noEmit --pretty false

A conservative rollout looks like this:

  1. Add @typescript/native-preview without removing typescript.
  2. Run tsgo --noEmit as a non-blocking CI job for the packages touched by a pull request.
  3. Store wall-clock time, peak memory if available, and diagnostics from both compilers.
  4. Diff diagnostics for at least several CI runs across normal feature, dependency, and generated-code changes.
  5. Keep tsc for declaration emit, package publishing, custom transformer workflows, compiler API consumers, or editor defaults until your specific tooling is proven.
  6. Promote tsgo only for the step where it has matched tsc, usually no-emit type checking first.

Where tsgo fits in modern TypeScript stacks

Many teams already use a two-step TypeScript pipeline:

Type checking:  tsc --noEmit
Transpilation:  Vite, SWC, esbuild, Bun, tsup, tsdown, or a framework build

That split is why tsgo is attractive. If tsc --noEmit is the slow part, the native compiler can be tested without changing how JavaScript bundles are produced. If your bottleneck is framework route generation, lint, test startup, Playwright, or bundling, tsgo will not fix the slowest step.

Related planning guides: TypeScript 6 and the TypeScript 7 Go rewrite, best TypeScript build tools, running TypeScript directly with tsx, ts-node, and Bun, and Bun Build vs Rolldown vs tsdown.

Dependency risk and tooling risk

The hard part of a compiler migration is rarely the first npx tsgo --noEmit run. It is the surrounding tooling:

  • package managers and lockfiles that need deterministic native binary resolution;
  • generated .d.ts and JavaScript release artifacts that must be byte-for-byte safe for packages;
  • test runners or bundlers that call compiler APIs rather than only running the CLI;
  • IDE settings that must behave consistently across a team;
  • project-reference graphs that mix packages with different tsconfig assumptions;
  • custom transformers, type-aware lint rules, doc generators, or framework plugins.

If a repo publishes libraries, keep release builds on classic tsc until declaration output and downstream consumer tests are validated. If a repo only needs app-level no-emit checks, tsgo can graduate sooner.

Methodology and source-backed evidence

This refresh used the Wave 5 GSC evidence to broaden the opening answer for tsgo search intent while preserving the comparison framing that already ranks for tsgo vs tsc and tsc vs tsgo. Current status claims were checked against official Microsoft/TypeScript sources, npm registry metadata, npm downloads APIs, and GitHub repository metadata on 2026-05-15.

The benchmark table intentionally repeats Microsoft's announcement examples as official announcement benchmarks. It does not claim that every codebase will see the same speedup. The migration recommendation is based on a source-backed parity gate: same repo, same lockfile, same machine class, same TypeScript config, and repeated diagnostic comparisons before promotion.

Source-backed FAQ

Is tsgo the same thing as TypeScript 7?

Not exactly. tsgo is the CLI exposed by the native preview package. TypeScript 7 is the native compiler generation Microsoft described for the Go-port roadmap. In practice, people use "tsgo" as shorthand for trying the TypeScript 7 native compiler preview.

Does tsgo change TypeScript syntax?

No. The TypeScript language remains TypeScript. The migration risk is implementation maturity and tooling parity, not a new type system.

Can tsgo replace tsc in CI today?

It can replace a specific CI step only after your repository proves parity. The first safe step is a non-blocking tsgo --noEmit job beside the existing blocking tsc --noEmit job.

Should package maintainers use tsgo for publishing?

Be cautious. App teams can adopt a no-emit fast path earlier. Package maintainers should keep classic tsc for declaration emit and release artifacts until output, project references, and downstream tests are verified.

Why keep typescript installed if tsgo is faster?

Because the stable ecosystem still expects typescript. Editors, plugins, type-aware tools, framework integrations, and release pipelines may depend on the classic package even if tsgo handles a faster no-emit check.

Source notes

Official and live-data sources used for this refresh: Microsoft Dev Blogs, microsoft/typescript-go README, npm registry metadata for typescript and @typescript/native-preview, npm downloads API last-month windows, GitHub repository metadata for microsoft/typescript-go and microsoft/TypeScript, and the Wave 5 GSC export artifacts. Accessed 2026-05-15.

See the live comparison

View tsgo vs. tsc on PkgPulse →

The 2026 JavaScript Stack Cheatsheet

One PDF: the best package for every category (ORMs, bundlers, auth, testing, state management). Used by 500+ devs. Free, updated monthly.