vue-tsc vs TypeScript 7.1 Content Mappers: 2.7x Faster, Stricter by Default
The 60-second version of this test. Subscribe on YouTube
Since TypeScript 7 moved its compiler to Go, Vue projects have been stuck. The native tsc is much faster, but it couldn’t read .vue files, and vue-tsc is built on the old JavaScript compiler API. So a Vue app kept running TypeScript 6 for its type check.
TypeScript 7.1 beta (October 20) adds content mappers: a plugin that gives tsc a virtual TypeScript view of a non-standard file, with source maps back to the original. Vue’s tooling team built one, @vue/content-mapper, and it’s now at 4.0.0-alpha.3 on npm. Plain tsc can type-check Vue templates.
The release posts give the speed numbers. Here is the question I actually have: if I swap vue-tsc for tsc --runExternalCode today, do I still catch the same template bugs, and how much CI time do I get back?
So I built a 1,023-file Vue app with 20 seeded bugs, half of them inside <template>, and ran both checkers on it.
The Setup
- Machine: a 4 vCPU cloud container (Intel Xeon @ 2.10 GHz), Linux, Node 22.23.
- Side A, the classic stack:
[email protected]on[email protected]. - Side B, the native stack:
[email protected]with@vue/[email protected]. - Both:
[email protected], the samesrc/folder and the samecompilerOptions(strict,noEmit,moduleResolution: "bundler",skipLibCheck). - Code: generated by a small script I wrote for this test. It writes 500
<script setup lang="ts">components (props, emits,computed,v-for,v-model, and each one renders the previous component as a child), 500 TypeScript model files, anApp.vue, and 20 bug files. That’s 521.vueand 502.tsfiles. The 1,003 correct files type-check with zero errors on both sides. - Timing: 1 warm-up round, then 5 measured runs per tool, interleaved, from a Python harness using
os.wait4(). I report the median wall-clock time. Memory is the peak total RSS of the whole process tree, sampled every 50 ms, median of 3 runs. (The native stack runs three processes, so a singlemax RSSwould undercount it.)
The two configs, side by side:
// Side A: tsconfig.json for vue-tsc 3.3
{
"compilerOptions": { "strict": true, "noEmit": true, "target": "ES2022", "module": "ESNext",
"moduleResolution": "bundler", "skipLibCheck": true, "jsx": "preserve" },
"vueCompilerOptions": { "strictTemplates": true },
"include": ["src/**/*.ts", "src/**/*.vue"]
}
// Side B: tsconfig.json for tsc 7.1 + the Vue content mapper
{
"compilerOptions": { "strict": true, "noEmit": true, "target": "ES2022", "module": "ESNext",
"moduleResolution": "bundler", "skipLibCheck": true, "jsx": "preserve" },
"contentMappers": [{
"package": "@vue/content-mapper",
"extensions": [".vue"],
"options": { "target": 3.5, "languageFeatures": false }
}],
"include": ["src/**/*.ts", "src/**/*.vue"]
}
npx vue-tsc -p . # side A
npx tsc -p . --runExternalCode # side B
--runExternalCode is required. Without it, tsc refuses to start the mapper, because a content mapper is arbitrary code that TypeScript runs for you. "languageFeatures": false is the PR’s advice for CLI-only checks: it turns off the editor features you don’t need in CI.
Round 1: 20 Seeded Bugs
Each bug file is a tiny component with exactly one mistake. Eight are in <script setup>: a wrong type on a prop, a typo in a property name, a wrong emit payload, an unknown emit name, arithmetic on a ref without .value, an optional prop used without a check, a missing argument, and an assignment to a read-only prop.
Twelve are in <template>, which is the part a plain TypeScript checker never used to see:
<!-- Bug 11: wrong type passed to a child prop (title is a string) -->
<Card0 :items="[]" :title="42" />
<!-- Bug 13: a prop the child doesn't declare -->
<Card0 :items="[]" title="t" :colour="1" />
<!-- Bug 14: handler takes a string, but the child emits a number -->
<Card0 :items="[]" title="t" @select="onSel" /> <!-- function onSel(id: string) -->
<!-- Bug 20: typo in an event name -->
<Card0 :items="[]" title="t" @selcet="() => 1" />
The others: a typo in an interpolated variable, .toUpperCase() on a number, a missing required prop, a typo on a v-for item, an optional value used without v-if, $event passed to a handler that wants a number, label++ on a string, and a bound attribute that points to a variable that doesn’t exist.
| Checker | Script bugs (of 8) | Template bugs (of 12) | Correct files flagged |
|---|---|---|---|
| vue-tsc 3.3.14, default options | 8 | 10 | 0 |
vue-tsc 3.3.14, strictTemplates: true | 8 | 12 | 0 |
| tsc 7.1 beta + content mapper | 8 | 12 | 0 |
The native stack caught all 20, with the same messages, on the same lines and columns, as vue-tsc with strictTemplates. I diffed the output: apart from the order of two optional props (onSelect, onRename) inside three long type names, it’s identical. That makes sense. The mapper is built on @vue/language-core (4.0.0-alpha.3), the library that also builds the virtual TypeScript for vue-tsc (which uses its 3.3 line). The translation of the template is the same idea on both sides. The compiler underneath is what changed.
The interesting row is the first one. With default options, vue-tsc let two bugs through: the unknown prop :colour and the misspelled event @selcet. Both are only checked under strictTemplates. The content mapper has no such switch. The PR removes strictTemplates and the checkUnknown* options, so a lang="ts" template is always checked strictly. That’s stricter by default, and also a migration cost: if your project never enabled strictTemplates, expect new errors on the day you switch.
Round 2: Speed and Memory
Same 1,023 files, 20 errors reported on each run, both tools exit with code 2.
| Checker | Wall time (median of 5) | Range | Peak memory (process tree) |
|---|---|---|---|
| vue-tsc 3.3.14 (TS 6.0.3) | 12.46 s | 11.89 to 13.27 s | 917 MiB |
| tsc 7.1 beta + content mapper | 4.58 s | 4.38 to 4.93 s | 687 MiB |
2.7x faster, with 25% less memory. That’s a real gain, but it’s less than the 4.6x that Alexander Opalic measured on the Directus admin app (14.19 s down to 3.10 s, on an Apple M4 Pro, with vue-tsc running on TypeScript 5.9). My machine has 4 slower cores and my code is synthetic, so treat both numbers as data points, not a promise.
Where does the time go? TypeScript 7 type-checks with 4 checker threads by default. I ran side B again with fewer threads (median of 3 runs):
| tsc 7.1 + content mapper | Wall time |
|---|---|
| default (4 checkers) | 4.54 s |
--checkers 1 | 5.59 s |
--singleThreaded | 6.29 s |
Even with everything on one thread, the native stack took half the time of vue-tsc. So most of the gain comes from the Go compiler itself, and the threads add the rest.
The memory number needs one caveat. Side B is not one process. While it ran, I saw three: the native tsc, a Node process running the Vue mapper (node server.js), and a second tsc --api process that the mapper uses. The 687 MiB is the sum of all three. vue-tsc is a single Node process.
Two Gotchas I Checked
- Alexop’s empty-handler bug is fixed. He reported that on
alpha.0, an empty handler like@contextmenu.stop=""produced a bogusTS1003and stopped type checking. Onalpha.3I put that handler next to a real type error, and the mapper reported only the real error, exactly likevue-tsc. - Your
vueCompilerOptionsblock is gone. Vue options now live undercontentMappers[].options. Per alexop’s write-up, a leftover top-levelvueCompilerOptionsis ignored without a warning. Move it, or delete it.
Where tsc 7.1 + the Content Mapper Wins
- CI time. 4.58 s against 12.46 s on 1,023 files. On a 4-core runner, it’s the bigger win of the two.
- Strict templates by default. It caught the unknown prop and the misspelled event that default
vue-tscmissed. - One TypeScript. No more TypeScript 6 install kept around only for
vue-tsc. Onetscchecks.tsand.vue. - Less memory, even with three processes.
Where vue-tsc Wins
- It’s stable.
vue-tsc3.3 is a release. The mapper is4.0.0-alpha.3, on a TypeScript beta, and the PR is still open. Microsoft’s own post says the RC is planned for later. - The editor. I only tested the command line. Alexop reports that editor support “isn’t ready”, with go-to-definition and template rename regressions. If you use Volar in VS Code, it still needs the classic TypeScript.
- No external code.
vue-tscdoesn’t need--runExternalCode, which some security policies won’t allow in CI. - A gradual strictness switch. If your templates aren’t clean under
strictTemplatesyet,vue-tsclets you turn it on later. The mapper doesn’t.
Decision Table
| Your situation | Pick |
|---|---|
CI type check is slow and your templates pass strictTemplates | tsc 7.1 + content mapper, in CI only |
| Production pipeline with a “no beta tools” rule | vue-tsc 3.3, for now |
| You rely on the editor for template rename and go-to-definition | vue-tsc / Volar, until the editor side ships |
Your project never enabled strictTemplates | vue-tsc, turn it on first, then switch |
| You want to know what TS 7.1 would report on your app | Run both, side by side. It’s two config files. |
The Verdict
tsc 7.1 with the Vue content mapper wins this clash on the command line. It caught all 20 seeded bugs with the same diagnostics as vue-tsc, ran 2.7x faster with 25% less memory, and it’s strict about templates without you asking. That’s what I’d want from a CI type check.
It does not replace vue-tsc everywhere yet. It’s an alpha mapper on a beta compiler, the editor story isn’t there, and it needs --runExternalCode. My plan for a real project: keep vue-tsc in the editor and as the required check, and add the native stack as a second, non-blocking CI job until TypeScript 7.1 and the mapper are stable.
Caveats: the 1,023 files and 20 bugs come from a generator I wrote, so this measures common mistakes on regular code, not a real app’s shape. I didn’t test Nuxt, Pinia stores, or generic components, and I didn’t test the language server. One 4-core machine, five timed runs. Both packages are moving fast, so re-run this before you decide.
Related Articles
More on TypeScript 7 and tested tooling clashes:
- TypeScript 7 Rewrote Its Compiler in Go — And It’s 10x Faster — The Go compiler this article builds on.
- TypeScript 7 in Monorepos: What I Learned Setting Up tsgo with Turborepo, Nx, and pnpm Workspaces — Rolling the native compiler out across many packages.
- Vitest 5 vs Jest 30: Jest Won My Benchmark Until I Changed One Flag — Another clash where one config setting changes the result.
Enjoying the content? Here are tools I personally use and recommend:
- 🌐 Hosting: Bluehost — simple hosting for a WordPress or PHP site
- 🛒 Tech Gear: My Amazon Store — keyboards, monitors, dev tools I use
Purchases through my links help keep this blog ad-free 💙
Enjoyed this post?
Every clash gets a video: two tools, one real task, a measured winner.
▶ Subscribe on YouTube 🎬 All videos