Skip to content

fix(runtime-vapor): align DOM prop updates with VDOM - #15343

Merged
edison1105 merged 1 commit into
minorfrom
edison/fix/propUpdate
Aug 25, 2026
Merged

edison1105 merged 1 commit into
minorfrom
edison/fix/propUpdate

Conversation

@edison1105

@edison1105 edison1105 commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Compare DOM prop updates against the previous raw binding value instead of the browser-normalized live property.

This ensures changed bindings are written even when the DOM property already normalizes to the same value, while preserving initial writes and same-binding skips. Add regressions for reflected string and numeric properties.

Summary by CodeRabbit

  • Bug Fixes
    • Improved DOM property updates when browser normalization changes a value.
    • Preserved empty-string attributes where appropriate.
    • Ensured numeric values such as 0 are correctly written to DOM attributes.
    • Updated reflected attributes when a normalized property value becomes explicitly matched.

Compare DOM prop updates against the previous raw binding value instead of
the browser-normalized live property.

This ensures changed bindings are written even when the DOM property already
normalizes to the same value, while preserving initial writes and same-binding
skips. Add regressions for reflected string and numeric properties.
@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ceae7fcc-d744-4f3a-a10b-04d9c50d6b6d

📥 Commits

Reviewing files that changed from the base of the PR and between 64671b5 and 6218d2e.

📒 Files selected for processing (3)
  • packages/runtime-vapor/__tests__/component.spec.ts
  • packages/runtime-vapor/__tests__/dom/prop.spec.ts
  • packages/runtime-vapor/src/dom/prop.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

setDOMProp now compares incoming values with cached bindings and uses live DOM property types for coercion. Tests cover reflected input attributes, empty-string IDs, and restoring numeric attributes after nullish removal.

Changes

DOM property binding

Layer / File(s) Summary
Property setter and validation
packages/runtime-vapor/src/dom/prop.ts, packages/runtime-vapor/__tests__/component.spec.ts, packages/runtime-vapor/__tests__/dom/prop.spec.ts
setDOMProp compares values with the cached binding and derives coercion from the live DOM property. Tests verify reflected input[type] attributes, empty-string id behavior, and restoring width="0" after removal.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 6218d

This localized runtime behavior fix is merge-ready after normal checks and review, with no actionable merge-blocking risk remaining.

Suggested reviewers: lazerg

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: updating runtime-vapor DOM property handling to align with VDOM behavior. It is concise and specific.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch edison/fix/propUpdate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Aug 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@15343
npm i https://pkg.pr.new/@vue/compiler-core@15343
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@15343
npm i https://pkg.pr.new/@vue/compiler-dom@15343
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@15343
npm i https://pkg.pr.new/@vue/compiler-sfc@15343
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@15343
npm i https://pkg.pr.new/@vue/compiler-ssr@15343
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-vapor

pnpm add https://pkg.pr.new/@vue/compiler-vapor@15343
npm i https://pkg.pr.new/@vue/compiler-vapor@15343
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@15343
npm i https://pkg.pr.new/@vue/reactivity@15343
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@15343
npm i https://pkg.pr.new/@vue/runtime-core@15343
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@15343
npm i https://pkg.pr.new/@vue/runtime-dom@15343
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-vapor

pnpm add https://pkg.pr.new/@vue/runtime-vapor@15343
npm i https://pkg.pr.new/@vue/runtime-vapor@15343
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@15343
npm i https://pkg.pr.new/@vue/server-renderer@15343
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@15343
npm i https://pkg.pr.new/@vue/shared@15343
yarn add https://pkg.pr.new/@vue/[email protected]

vue

pnpm add https://pkg.pr.new/vue@15343
npm i https://pkg.pr.new/vue@15343
yarn add https://pkg.pr.new/[email protected]

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@15343
npm i https://pkg.pr.new/@vue/compat@15343
yarn add https://pkg.pr.new/@vue/[email protected]

commit: 6218d2e

@github-actions

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.4 kB 30.6 kB 26.9 kB
runtime-dom.global.prod.js 116 kB 43.6 kB 39 kB
vue.global.prod.js 176 kB 63.7 kB 56.8 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 52.7 kB 20.5 kB 18.7 kB
createApp 61.7 kB 23.8 kB 21.7 kB
createApp + vaporInteropPlugin 118 kB (-1 B) 42.4 kB (-29 B) 38 kB (+16 B)
createVaporApp 30.8 kB (-1 B) 11.9 kB (-2 B) 10.9 kB (+11 B)
createSSRApp 66.9 kB 25.9 kB 23.5 kB
createVaporSSRApp 36.2 kB (-1 B) 13.8 kB 12.6 kB (+2 B)
defineCustomElement 68.4 kB 25.9 kB 23.5 kB
defineVaporCustomElement 46.6 kB (-1 B) 16.9 kB (-2 B) 15.5 kB (+35 B)
overall 77 kB 29.3 kB 26.5 kB

@edison1105 edison1105 added the scope: vapor related to vapor mode label Aug 25, 2026
@edison1105
edison1105 merged commit 84833e2 into minor Aug 25, 2026
14 checks passed
@edison1105
edison1105 deleted the edison/fix/propUpdate branch August 25, 2026 01:39
daopk added a commit to daopk/ropav that referenced this pull request Aug 31, 2026
Every entry in the release is a `runtime-vapor` fix, an hmr or scheduler fix, or a
`runtime-vapor` perf change — nothing breaking since rc.2 made event delegation opt-in. The
exports map is byte-identical to rc.5, so the packaging conclusions still hold.

Three of the fixes reach the markup, and all three move vapor towards vdom rather than away.
Vapor no longer skips the initial DOM prop write, and compares against the previous binding
rather than the live property (vuejs/core#15341, vuejs/core#15343) — so `type`, which reflects,
now lands as `type="text"` exactly as vdom has always written it. And `setValue` writes the
`value` attribute, giving a form reset something to restore from (vuejs/core#15340).

Four tests asserted what those quirks left out, each with a comment explaining the vapor detour.
The behaviour they documented is the one that got fixed, so they now read the attribute instead
of asserting it away, and the comments go with it. The textarea keeps its own assertion through
`expectResetSource`: the attribute vapor writes there is inert markup, and the children are
still the only reset source.

5827 ropav tests and 589 storybook tests green.

Two workarounds were re-measured against the release rather than assumed, and both stay. The
fallthrough `onUpdate:X` regression rc.5 introduced is still here — dropping the explicit
forward from the calendar fixture fails the same two selection tests it failed on rc.5. And the
`<input>` half of `setFormValue` is now duplicated by the runtime: removing its `defaultValue`
write leaves every input and form test green, with only the textarea failing. It earns its place
on the other three counts — a textarea keeps its reset source in its children, `setFormChecked`
has no counterpart upstream at all, and neither does the guarantee that the attribute survives a
key leaving a vapor bag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: vapor related to vapor mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant