TypeScript 7.1 RC Runs the Compiler in Your Browser

On December 4, 2026 the TypeScript team published the Release Candidate for 7.1, and alongside it an experimental WebAssembly package named @typescript/typescript-wasip1-wasm. The practical consequence: the compiler itself is now something you can fetch and run inside a browser tab, with no external process and no service in the middle.

The problem this solves

Before version 7, the compiler was written in TypeScript, so it ran anywhere JavaScript ran — in a browser, in a Web Worker, inside any web-based editor. The native rewrite in TypeScript 7 bought a large step up in speed, but the cost was obvious: a native executable does not run in a browser.

That removed the floor from under a whole layer of tooling. Playgrounds, web editors, code review surfaces, any UI that wants to show types and diagnostics without a backend — each had to either pin to an older release or ship files to a process on the server and wait for answers to come back.

What actually changed

7.1 adds experimental support for the wasip1/wasm target, shipped as a separate package containing lib/tsc.wasm. That package has exactly one JavaScript export, wasmURL, pointing at the binary. The layer above it lives in the typescript package itself:

  • typescript/wasm — provides instantiateWasm, instantiateWasmSync, and WasmTransport.
  • typescript/sync and typescript/async — the API surface for programs, types, and diagnostics.
  • typescript/fs — request-scoped virtual filesystems built in memory.
  • typescript/ast, typescript/ast/is, typescript/ast/factory — syntax tree types and helpers.

The mental model differs from tsc as a command that runs and exits. The binary boots as a reactor: a live instance that stays open and answers requests one after another. The same file also runs under WASI runtimes such as wasmtime, wasmer, and wazero — which is what lets 7.1 run in the official Playground and, experimentally, in VS Code for the Web.

A working example

ts
import { wasmURL } from "@typescript/typescript-wasip1-wasm";
import { instantiateWasm, WasmTransport } from "typescript/wasm";
import { API, formatDiagnostics } from "typescript/async";

// 1. The compiler is just bytes you fetch and compile like any other module.
const bytes = await fetch(wasmURL).then((r) => r.arrayBuffer());
const wasmModule = await WebAssembly.compile(bytes);

// 2. Boot it as a long-lived reactor instead of a one-shot CLI run.
const instance = await instantiateWasm(wasmModule, {
  stderr: (text) => console.error(text),
});

// 3. Drive it in-process — no child process, no sockets.
await using api = new API({ transport: new WasmTransport({ instance }) });

const result = await api.transpileModule(
  "export const greet = (name: string): string => `hi ${name}`;",
  { fileName: "greet.ts", reportDiagnostics: true },
);

console.log(result.outputText);
for (const d of result.diagnostics ?? []) {
  console.warn(formatDiagnostics([d], api));
}

Real-world caveats

The numbers deserve attention before any architectural decision. In 7.1.1-rc, tsc.wasm is 53,575,187 bytes — roughly 51 MB uncompressed, with the full package around 13.5 MB as a tarball. This does not belong on the critical path of a public page. Its correct home is behind a deferred load, with a long-lived cache, inside a Web Worker so the main thread does not freeze during instantiation.

The module is marked @experimental in its own source, with a note that it may change without notice, so it should sit behind an abstraction of your own rather than directly under product code. In a browser, prefer the asynchronous instantiateWasm: synchronous instantiation of a module this large may be rejected on the main thread. There is also no file watching included — the documentation states plainly that this needs to be handled separately. And anyone hosting the binary on their own WASI host must call the typescript_initialize export rather than _start, which runs the command line compiler instead.

Finally, this is a release candidate, not a final. The current stable release is 7.0.2, and trying the RC starts with npm install -D typescript@rc.

Takeaway

What landed here is less a new language feature than the return of a lost capability: browser-side tooling can again use the same compiler that runs in the pipeline, with the same types and the same diagnostics, without a service in between. The size and the experimental marker draw the boundary clearly for now — editors, playgrounds, and review tools, not lightweight public pages.

Primary source: Announcing TypeScript 7.1 RC