News 3 min read

TypeScript 7.1 RC: source phase imports, new API, up to 2.2x faster


Microsoft released the release candidate of TypeScript 7.1 on December 4, 2026, the next feature release of the Go-based TypeScript 7 compiler. It adds source phase imports, makes the es2026 target stable, introduces “content mappers” so the compiler can check TypeScript inside .vue, .svelte and similar files, and ships a new compiler API, while type-checking large codebases 1.2x to 2.2x faster than TypeScript 7.0. The team expects the stable release within the next two weeks.

What’s new

You can try it today with:

npm install -D typescript@rc

According to the announcement, the main additions are:

  • Source phase imports. import source x from "..." and import.source() give you a module object before its dependencies load. For WebAssembly that object is a WebAssembly.Module, ready to pass to WebAssembly.instantiate. It needs --module set to esnext, nodenext or preserve.
  • Import attributes in ambient module declarations. You can declare wildcard modules for imports with attributes such as type: "css", "text" or "bytes", so each kind of import gets the right type and a missing attribute is an error. You write these declarations in your own project; they are not in the built-in libraries.
  • --target es2026 and --lib es2026 are stable, covering APIs such as Math.sumPrecise(), Iterator.concat(), Error.isError(), Array.fromAsync(), getOrInsert() on Map and WeakMap, and the base64 and hex methods on Uint8Array.
  • New esnext types for Promise.allKeyed, Promise.allSettledKeyed, Iterator.zip, Iterator.zipKeyed and the iterator helpers chunks, join and includes.
  • Content mappers, a plugin point for file formats that embed JavaScript or TypeScript. They are registered under contentMappers in tsconfig.json and only run with tsc --runExternalCode; in VS Code they need workspace trust and can be turned off with js/ts.contentMappers.enabled. Microsoft says mappers have been prototyped or implemented for Astro, CSS Modules, Ember, MDX, Svelte and Vue.
  • --disableDynamicImportExtensionRewriting, which stops TypeScript emitting the helper that rewrites file extensions in non-literal import() and require() calls.
  • An experimental WebAssembly build, @typescript/typescript-wasip1-wasm, whose tsc.wasm runs in browsers, WASI runtimes, the TypeScript Playground and VS Code for the Web.

Faster and leaner

Microsoft says TypeScript 7 was often about 10x faster than TypeScript 6, and 7.1 builds on that. Its benchmarks use four type-checker threads and --noEmit:

Codebase TS 7 TS 7.1 RC Memory saved
bluesky 3.97s 3.3s 28.0%
mui-docs 19.1s 8.77s 49.2%
sentry 17.5s 12.8s 27.7%
t3code-server 23s 16.9s 29.0%
vscode 19.4s 14.9s 26.6%

What it means for developers

Tool authors get a new API. The compiler API is now split into entry points: typescript/sync, typescript/async, typescript/fs, typescript/ast, typescript/ast/is, typescript/ast/factory and an experimental typescript/wasm. API, Program and Snapshot objects are disposable, and the post warns that the Go side leaks memory unless you release them with using or dispose(). Snapshots can be derived with snapshot.update() instead of rebuilding a program, and file watching is supplied separately through fileNotifications.

Framework users (Vue, Svelte, Astro, MDX) should watch content mappers: they let the compiler check those files directly, through mappers Microsoft says have been prototyped or implemented for each. They run third-party code, which is why they are opt-in.

Check for two breaking changes before upgrading:

  • Distributive conditional types are stricter. In each branch, the checked type parameter is now treated as a new, narrower type parameter, so code such as A extends B ? never : Show<A, B> can now report that B does not satisfy the constraint A. The fix is usually to drop a constraint that wasn’t needed or add a conditional check.
  • The generated DOM types in lib.d.ts changed, which may surface new errors in browser code.

The release notes list no deprecations or removals. The speedups above measure type-checking only, since the benchmarks run with --noEmit. For a recent example of why keeping framework dependencies current matters, see our post on the Next.js security release.

How it compares

The 7.1 RC follows the beta published on October 20, 2026. Since the beta, Microsoft has improved the API, added defaults and features for content mappers, added the dynamic import flag and the WebAssembly package, and made further speed and memory improvements. The largest gain in Microsoft’s table is on mui-docs, where checking time drops from 19.1s to 8.77s and memory use roughly halves, from 7,043 MiB to 3,580 MiB.

Sources