Vapor mode and the future of Vue
What Vue's Vapor mode compiles templates into, why it skips the virtual DOM, how to opt in, what it gives up, and where Vue 3.6 stands in November 2026.
How Vue reactivity worksRender functions and JSXSSR and hydration in Vue
Vapor mode and the future of Vue
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- Vapor mode is a compilation mode, not a new API: the same `<script setup>` and template compile into code that creates real DOM nodes once and updates them with fine-grained reactive effects, with no virtual DOM tree to build or diff.
- The virtual DOM's cost is creating a fresh tree of objects on each update and walking it to find changes; Vue 3's compiler hints cut that cost but can't remove it, which is the ceiling Vapor removes.
- You opt in per component with `<script setup vapor>` (or `<script vapor>`, or `<template vapor>`); `createVaporApp` builds a Vapor-only app with a smaller runtime, and `vaporInteropPlugin` lets Vapor and virtual DOM components work in one app.
- Vapor supports a subset of Vue: no Options API, `getCurrentInstance()` returns `null`, no `v-memo` or `app.config.globalProperties`, and render-function or JSX components remain virtual DOM components.
- As of November 2026, Vue 3.6 is a release candidate (rc.16, 20 November 2026) with Vapor mode feature-complete, while 3.5.x is still the stable `latest` release.
- Vapor is aimed at performance-sensitive parts of existing apps and small new apps; most apps can ignore it until they hit a rendering bottleneck, because their code doesn't need to change to benefit later.
Where the virtual DOM’s cost comes from
Two earlier lessons set this one up. How Vue reactivity works showed that Vue knows exactly which piece of state each effect depends on. Render functions and JSX showed what templates compile to: a function that returns a tree of virtual nodes.
Put those together and you can see an odd mismatch. The reactivity system knows precisely that count changed. But the update it triggers is coarse: re-run the whole component’s render function, build a fresh virtual tree, and diff it against the previous one to find out, again, what changed. That costs memory for every new virtual node, plus CPU to walk the tree.
Vue has spent years shrinking that cost. Vue 1 skipped the virtual DOM entirely, binding directly to real DOM nodes it found by walking the page. Vue 2 adopted a virtual DOM, partly because it made server rendering practical. Vue 3 kept it but leaned on the compiler: static nodes are hoisted out of the render function, dynamic nodes carry patch flags saying what can change, and blocks let the diff skip static subtrees. Those hints made Vue 3 much faster than Vue 2, but they have a ceiling. Every update still allocates virtual nodes and walks part of a tree. And because hand-written render functions don’t carry hints, the runtime keeps two code paths, optimized and unoptimized, adding complexity and code no app can tree-shake away.
What Vapor compiles to
Vapor mode’s idea is to stop treating the template as a description that must be re-rendered and diffed. Instead, the compiler emits the code you would write by hand if you were wiring the DOM yourself with Vue’s reactivity. Take a simple component:
<script setup vapor>
import { ref } from 'vue'
const count = ref(0)
</script>
<template>
<button @click="count++">Count: {{ count }}</button>
</template>
Conceptually, Vapor compiles the template into something like this:
// Simplified illustration. The real output uses internal helpers
// whose names and details change between releases.
const t0 = template('<button> </button>') // static HTML, parsed once
function render(ctx) {
const button = t0() // clone the real DOM node
const text = button.firstChild // the one part that changes
button.onclick = () => ctx.count++
renderEffect(() => {
text.nodeValue = `Count: ${ctx.count}` // runs only when count changes
})
return button
}
There is no tree to rebuild and nothing to diff. The static structure is cloned from a template once. Each dynamic binding gets its own small reactive effect, so when count changes, exactly one text node is updated. This is the same fine-grained approach Solid and Svelte 5 use, built on the reactivity system Vue already had. The Vue team reports Vapor performing on par with Solid and Svelte 5 in the widely used js-framework-benchmark.
Components get cheaper too. Evan You has described Vapor passing props to child components lazily, as functions read only when the child renders, which makes the dependency graph more precise and creating component instances less costly.
Your source code doesn’t change. The same ref, computed, v-for, and v-model compile to different output. That is the core promise: better performance without a new API to learn.
Opting in
Vapor ships in Vue 3.6 and is entirely opt-in, per component. It supports SFCs using <script setup> and template-only SFCs. Any of these markers works:
<script setup vapor>
// ...
</script>
<!-- shorthand for the above -->
<script vapor>
// ...
</script>
<!-- for a template-only component -->
<template vapor>
<!-- ... -->
</template>
How the app is created decides how much of Vue’s runtime you ship:
// An app made entirely of Vapor components: no virtual DOM runtime at all
import { createVaporApp } from 'vue'
import App from './App.vue'
createVaporApp(App).mount('#app')
// An existing app adding Vapor components alongside normal ones
import { createApp, vaporInteropPlugin } from 'vue'
import App from './App.vue'
createApp(App).use(vaporInteropPlugin).mount('#app')
createVaporApp drops the virtual DOM runtime, which shrinks the baseline bundle a lot. If a Vapor app installs the interop plugin to use virtual DOM components, the virtual DOM runtime comes back and so does its size. With interop, Vapor and virtual DOM components can nest inside each other with standard props, events, and slots. The Vue team still recommends keeping each mode in its own region of the app, such as one page or one widget subtree, rather than alternating modes level by level. They also warn that some virtual DOM component libraries may still have rough edges inside Vapor regions.
What you give up
Vapor supports a deliberate subset of Vue. The release notes list these as unsupported or not applicable:
- The Options API. Vapor requires
<script setup>or a template-only component. app.config.globalProperties.getCurrentInstance(), which returnsnullin Vapor components. Libraries that rely on it need updating.- Per-element
@vue:xxxlifecycle events, andv-memo. - Component template refs don’t expose
$el,$props,$attrs,$slots, or$refs.
A few behaviours also differ. Components written as render functions or JSX stay virtual DOM components, since there is no template for the Vapor compiler to work on. Vapor delegates most events to a single listener on document, so an ancestor calling stopPropagation() can stop a delegated handler from running. Custom directives use a different, function-based signature. Calling slots.default() to inspect a slot’s content actually renders it. None of this matters for typical <script setup> components. It matters if you maintain a component library or rely on instance internals.
Where things stand in November 2026
Vapor has been discussed since 2022 and has moved through a long prerelease cycle:
- July 2025: Vue 3.6.0-alpha.1, the first release containing Vapor mode, marked incomplete and unstable.
- December 2025: 3.6 beta. Vapor reached parity with the stable features of virtual DOM mode, though the team still called it unstable.
- July 2026: 3.6 release candidate. Vapor declared feature-complete.
- 20 November 2026: 3.6.0-rc.16, the latest prerelease at the time of writing. Vue 3.5.x remains the stable
latestversion on npm.
So Vapor isn’t in a stable Vue release yet, though it is close. Even in the RC, the team’s guidance is to use it for performance-sensitive parts of existing apps (a large table, a data visualization, a page with thousands of nodes) or for small new apps built entirely in Vapor, not to convert whole existing codebases. Expect that advice to loosen after 3.6 is stable. Framework support, such as Nuxt adopting Vapor, will follow its own timeline, so check the Vue and Nuxt blogs for current details rather than assuming.
Vapor isn’t the only change in 3.6. The reactivity core has been rewritten around ideas from alien-signals, a signals library by Vue team member Johnson Chu, which cuts memory use and speeds up reactive updates in every Vue app, Vapor or not, with no API changes.
How to think about it
For most applications Vapor changes nothing today. Real-world slowness usually comes from network requests, large images, and third-party scripts long before Vue’s diffing shows up in a profile. Vapor’s design means you don’t have to decide now. The code you write in <script setup> today is the code Vapor compiles tomorrow, so adopting it later is a matter of adding one attribute where a profiler says it pays off. Avoiding the Options API, getCurrentInstance(), and instance internals in new code keeps that door open.
Vapor also changes the trade-off between frameworks. Fine-grained rendering used to be a reason to pick Solid or Svelte over Vue, and a Vue app can now get it one component at a time, without a rewrite.
What the video covers
Alexander Lichter’s video covers the first 3.6 alpha. It starts with the alien-signals reactivity rewrite (about 2:00 to 6:00), then turns to Vapor. He recaps the Vue 1 to Vue 3 rendering history, opens the SFC playground to compare normal and Vapor compiler output side by side (the template cloning and render effects sketched above), and walks through the benchmark numbers with a sensible caution about reading too much into them. He then covers the opt-in, vaporInteropPlugin, the advice against mixed nesting, and the unsupported features. Skip the sponsor segment from 0:07 to 1:40. The video was recorded in July 2025, so when it says SSR hydration, Transition, KeepAlive, and Suspense weren’t supported yet, that describes the alpha. The status section above is current. Evan You’s talk in “go deeper” (Vapor from about 10:13) is the clearest explanation of why Vapor exists, from the person who designed it. CJ Reynolds’ talk explains the virtual DOM versus fine-grained trade-off from first principles, with React comparisons.
Where this fits
This is the last lesson of the Vue roadmap. It draws on how Vue reactivity works for the effect system Vapor compiles down to, and on SSR and hydration in Vue, because hydrating Vapor components on top of server HTML is part of what 3.6 had to solve. If you came from React, compare this with React’s own direction in the React roadmap: React has kept the virtual DOM and added a compiler that memoizes for you, while Vue is moving toward compiling the virtual DOM away.
Check yourself
Vapor mode and Vue's normal mode both use the same reactivity system. So what is actually different?
The compiler output. In normal mode a template compiles to a render function that returns a virtual DOM tree, which is recreated and diffed against the previous tree whenever reactive state the component depends on changes. In Vapor mode the template compiles to code that clones real DOM nodes once and attaches a small reactive effect to each dynamic binding, so a change updates exactly the affected node without building or comparing any tree.
Why couldn't Vue 3 simply optimize its virtual DOM further instead of adding Vapor?
Vue 3 already uses compiler hints such as patch flags, hoisted static nodes, and block trees to skip work during diffing, but every update still creates new virtual nodes and walks part of the tree, which costs memory and CPU. The hints also mean the runtime keeps both an optimized path and a non-optimized path, adding code that can't be tree-shaken. Removing the virtual DOM altogether is the only way past that ceiling.
You want to try Vapor on one slow, data-heavy dashboard page in an existing Vue app. What is the recommended approach?
Install the Vue 3.6 prerelease, register `vaporInteropPlugin` on the existing `createApp` instance, and mark the dashboard page's components with `<script setup vapor>`. Keep the Vapor components together as one region rather than alternating Vapor and virtual DOM components through the tree, and check that any component libraries used inside that region work, since interop with virtual DOM libraries can still have rough edges.
What are three things that work in a normal Vue component but not in a Vapor component?
Any three of: the Options API (Vapor needs `<script setup>` or a template-only SFC); `getCurrentInstance()`, which returns `null`; `app.config.globalProperties`; `v-memo`; per-element `@vue:` lifecycle events; and component template refs exposing `$el`, `$props`, `$attrs`, `$slots`, or `$refs`. Custom directives also use a different function signature.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.