Vue Composition API and Vapor Mode — Stable vs Prerelease Guide

Practical Vue 3 Composition API, TypeScript, Pinia and Nuxt workflows, with a clearly separated Vue 3.6 RC Vapor section and official release references.

TL;DR. This guide covers stable Vue 3 Composition API workflows and a separate Vue 3.6 release-candidate Vapor section. On 2026-10-03 official releases list 3.5.43 as stable and 3.6.0-rc.10 as prerelease. These sources do not establish a newer stable major release. Check the version and compiler used in your own project before trying prerelease features.

Stable Vue 3 and the Vue 3.6 Prerelease

The Composition API and script-setup macros are part of Vue 3. Vapor belongs to the Vue 3.6 prerelease work; these features should not be presented as a released Vue 3 migration. Here is what to check:

  • Vapor Mode is opt-in in the Vue 3.6 prerelease. The compiler path uses direct DOM updates and supports a subset of Vue APIs. Check the official RC notes and matching toolchain; feature-complete does not mean a stable release.
  • Type declarations remain project-specific. Use the documented component and script-setup APIs, and type-check the actual props, emits and slots.
  • The Options API still exists. It is not deprecated. Smaller teams and Vue 2 migration paths continue to use it.
  • <Suspense> remains experimental in the official documentation. It handles loading for async dependencies; errors need a parent capture hook. See the official reference.
  • Reactivity uses tracked dependencies. Distinguish stable behavior from prerelease changes and measure recomputation in your own application.
  • Bundle size depends on actual output and dependencies. No before/after bundle measurement was run for this guide.

For an existing Vue 3 app, review the release notes for your exact target version and keep stable and prerelease upgrades separate. Test dependencies before enabling Vapor; no Vue 3-to-4 codemod migration is assumed.


Vapor Mode in Depth

Vapor Mode is a separate prerelease compiler path in Vue 3.6. Understanding when to use it matters more than using it everywhere.

How it works: The @vue/compiler-vapor compiles your template into a series of direct DOM calls. Instead of h('div', { class: 'foo' }, [...children]) producing a vnode tree that then gets diffed, you get:

const div = document.createElement('div')
div.className = 'foo'
// reactive bindings are set up as fine-grained effects

When Vapor helps:

  • High-frequency update components: real-time dashboards, collaborative editors, animation-driven UI
  • Lists with many items that update independently
  • Components where you have profiled and confirmed vdom diffing is the bottleneck

When Vapor is overkill:

  • Static content
  • Forms and settings pages that update on user interaction, not on timers or streams
  • Components you haven't profiled yet

Practical rule: keep a stable baseline and profile the actual update cost. Only evaluate Vapor with a compatible Vue 3.6 prerelease toolchain and supported APIs. The following snippet illustrates that prerelease syntax:

<script vapor setup>
import { ref } from 'vue'
const count = ref(0)
</script>

<template>
  <button @click="count++">{{ count }}</button>
</template>

Check interoperability and unsupported APIs against the RC notes before mixing compilation modes.


Composition API Patterns That Scale

The Composition API is available in Vue 3. These are the patterns that hold up past toy-app scale:

Composables as the unit of reuse: These are illustrative fragments. The User type, api client, imports and failure handling belong to the application; the snippets are not complete production modules.

// useUserSession.ts
export function useUserSession() {
  const user = ref<User | null>(null)
  const loading = ref(false)

  async function fetchUser(id: string) {
    loading.value = true
    user.value = await api.getUser(id)
    loading.value = false
  }

  return { user, loading, fetchUser }
}

Call this in any component. No Pinia store required for local-ish state. Reserve stores for truly shared, cross-route state.

defineModel for two-way bindings:

Vue 3 supports defineModel(); check your project version against the official script-setup reference. Stop writing modelValue prop + update:modelValue emit pairs by hand:

<script setup lang="ts">
const model = defineModel<string>()
</script>
<template>
  <input v-model="model" />
</template>

Async composables with <Suspense>:

export async function useRemoteConfig() {
  const config = await fetch('/api/config').then(r => r.json())
  return { config }
}

An async setup component can use an experimental <Suspense> boundary with a #fallback slot. Preserve error handling and a stable alternative; an arbitrary async helper alone does not automatically become a Suspense dependency.


TypeScript Integration

Vue 3 supports typed script-setup macros. See the official API reference for version requirements. Key patterns:

  • defineProps accepts runtime declarations or type declarations; review what runtime checks the compiler can infer rather than assuming every TypeScript type becomes runtime validation.
  • defineEmits with typed payloads is inferred from the generic, not from a separate runtime validator.
  • Slot typing via defineSlots — you can express what props each slot expects.
  • Generic components are supported with <script generic="T">.

Example of a typed generic list:

<script setup lang="ts" generic="T extends { id: string }">
defineProps<{ items: T[] }>()
defineSlots<{ default: (props: { item: T }) => void }>()
</script>

The toolchain side: vue-tsc is the type checker for .vue files. Run it in CI:

pnpm vue-tsc --noEmit

Use the current Vue language tooling and a vue-tsc version compatible with the project. Stable editor support must not be assumed for every prerelease API.


Ecosystem: Nuxt 4, Vite, and State

Nuxt is an option for Vue server rendering and file-based routing. Check the version-specific official documentation and deployment preset. Common features include:

  • File-based routing from page components
  • useAsyncData and useFetch composables that deduplicate server/client fetches
  • Layers system for monorepo and module composition
  • Built-in Nitro server that deploys to Vercel, Cloudflare Workers, Node, and more

Vite is commonly used with Vue. Use the version and plugin selected by your project scaffold; check a matching prerelease setup separately for Vapor. No percentage of projects or universal zero-configuration claim was measured.

State management:

Need Tool
Local component state ref, reactive
Shared cross-route state Pinia
Server cache / async data Nuxt's useAsyncData or TanStack Query for Vue
URL-derived state useRoute + useRouter

Pinia is the official store. Vuex is legacy — do not start new projects on it.


Vue, React and Svelte: Structural Comparison

Dimension Vue React Svelte
Component syntax Templates or render functions JSX or createElement Compiled component templates
State patterns used here ref / reactive Hooks Runes
Full-stack option Nuxt Next.js / React Router SvelteKit

This overview is not a performance, hiring, TypeScript-quality or bundle-size benchmark. Vapor requires the version-specific prerelease checks above.

Evaluate template familiarity, required libraries and server-rendering needs with your team. Compare production output and dependency compatibility on the actual project; this guide establishes no framework winner.

For AI-assisted development workflows — where you're using tools like Cursor or Claude Code to scaffold components — test whether the assistant produces correct templates, types and state behavior for your actual component requirements. See How to Use Cursor 2026 for specific prompting patterns that work well with Vue component generation.


Building a Vue 3 Project: Step by Step

# Scaffold
pnpm create vue@latest my-app
# Select: TypeScript ✓, Vue Router ✓, Pinia ✓, Vitest ✓, ESLint ✓

cd my-app
pnpm install
pnpm dev

File structure decisions:

  • src/composables/ — all useX functions
  • src/stores/ — Pinia stores
  • src/components/ui/ — dumb, reusable components
  • src/views/ — page-level components tied to routes

Type check + test before every commit:

pnpm vue-tsc --noEmit
pnpm vitest run
pnpm build

For SSR, replace create vue with pnpm create nuxt@latest and follow the Nuxt 4 setup wizard.

When you need AI help generating components or writing composables, well-structured prompts make a significant difference. The AI Prompts for Coders 2026 guide covers prompt patterns that produce usable Vue code rather than generic examples.


Market Position and Career Outlook

Project contexts to evaluate include:

  • Teams that already maintain Vue applications
  • Client portals and dashboards
  • Existing full-stack integrations with a Vue frontend
  • SSR applications using Nuxt

This guide includes no regional hiring survey, wage data or demand forecast. Review current opportunities and the stack used by the teams you want to join.

A practical Vue workflow to demonstrate includes: Composition API fluency, Pinia, Nuxt 4, Vitest, and the ability to profile update cost. Prerelease Vapor evaluation is optional; Options API knowledge can support existing codebases.

For developers building AI-integrated fullstack apps on Vue — connecting to LLMs, agent backends, or streaming APIs — the patterns are similar across frameworks. The AI for Fullstack Devs 2026 guide covers backend integration patterns that apply directly to Vue + Nuxt stacks.


Next Steps

  1. Scaffold a Vue 3 project with the create vue CLI and enable TypeScript from the start — retrofitting types is painful.
  2. Read the official release notes for your exact current and target Vue 3 versions before modifying an existing codebase. No Vue 3 migration guide is assumed.
  3. Profile before Vapor. If evaluating the Vue 3.6 prerelease, use a compatible toolchain, check supported APIs and compare before/after behavior against a stable baseline.
  4. Learn Nuxt 4 if you need SSR or file-based routing — it is the production path for anything beyond a pure SPA.
  5. Set up vue-tsc in CI on day one. Type errors caught in CI are free; type errors found in production are not.

All guides

Related guides