Code Unpacked · Reverse design

Vue Vapor · Architecture and review documents

Source revision 3a3bd842cad433462697f329c3dceaf274b3847d · Base be178f876caad694ebbb1fd0a88a2c7cdabe361e

Purpose

Observed

Review 303 changed files through one source-backed path: SFC opt-in → template AST → Vapor IR → generated DOM program → scoped reactive blocks. Then examine component semantics, two renderer adapters, hydration and shared compatibility changes. Proposed extensions and review priorities are explicitly labeled.

Source evidence

packages/compiler-vapor/src/compile.ts:33–68 · packages/compiler-vapor/src/ir/index.ts:1–110 · packages/runtime-vapor/src/renderEffect.ts:14–70 · packages/runtime-vapor/src/vdomInterop.ts:40–119

Review focus

Where to extend

Proposed

Proposed extension seams: transform/IR/generator/runtime helpers for syntax; getter proxies and normalization for props; app-context adapters for renderer interop.

Source evidence

packages/compiler-vapor/src/compile.ts:76–99 · packages/compiler-vapor/src/generators/operation.ts:30–95 · packages/runtime-vapor/src/componentProps.ts:28–112 · packages/runtime-vapor/src/vdomInterop.ts:292–304

Questions the diagrams answer

Template to DOM program · The compiler/runtime boundary

Where does shared parsing end and the new backend begin?

Diagram source and evidence
flowchart LR
 SFC["SFC client mode"] --> P["compiler-dom parser"]
 P --> T["Vapor transforms"]
 T --> IR["Vapor IR"]
 IR --> G["Vapor generators"]
 G --> JS["DOM program"]
 JS --> RV["runtime-vapor Blocks and effects"]
 RV --> DOM["DOM"]
 RV --> RC["Shared scheduler and instance APIs"]

packages/compiler-vapor/src/compile.ts:33–68 · packages/compiler-sfc/src/compileTemplate.ts:209–273 · packages/compiler-vapor/src/generators/block.ts:36–85 · packages/runtime-vapor/src/renderEffect.ts:14–70

Generated block order · Transform and codegen invariants

Why are DOM navigation references emitted before insertion operations?

Diagram source and evidence
flowchart TD
 F["Instantiate template factories"] --> N["Capture child / next / nthChild references"]
 N --> O["Run creation operations"]
 O --> E["Register renderEffect work"]
 E --> R["Return Block"]

packages/compiler-vapor/src/generators/block.ts:36–85 · packages/compiler-vapor/src/generators/template.ts:41–118 · packages/compiler-vapor/src/generators/operation.ts:98–150

Branch replacement · Branch and list ownership

What survives a branch switch, and what is disposed?

Diagram source and evidence
stateDiagram-v2
 [*] --> Empty
 Empty --> Active: render branch in new scope
 Active --> Active: same key keeps nodes and scope
 Active --> Replacing: different key
 Replacing --> Empty: stop old scope and remove old nodes
 Empty --> Active: create next branch before anchor

packages/runtime-vapor/src/block.ts:12–78 · packages/runtime-vapor/src/apiCreateIf.ts:10–37

Keyed list update · Branch and list ownership

How are reused item blocks updated without rebuilding their DOM?

Diagram source and evidence
flowchart LR
 S["Normalize source"] --> M["Match render keys"]
 M --> U["Update retained item refs"]
 M --> X["Stop and remove missing blocks"]
 U --> L["Stable subsequence when moved"]
 L --> I["Reverse mount or move with next anchor"]

packages/runtime-vapor/src/apiCreateFor.ts:68–143 · packages/runtime-vapor/src/apiCreateFor.ts:206–296 · packages/runtime-vapor/src/apiCreateFor.ts:299–380

Reactive update timing · Effects, scheduler and lifecycle timing

What runs immediately, and what runs after a mutation is queued?

Diagram source and evidence
sequenceDiagram
 participant Setup
 participant RE as renderEffect
 participant FX as ReactiveEffect
 participant Q as Shared scheduler
 participant DOM
 Setup->>RE: register fn
 RE->>FX: create and run
 FX->>DOM: initial operations
 Note over FX: dependency changes later
 FX->>Q: queue job
 Q->>FX: run if dirty
 FX->>DOM: update operations
 Q-->>Setup: post flush hooks

packages/runtime-vapor/src/renderEffect.ts:14–70 · packages/runtime-core/src/scheduler.ts:91–134 · packages/runtime-vapor/__tests__/renderEffect.spec.ts:36–155

Raw props routing · Getter props, attrs and emits boundary

Which values become props, attrs or emit handlers?

Diagram source and evidence
flowchart TD
 R["Raw getters and dynamic sources"] --> P["Declared prop proxy"]
 R --> A["Attr proxy"]
 R --> E["Emit handler resolution"]
 P --> D["Cast and default resolution"]
 A --> F["Filter declared props and emit listeners"]
 F --> DOM["Single-root fallthrough DOM work"]

packages/runtime-vapor/src/componentProps.ts:28–112 · packages/runtime-vapor/src/componentProps.ts:138–242 · packages/runtime-vapor/src/componentProps.ts:245–308 · packages/runtime-vapor/src/componentEmits.ts:1–53 · packages/runtime-vapor/src/component.ts:216–284

Compiler selection · SFC mode and backend dispatch

Which backend does compileTemplate choose for each mode?

Diagram source and evidence
flowchart TD
 O["compileTemplate options"] --> SSR{"ssr?"}
 SSR -->|yes| S["CompilerSSR"]
 SSR -->|no| V{"vapor?"}
 V -->|yes| C["CompilerVapor"]
 V -->|no| D["CompilerDOM"]

packages/compiler-sfc/src/compileTemplate.ts:209–273

VDOM parent to Vapor child · Vapor component in a VDOM tree

How does a VNode update reach the retained Vapor instance?

Diagram source and evidence
sequenceDiagram
 participant R as VDOM renderer
 participant I as Interop adapter
 participant Ref as Shallow props / slots refs
 participant V as Vapor component
 R->>I: mount marked component
 I->>Ref: wrap vnode props and children
 I->>V: create and mount before anchor
 R->>I: update existing vnode
 I->>Ref: replace values
 Ref-->>V: invalidate dependent work

packages/runtime-core/src/renderer.ts:1160–1200 · packages/runtime-vapor/src/vdomInterop.ts:40–119

Vapor parent to VDOM child · VDOM component in a Vapor block

Which renderer owns a VDOM child mounted through a VaporFragment?

Diagram source and evidence
sequenceDiagram
 participant C as Vapor createComponent
 participant A as VDOM adapter fragment
 participant R as VDOM renderer internals
 C->>A: create unmarked child
 A->>R: first insert mounts VNode
 A->>R: later insert moves VNode
 A->>R: remove or scope disposal unmounts
 Note over R: VDOM owns the child render

packages/runtime-vapor/src/component.ts:136–214 · packages/runtime-vapor/src/vdomInterop.ts:145–217

Hydration adoption flow · Hydration cursor and fragment anchors

How does the factory switch from cloning to adopting an existing node?

Diagram source and evidence
flowchart LR
 A["createVaporSSRApp"] --> H["withHydration"]
 H --> L["Locate cursor from insertion state"]
 L --> T["template factory"]
 T --> N["Adopt existing node"]
 N --> C["Advance cursor"]
 C --> B["Mount block without direct reinsertion"]

packages/runtime-vapor/src/apiCreateApp.ts:28–75 · packages/runtime-vapor/src/dom/hydration.ts:19–75 · packages/runtime-vapor/src/dom/hydration.ts:78–129 · packages/runtime-vapor/src/dom/template.ts:7–30 · packages/runtime-vapor/src/block.ts:106–166

C4 architecture

The compiler/runtime boundary

Read detailed explanation (3 sections)

Purpose and review path

Observed

This snapshot adds a parallel client compilation path: shared template parsing feeds a Vapor IR and DOM-oriented code generation. The generated program creates real DOM blocks and registers reactive work with runtime-vapor. Existing VDOM rendering remains a separate path.

Review the IR before individual directives, then cross the generated-helper boundary into the runtime. Finally inspect shared runtime-core/runtime-dom changes for assumptions about renderer-specific fields.

Sources: packages/compiler-vapor/src/compile.ts:33–68 · packages/compiler-vapor/src/ir/index.ts:1–110 · packages/compiler-vapor/src/generators/block.ts:36–85 · packages/runtime-vapor/src/renderEffect.ts:14–70 · packages/runtime-core/src/renderer.ts:1160–1200

The representation is the contract

Observed

Static HTML, dynamic references, operations, effects and return nodes are separate IR concerns. A static template index names a factory; a dynamic node ID names a generated variable. The generated child traversal depends on which IR children are absent from the template. Those identities must remain consistent when a transform wraps, removes or inserts a node.

Sources: packages/compiler-vapor/src/ir/index.ts:1–110 · packages/compiler-vapor/src/ir/index.ts:239–268 · packages/compiler-vapor/src/transforms/transformChildren.ts:60–111 · packages/compiler-vapor/src/generators/template.ts:41–118

Where to extend

Proposed

Proposed feature path: add or override a transform, define typed IR if existing operations cannot express the behavior, dispatch it in genOperation, expose the runtime helper and test its lifetime. An expression-only feature may belong entirely in expression codegen; a new runtime abstraction is unnecessary when the existing Block contract suffices.

Sources: packages/compiler-vapor/src/compile.ts:33–68 · packages/compiler-vapor/src/compile.ts:76–99 · packages/compiler-vapor/src/generators/operation.ts:30–95 · packages/compiler-vapor/src/generators/expression.ts:120–240 · packages/runtime-vapor/src/block.ts:106–166

Compiler design

Transform and codegen invariants

Read detailed explanation (3 sections)

Entry and exit order

Observed

compile combines the base preset with supplied transforms. Entry transforms run in order; exit callbacks run in reverse. Structural transforms create nested blocks and restore the previous template/dynamic/slot state on exit. Review code that mutates context.node with this stack discipline in mind: removal short-circuits later work, while replacement changes what later transforms see.

Sources: packages/compiler-vapor/src/compile.ts:76–99 · packages/compiler-vapor/src/transform.ts:208–267 · packages/compiler-vapor/src/transform.ts:100–166

Creation precedes reactive work

Observed

genBlockContent emits instantiated templates and DOM navigation variables before ordinary operations and effects. genEffects can group multiple IR effects inside one renderEffect wrapper after processing expressions. Constants, v-once and static binding metadata can move an operation out of reactive work. The invariant is preservation of dependencies and creation order, not an effect per directive.

Sources: packages/compiler-vapor/src/generators/block.ts:36–85 · packages/compiler-vapor/src/generators/operation.ts:98–150 · packages/compiler-vapor/src/transform.ts:100–166

Review cases to retain

Proposed

Proposed checks: mixed static/dynamic siblings with a component between them; nested if/for/slot blocks; local aliases shadowing setup names; assignment to refs versus props; a v-once subtree next to reactive text. Pair emitted-code assertions with runtime DOM observations so a plausible snapshot cannot hide an incorrect helper contract.

Sources: packages/compiler-vapor/__tests__/compile.spec.ts:224–265 · packages/compiler-vapor/src/generators/expression.ts:120–240 · packages/compiler-vapor/src/transforms/vIf.ts:28–58 · packages/compiler-vapor/src/transforms/vFor.ts:27–89

State machines

Branch and list ownership

Read detailed explanation (3 sections)

Conditional identity and disposal

Observed

A DynamicFragment keeps an anchor, current key, nodes and an optional scope. Equal keys return without rebuilding. A changed key stops the previous scope, removes its nodes, creates the next scope and inserts new nodes before the anchor. Fallback rendering uses the same ownership area when the selected block is invalid. The stable anchor is the position; the key is the identity; the scope is the lifetime.

Sources: packages/runtime-vapor/src/block.ts:12–78 · packages/runtime-vapor/src/apiCreateIf.ts:10–37

Keyed list reuse

Observed

ForBlock holds DOM nodes, an optional item scope, render key and shallow refs for item/key/index. The runtime distinguishes unkeyed positional reuse from keyed matching. In the unknown keyed region it maps keys to new positions, updates retained blocks, removes missing ones and computes a longest stable subsequence only when movement is detected. Reverse insertion supplies an already-known next anchor.

Sources: packages/runtime-vapor/src/apiCreateFor.ts:68–143 · packages/runtime-vapor/src/apiCreateFor.ts:206–296 · packages/runtime-vapor/src/apiCreateFor.ts:299–380

Optimization proof obligations

Proposed

Compiler flags encode once/static, component item and only-child information. Component items already own scopes; FAST_REMOVE may clear the parent container. A reviewer should verify the flag producer and consumer together and test emptying/refilling, reordering, duplicate identities and removal while an effect is queued. These are proposed checks, not claims that all such cases are covered.

Sources: packages/compiler-vapor/src/transforms/vFor.ts:27–89 · packages/compiler-vapor/src/generators/for.ts:1–236 · packages/shared/src/vaporFlags.ts:1–20 · packages/runtime-vapor/src/apiCreateFor.ts:299–380

Sequence diagrams

Effects, scheduler and lifecycle timing

Read detailed explanation (3 sections)

Observed scheduling

Observed

renderEffect runs immediately to collect dependencies and create initial DOM state. On trigger it queues a dirty-checked job through the shared scheduler, attaching instance UID for ordering/diagnostics. The tests show synchronous initial state and asynchronous mutation visibility after nextTick. The wrapper captures current instance and scope for later runs.

Sources: packages/runtime-vapor/src/renderEffect.ts:14–70 · packages/runtime-core/src/scheduler.ts:91–134 · packages/runtime-vapor/__tests__/renderEffect.spec.ts:36–155 · packages/runtime-vapor/__tests__/renderEffect.spec.ts:221–245

Hook grouping and app mount

Observed

A mounted instance with update hooks uses isUpdating to gate beforeUpdate and queue updated for the cycle; internal noLifecycle work bypasses that wrapper. Component mount invokes beforeMount before insertion, then queues mounted. createVaporApp calls flushOnAppMount after mounting. Teardown stops the instance scope before queued unmounted hooks.

Sources: packages/runtime-vapor/src/renderEffect.ts:14–70 · packages/runtime-vapor/src/component.ts:514–554 · packages/runtime-vapor/src/apiCreateApp.ts:28–75 · packages/runtime-core/src/scheduler.ts:180–233

Ambient state and open checks

Proposed

EffectScope on/off now counts nested activation, and the generic instance helpers support both renderer kinds. Proposed review should cover error exits and nested component/branch work, verifying both active scope and current instance restoration. renderEffect explicitly leaves recurse handling TODO; do not infer recursion parity from use of the shared scheduler.

Sources: packages/reactivity/src/effectScope.ts:95–165 · packages/runtime-core/src/componentCurrentInstance.ts:77–107 · packages/runtime-core/src/componentCurrentInstance.ts:11–22 · packages/runtime-vapor/src/renderEffect.ts:14–70

API contracts

Getter props, attrs and emits boundary

Read detailed explanation (3 sections)

Reconstructed internal contract

Observed

RawProps contains named getter functions and an optional dollar array of dynamic object sources/getter maps. Declared props are lazily read by proxy, with camelized lookup and shared resolvePropValue casting/defaults. Dynamic sources are scanned from last to first for ordinary values. The shapes here are internal compiler/runtime behavior, not a published stable external API guarantee.

Sources: packages/runtime-vapor/src/componentProps.ts:28–112 · packages/runtime-vapor/src/componentProps.ts:245–308 · packages/compiler-vapor/src/generators/component.ts:1–434

Attr and event separation

Observed

Attrs exclude declared props and emit listeners. Class/style have merging behavior across sources, unlike ordinary last-source resolution. Fallthrough can add parent attrs as a dynamic child source and uses distinct DOM caches. The interop attribute test checks that an emit handler does not also fall through to the native VDOM child and fire twice.

Sources: packages/runtime-vapor/src/componentProps.ts:138–242 · packages/runtime-vapor/src/componentProps.ts:310–336 · packages/runtime-vapor/src/component.ts:216–284 · packages/runtime-vapor/src/dom/prop.ts:112–174 · packages/runtime-vapor/__tests__/vdomInterop.spec.ts:1–58

Extension checks

Proposed

Proposed additions should test camel/kebab naming, missing versus undefined values, default factory context, source precedence, class/style removal and emit-listener filtering. Read the normalization helper and proxy together: changing only compiler object generation can violate runtime assumptions about getters and source ordering.

Sources: packages/runtime-vapor/src/componentProps.ts:28–112 · packages/runtime-vapor/src/componentProps.ts:245–308 · packages/runtime-vapor/src/componentProps.ts:310–336 · packages/runtime-vapor/src/componentEmits.ts:1–53

API contracts

Slots, refs and directive lifetimes

Read detailed explanation (3 sections)

Slot resolution and fallback

Observed

RawSlots provides static BlockFn entries and optional dynamic sources. createSlot uses raw-props proxy semantics for slot props, caches a bound function on a resolved slot, and uses DynamicFragment for replacement/fallback. Dynamic slot names or sources install a renderEffect; static selection can run once. Stable identity prevents a slot from being reconstructed for an unchanged selection.

Sources: packages/runtime-vapor/src/componentSlots.ts:62–159 · packages/runtime-vapor/src/block.ts:12–78

Template refs are post-flush resources

Observed

createTemplateRefSetter captures its owner. Dynamic refs unset the prior string/ref, then schedule the new value; v-for values collect in arrays. Scope disposal clears values or removes an item. Function refs are invoked through error handling. The source flags repeated scope-disposal registration for dynamic refs as TODO, so lifetime review is warranted.

Sources: packages/runtime-vapor/src/apiTemplateRef.ts:35–145

Vapor custom directives

Proposed

A custom Vapor directive is a function receiving node, value getter, argument and modifiers; a returned function becomes scope cleanup. Model helpers reuse runtime-dom initialization/update logic and own reactive reads. Proposed extensions should define the cleanup contract explicitly and test it under conditional replacement and list removal.

Sources: packages/runtime-vapor/src/directives/custom.ts:1–35 · packages/runtime-vapor/src/directives/vModel.ts:1–113 · packages/runtime-vapor/src/directives/vShow.ts:1–56

API contracts

DOM helpers and event pathways

Read detailed explanation (3 sections)

Conversions belong at specific layers

Observed

setText expects an already converted string, whereas setElementText converts unknown values. setHtml assigns innerHTML directly; neither that helper nor the generated operation is evidence of a sanitizer. Property setters handle nullish coercion and failures; attribute setters remove nullish values. Review the helper selected by the generator with these preconditions.

Sources: packages/runtime-vapor/src/dom/prop.ts:176–204 · packages/runtime-vapor/src/dom/prop.ts:37–110 · packages/compiler-vapor/src/generators/prop.ts:1–225

Reconcile removed keys and registrations

Observed

Dynamic prop updates merge sources, clear keys missing from the next object and then set current values. Event values use the effect-cleanup listener route. Delegated events instead store node handlers and share a document listener. The delegated handler walks composed-path/ancestor nodes and observes cancelBubble. These mechanisms have distinct cleanup/replacement assumptions.

Sources: packages/runtime-vapor/src/dom/prop.ts:206–261 · packages/runtime-vapor/src/dom/event.ts:4–44 · packages/runtime-vapor/src/dom/event.ts:50–109 · packages/compiler-vapor/src/generators/event.ts:1–193

Known seams to inspect

Proposed

The dynamic setter hardcodes isSVG=false and marks checkbox handling TODO. Proposed review checks should cover specialized versus dynamic setters, dot/caret overrides, SVG, form values, event modifiers and attribute fallthrough. These are focused source-grounded concerns; no broader security or browser-support guarantee is inferred.

Sources: packages/runtime-vapor/src/dom/prop.ts:206–261 · packages/runtime-vapor/src/dom/prop.ts:112–174 · packages/compiler-vapor/src/transforms/vModel.ts:73–163

Sequence diagrams

SFC mode and backend dispatch

Read detailed explanation (2 sections)

Mode propagation

Observed

parse records vapor on the descriptor from script/template attributes; a vapor script is setup. compileScript combines descriptor and option mode and forwards it to inline template compilation. Client JS/TS exports are marked so runtime dispatch recognizes the component. Binding metadata is also recorded for type-declared props before expression generation consumes it.

Sources: packages/compiler-sfc/src/parse.ts:139–211 · packages/compiler-sfc/src/compileScript.ts:866–945 · packages/compiler-sfc/src/compileScript.ts:970–1025 · packages/compiler-sfc/src/script/defineProps.ts:73–100 · packages/runtime-vapor/src/apiDefineComponent.ts:1–21

SSR remains a separate selection

Observed

compileTemplate selects the SSR compiler before considering the Vapor client compiler. Its return helpers are generalized so compileScript can avoid duplicate imports without relying on one AST shape. Inline Vapor output supplies its own return statements. Review TS/JS and inline/non-inline branches together; a marker alone cannot guarantee a matching render program.

Sources: packages/compiler-sfc/src/compileTemplate.ts:209–273 · packages/compiler-sfc/src/compileScript.ts:866–945 · packages/compiler-sfc/src/compileScript.ts:970–1025

Sequence diagrams

Vapor component in a VDOM tree

Read detailed explanation (3 sections)

Dispatch and identity

Observed

The VDOM renderer recognizes __vapor and consults app-context interop. The adapter creates a self-anchor and shallow refs for incoming props/slots, makes the parent current, creates the Vapor instance and mounts it before the anchor. VNode updates preserve instance and anchor while replacing ref values when an update is needed.

Sources: packages/runtime-core/src/renderer.ts:1160–1200 · packages/runtime-vapor/src/vdomInterop.ts:292–304 · packages/runtime-vapor/src/vdomInterop.ts:40–119

Move and unmount

Observed

The adapter moves the block and anchor explicitly, and unmounts through Vapor teardown. Vapor slots in VDOM use a special slot VNode, block storage and props ref. Conditional-slot fallback in that direction carries an explicit TODO. Keep component and slot paths separate when tracing ownership.

Sources: packages/runtime-vapor/src/vdomInterop.ts:40–119 · packages/runtime-vapor/src/block.ts:106–166 · packages/runtime-vapor/src/component.ts:514–554

Review evidence limits

Proposed

The end-to-end page exercises two-way prop/slot changes; the unit file contains seven describe.todo areas and a concrete emit fallthrough test. Proposed further checks should cover conditional slot fallback, root/multi-node movement, removal while updates are queued and missing plugin installation.

Sources: packages/runtime-vapor/__tests__/vdomInterop.spec.ts:1–58 · packages-private/vapor-e2e-test/__tests__/vdomInterop.spec.ts:25–84 · packages/runtime-vapor/src/vdomInterop.ts:40–119

Sequence diagrams

VDOM component in a Vapor block

Read detailed explanation (2 sections)

Delegation to the existing renderer

Observed

createComponent delegates unmarked children when appContext.vapor is installed. createVDOMComponent creates a VNode and a Vapor wrapper whose getters feed shallow reactive VDOM props, filtered attrs and a slot proxy. The wrapper is a compatibility adapter; the VDOM component still renders through VDOM internals.

Sources: packages/runtime-vapor/src/component.ts:136–214 · packages/runtime-vapor/src/vdomInterop.ts:145–217

A fragment is an insertion adapter

Proposed

The returned VaporFragment overrides insert and remove. First insert invokes VDOM mount, subsequent insert uses reorder movement, and scope disposal/removal invokes VDOM unmount. VDOM slots inside Vapor use a separate effect that patches a retained VNode or switches to Vapor fallback nodes. Proposed extensions should verify both native component lifetime and fallback lifetime.

Sources: packages/runtime-vapor/src/vdomInterop.ts:145–217 · packages/runtime-vapor/src/vdomInterop.ts:219–290

State machines

Hydration cursor and fragment anchors

Read detailed explanation (2 sections)

Adopt rather than clone

Observed

The SSR-app entry runs create/mount within withHydration. Factories adopt currentHydrationNode, and direct node insertion is skipped. Initial insertion state points at the first child; later helpers derive the cursor from parent/anchor state. This couples generated static shape to server DOM identity.

Sources: packages/runtime-vapor/src/apiCreateApp.ts:28–75 · packages/runtime-vapor/src/dom/hydration.ts:19–75 · packages/runtime-vapor/src/dom/template.ts:7–30 · packages/runtime-vapor/src/block.ts:106–166

Fragment matching and limitations

Proposed

Cursor location can search backward from a closing fragment comment and cache its opening partner. Adoption skips comments when needed, performs limited dev shape checks and advances to the next node. Mismatches warn, with explicit TODO recovery/diagnostic work. Proposed review should test nested empty fragments, wrong shape, missing nodes and state restoration after errors.

Sources: packages/runtime-vapor/src/dom/hydration.ts:19–75 · packages/runtime-vapor/src/dom/hydration.ts:78–129

Review plan

Review plan, gaps and extension decisions

Read detailed explanation (3 sections)

Suggested passes

Proposed

  1. Establish representation: compiler entry, IR, transforms and block codegen.
  2. Trace runtime lifetime: template factories, blocks, renderEffect, scope and scheduler.
  3. Review component contracts: props/attrs/emits, slots, refs and lifecycle.
  4. Review SFC integration, each interop direction and hydration.
  5. Inspect shared runtime/compiler compatibility, exports, build trimming and test configuration.

This order is proposed to reduce context switching. The complete file inventory stays available so architectural grouping does not erase supporting or omitted files.

Sources: packages/compiler-vapor/src/compile.ts:33–68 · packages/runtime-vapor/src/block.ts:12–78 · packages/runtime-vapor/src/renderEffect.ts:14–70 · packages/runtime-vapor/src/componentProps.ts:28–112 · packages/runtime-vapor/src/vdomInterop.ts:40–119 · packages/runtime-vapor/src/vdomInterop.ts:145–217 · rollup.config.js:1–416

What evidence does and does not show

Observed

Generated snapshots support code shape; runtime tests cover selected helper scenarios; e2e tests cover a concrete browser flow. They do not establish exhaustive parity. No Vue suite or benchmark was executed to produce this bundle. Static extraction also leaves dynamic/external calls unresolved. The captured source and source-range citations remain the authority for the explanations.

Sources: packages/compiler-vapor/__tests__/compile.spec.ts:224–265 · packages/runtime-vapor/__tests__/renderEffect.spec.ts:36–155 · packages/runtime-vapor/__tests__/vdomInterop.spec.ts:1–58 · packages-private/vapor-e2e-test/__tests__/vdomInterop.spec.ts:25–84

Proposed extension checklist

Proposed

For a new directive: transform/IR semantics → generated helper usage → runtime timing/cleanup → SFC metadata when relevant. For a new interop case: both component directions, both slot directions, anchors, native props/attrs/emits, movement and teardown. For a performance change: retain semantic tests and use the private benchmark infrastructure to measure a defined scenario; do not turn its existence into a speed claim.

Sources: packages/compiler-vapor/src/compile.ts:76–99 · packages/compiler-vapor/src/generators/operation.ts:30–95 · packages/runtime-vapor/src/directives/custom.ts:1–35 · packages/runtime-vapor/src/vdomInterop.ts:40–119 · packages/runtime-vapor/src/vdomInterop.ts:145–217 · rollup.config.js:1–416

Open questions

Document selection and applicability (2 considered)
Document familyStatusReason and evidence
Deploymentnot-applicableThis is a compiler/runtime library integration; build packaging is discussed, but no production service topology is inferred.
ERD / data modelnot-applicableThe relevant entities are in-memory IR and DOM block contracts; there is no persistence schema to reconstruct.
Source coverage limitations
  • pnpm-lock.yaml: Lockfile metadata only
  • Import context limited to 48 files; 72 omitted