TypeScript Content Mappers: .vue Files Type-Check Natively
TypeScript 7.1 Beta landed on October 20, 2026, and with the Release Candidate tentatively set for late November, it is worth reading closely. The headline is not the new speed figure. It is a plugin point called content mappers, which teaches TypeScript itself to read .vue and .svelte files instead of leaving every framework to ship a parallel compiler.
The problem: every framework forked the compiler
A .vue file is not a TypeScript file. It holds a template, styles, and a script block, and the compiler has no idea how to separate them. For years the answer was wrapper tooling: vue-tsc leaned on the compiler API, reassembled part of the compiler's behavior from the outside, and fell behind on every TypeScript release because it was chasing a surface it did not own.
Then TypeScript 7.0 shipped a native compiler and dropped the old API. Teams writing plain TypeScript got the full speedup. Teams writing Vue stayed on the old compiler.
What 7.1 changes
The release addresses both halves of that, and the two halves are more connected than they look.
A new API, split into entry points
Instead of one monolithic surface, the API is now organized by job: typescript/sync and typescript/async for program and type-checker work, typescript/fs for layered filesystems, typescript/ast for node types and enums such as SyntaxKind and ScriptTarget, and typescript/ast/factory for creating and immutably updating nodes.
One detail matters more than the shape: API, Program, and Snapshot are all Disposable. You dispose them, and a disposed program cannot be reused.
import { API } from "typescript/sync";
import { ScriptTarget } from "typescript/ast";
using api = API();
using program = api.createProgram(/* rootNames, options */);
for (const d of program.getSemanticDiagnostics()) {
// handle diagnostics
}File watching still has to be wired up separately — changes are passed through fileNotifications on snapshot.update().
Content mappers
A mapper is a plugin registered against a file extension. It produces a virtual representation of the file, with regions that map back to the original. Those regions are what let an error message point at the right line inside the .vue file rather than a line in some intermediate file nobody wrote.
Registration lives in tsconfig.json:
{
"compilerOptions": {
"module": "nodenext",
"target": "es2026"
},
"contentMappers": [
{
"package": "@vue/content-mapper",
"extensions": [".vue"],
"options": { "target": 3.5 }
}
]
}Then:
npm install -D typescript@beta
npx tsc --runExternalCode --noEmitThe flag is blunt on purpose: a mapper is an arbitrary executable that TypeScript dispatches to, so it runs only when you opt in. In VS Code it needs both workspace trust and content mapper permissions, and the js/ts.contentMappers.enabled setting turns it off.
Published numbers, Beta against 7.0: check time on mui-docs fell from 22.2s to 11.9s, with memory down from 8,093 MiB to 4,079 MiB. On a Vue codebase — the Directus admin app, 581 components across 882 TypeScript files — checks fell from 14.19s to 3.10s versus vue-tsc 3, a 4.6× speedup. Other projects saw far less: vscode gained about 1.2×. The win tracks the shape of your code.
Before you move a project
@vue/content-mapperis not on npm yet. What exists today are prototypes for Vue, Svelte, Astro, MDX, Ember, and CSS Modules.- The circulating advice for Vue, Svelte, and Angular codebases: keep TypeScript 6 and 7 installed side by side until your framework tooling ships a 7.1-compatible build.
- 7.1 is stricter about distributive conditional types, and the generated DOM types in
lib.d.tschanged. Expect new errors in code you never touched, and budget time for them. - One open editor issue: saving a config file the mapper watches can leave types stale until the language server restarts.
- This is a Beta. It belongs on a branch, measured against your real codebase — not in production.
Takeaway
The value here is the extension point, not the number. Once understanding .vue is the job of a small plugin inside TypeScript rather than a full parallel compiler, the structural reason framework tooling lagged behind each release disappears. The compiler did not just get faster. It became a platform.
Primary source: Announcing TypeScript 7.1 Beta
Background on the native compiler: TypeScript 7: A Native Compiler, 10× Faster