Question presented to candidate: "You will hear people say 'Vue 3.5 has Vapor mode'. What is Vapor mode, is that version claim right, and how does rendering in Vapor differ from Vue's usual virtual DOM?"
What a strong answer should cover:
- Vapor is an opt-in compilation mode for SFCs (
<script setup vapor>): the compiler emits code that creates DOM from a template once and updates specific nodes inside reactive effects. No VNodes, no diff. - Version accuracy: Vapor is not in any stable release. Vue 3.5 is the current stable line; Vapor ships in the 3.6 release candidates (3.6.0-rc.12 at the time of writing).
- Same reactivity system and same template syntax; what changes is the compiled output and the runtime it calls.
- Virtual DOM recap: render produces a VNode tree, the renderer diffs it against the previous one, helped by patch flags and blocks.
- How to use it:
createVaporAppfor an all-Vapor app, orvaporInteropPluginto mix Vapor and VDOM components. - Limits:
<script setup>and template-only SFCs only (no Options API),getCurrentInstance()returns null,v-memois ignored.
Clarifying questions expected:
- "Do you mean the concept, or whether we can use it in production today?"
Code / implementation expected: Optional β a <script setup vapor> component, and ideally a description of its compiled output.