# TypeScript 7.1 Beta: New API, es2026 and What Can Break

TypeScript 7.1 beta brings back a programmatic API, content mappers for Vue and Svelte, stable es2026 and import attributes in ambient modules. What's new, Microsoft's benchmarks, and the two changes that can add errors.

By Waseem Anjum · Published 2026-11-10 · Updated 2026-11-13 · https://fabwaseem.com/blog/typescript-7-1-beta

> **TL;DR:** TypeScript 7.1 beta (announced October 20, 2026) restores a programmatic API as focused entry points such as typescript/sync and typescript/async, adds content mappers for Vue, Svelte and similar files, makes es2026 a stable target and lib, and allows import attributes in ambient modules. Microsoft reports 1.2x to 1.9x faster checks than 7.0. Two changes can add errors: DOM lib.d.ts types and stricter distributive conditional types.

TypeScript 7.1 is in beta. The [official announcement](https://devblogs.microsoft.com/typescript/announcing-typescript-7-1-beta/) is dated October 20, 2026, and its headline change is that the native compiler gets a programmatic API again, the thing TypeScript 7.0 shipped without. This guide covers what is in the beta, Microsoft's own benchmarks, and the two changes that can add errors. For the 7.0 baseline and my own measurements, see my [TypeScript 7 upgrade guide](https://fabwaseem.com/blog/typescript-7).

## How do I install the TypeScript 7.1 beta?

```bash
npm install -D typescript@beta
```

`typescript@latest` is still the 7.0 line, so removing the beta is a matter of reinstalling `typescript@latest`. Try it on a branch first, and run your CI type-check against it before trusting it.

## What is the new TypeScript 7.1 API?

It is not the old single `ts` object. The beta exposes focused entry points:

| Entry point | What it gives you |
| --- | --- |
| `typescript/sync` | Synchronous compiler client: compiler options, type checker and program APIs. The main class is `API`. |
| `typescript/async` | A Promise-based equivalent of the sync client |
| `typescript/fs` | Request-scoped full and layered filesystems (`createFileSystem`, `createFileSystemWithLib`, `createFileSystemLayer`) |
| `typescript/ast` | AST node types and enums such as `SyntaxKind` and `ScriptTarget` |
| `typescript/ast/is` | Node type guards |
| `typescript/ast/factory` | `create*` functions and immutable `update*` functions |

A few details matter if you build tooling on it. `API` and `Program` objects are `Disposable`, so dispose them manually or declare them with `using`, and a disposed program cannot be reused. Snapshots (`api.createSnapshot` and `snapshot.update()`) model changes over time. The API does not discover `tsconfig.json` and does not support `--project`, and the post says more examples are coming.

## What are content mappers?

Content mappers let non-`.ts` files, such as Vue or Svelte single-file components, be type-checked by the native compiler. You register them per file extension in `tsconfig.json` under `contentMappers`, with `package`, `extensions` and `options` fields.

Because a mapper runs external code, you must pass the `--runExternalCode` flag. In VS Code they need workspace trust and mapper permissions, and the `js/ts.contentMappers.enabled` setting can switch them off. According to the announcement, mappers are implemented in pull requests for Vue and Svelte, and prototyped or implemented for Astro, CSS Modules, Ember and MDX. The example `@vue/content-mapper` package is not on npm yet, so this is early.

## What else is new?

- **es2026.** `--target es2026` and `--lib es2026` are stable. The lib additions include `Math.sumPrecise()`, `Iterator.concat()`, `JSON.rawJSON()`, `Error.isError()`, `Array.fromAsync()` and several `Map`, `WeakMap` and `Uint8Array` methods.
- **esnext additions.** `--lib esnext` adds `Promise.allKeyed`, `Promise.allSettledKeyed`, `Iterator.zip`, `Iterator.zipKeyed`, `Iterator.prototype.chunks`, `Iterator.prototype.join` and `Iterator.prototype.includes`.
- **Import attributes in ambient modules.** You can declare `declare module "*" with { type: "css" }` (also `"text"` and `"bytes"`). Missing attributes produce errors, matches are not checked against disk, and libraries should not ship these declarations.
- **Source phase imports.** `import source` is described as an ECMAScript proposal. It needs `--module` set to `esnext`, `nodenext` or `preserve`, plus the `esnext` lib or target. Imported modules are typed `AbstractModuleSource`, and WebAssembly source imports yield `WebAssembly.Module`.

## How much faster is TypeScript 7.1? (Microsoft's numbers)

These are from the announcement, using the default 4 checker threads and `--noEmit`:

| Codebase | TS 7.0 | TS 7.1 beta | Speedup | Memory change |
| --- | --- | --- | --- | --- |
| bluesky | 4.48 s | 3.89 s | 1.2x | 2,017 to 1,698 MiB |
| mui-docs | 22.2 s | 11.9 s | 1.9x | 8,093 to 4,079 MiB |
| sentry | 19.6 s | 15.1 s | 1.3x | 6,587 to 5,216 MiB |
| t3code-server | 26.5 s | 19.1 s | 1.4x | 6,894 to 5,197 MiB |
| vscode | 21.6 s | 17.7 s | 1.2x | 8,387 to 6,943 MiB |

![Bar chart of type-check time for TypeScript 7.0 versus the 7.1 beta on five codebases, using Microsoft's numbers: bluesky 4.48 to 3.89 seconds, mui-docs 22.2 to 11.9, sentry 19.6 to 15.1, t3code-server 26.5 to 19.1 and vscode 21.6 to 17.7, with speedups from 1.2x to 1.9x](https://res.cloudinary.com/wasicloudinary/image/upload/v1794197579/fabwaseem/projects/lho6d8pqkvqqgaxg8v9p.jpg)

The gains vary a lot by codebase, so measure your own project instead of assuming 1.9x.

## What can break in TypeScript 7.1?

The announcement lists two behavior changes that can add errors to a build that passes today:

1. **Updated DOM types in `lib.d.ts`.** Regenerated DOM types can affect type checking. The post links the tracking issue (microsoft/TypeScript #63702) and does not list specific changes, so run a full type check and read the diff of errors.
2. **Stricter distributive conditional types.** A type parameter inside a distributed branch is no longer treated as related to the original. The example error reads: "'B' is only assignable to the non-distributed 'A', but 'A' has been distributed here." Fixes usually mean removing an unnecessary constraint or adding a conditional check. See issue #63708.

## Does typescript-eslint support TypeScript 7.1?

The announcement does not mention typescript-eslint. The missing API was the blocker, and it is now in beta, but typescript-eslint has its own integration work. Check [typescript-eslint issue 10940](https://github.com/typescript-eslint/typescript-eslint/issues/10940) for its current state. Until a release says it supports TypeScript 7, keep the side-by-side setup from my guide to the [typescript-eslint does not support TS 7.0 error](https://fabwaseem.com/blog/typescript-eslint-does-not-support-ts-7).

## When will TypeScript 7.1 be stable?

The announcement says a release candidate is expected about a month after the beta, with the final release shortly after. The earlier iteration plan listed different dates, and the beta itself slipped from the plan, so treat any specific date as a target.

## Key takeaways

- Install the beta with `npm install -D typescript@beta`, and test on a branch first.
- The new API is a set of entry points (`typescript/sync`, `typescript/async`, `typescript/fs`, `typescript/ast`), not the old `ts` object.
- Content mappers need `--runExternalCode` and are still early for Vue and Svelte.
- `es2026` is stable, and ambient modules can use import attributes.
- Microsoft reports 1.2x to 1.9x faster checking than 7.0, and your own results will differ.
- Watch for new errors from DOM types and distributive conditional types.

## Questions

### When is TypeScript 7.1 released?

The beta was announced on October 20, 2026. The announcement says a release candidate is expected about a month after the beta, with the final release following shortly after. Treat exact dates as unconfirmed until the TypeScript team publishes them.

### How do I install the TypeScript 7.1 beta?

Run npm install -D typescript@beta. To go back, install typescript@latest, which is still the 7.0 line.

### Does TypeScript 7.1 have a compiler API?

Yes, but not the old monolithic one. It ships focused entry points: typescript/sync for a synchronous client, typescript/async for a Promise-based one, typescript/fs for filesystems, and typescript/ast with is and factory helpers for nodes.

### Will typescript-eslint work with TypeScript 7.1?

The 7.1 announcement does not mention typescript-eslint. The API it needed is now in beta, but check typescript-eslint issue 10940 for its own support status before dropping your TypeScript 6 setup.

### What is new in TypeScript 7.1 for JavaScript targets?

es2026 is a stable --target and --lib value. It adds typings such as Math.sumPrecise, Iterator.concat, JSON.rawJSON, Error.isError and Array.fromAsync. The esnext lib adds Promise.allKeyed and Iterator.zip.

### What can break when upgrading to TypeScript 7.1?

The announcement lists two: updated DOM types in lib.d.ts, and stricter handling of distributive conditional types, which can report an error such as a type being assignable only to the non-distributed form.
