Skip to content

fix(runtime-vapor): apply the initial v-model value before mounted hooks - #16545

Merged
edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-model-value-before-mounted
Dec 3, 2026
Merged

edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-model-value-before-mounted

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

In Vapor mode, a component's onMounted runs before v-model has set its fields: inputs and textareas are empty, a select shows its first option, checkboxes and radios are unchecked. That breaks anything that reads the field on mount, e.g. an auto-growing textarea that sizes itself from scrollHeight in onMounted (privy design-system). Here's a playground.

The initial value was applied from an onMounted hook that v-model registered while the template ran, i.e. after the component's own hooks. I now queue it as a post-render job when the directive is applied, so it runs before the mounted hooks, like VDOM directive hooks do.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c837ecfc-a364-4fcd-a49f-9489b761a983

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@pkg-pr-new

pkg-pr-new Bot commented Dec 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@16545
npm i https://pkg.pr.new/@vue/compiler-core@16545
yarn add https://pkg.pr.new/@vue/compiler-core@16545.tgz

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@16545
npm i https://pkg.pr.new/@vue/compiler-dom@16545
yarn add https://pkg.pr.new/@vue/compiler-dom@16545.tgz

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@16545
npm i https://pkg.pr.new/@vue/compiler-sfc@16545
yarn add https://pkg.pr.new/@vue/compiler-sfc@16545.tgz

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@16545
npm i https://pkg.pr.new/@vue/compiler-ssr@16545
yarn add https://pkg.pr.new/@vue/compiler-ssr@16545.tgz

@vue/compiler-vapor

pnpm add https://pkg.pr.new/@vue/compiler-vapor@16545
npm i https://pkg.pr.new/@vue/compiler-vapor@16545
yarn add https://pkg.pr.new/@vue/compiler-vapor@16545.tgz

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@16545
npm i https://pkg.pr.new/@vue/reactivity@16545
yarn add https://pkg.pr.new/@vue/reactivity@16545.tgz

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@16545
npm i https://pkg.pr.new/@vue/runtime-core@16545
yarn add https://pkg.pr.new/@vue/runtime-core@16545.tgz

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@16545
npm i https://pkg.pr.new/@vue/runtime-dom@16545
yarn add https://pkg.pr.new/@vue/runtime-dom@16545.tgz

@vue/runtime-vapor

pnpm add https://pkg.pr.new/@vue/runtime-vapor@16545
npm i https://pkg.pr.new/@vue/runtime-vapor@16545
yarn add https://pkg.pr.new/@vue/runtime-vapor@16545.tgz

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@16545
npm i https://pkg.pr.new/@vue/server-renderer@16545
yarn add https://pkg.pr.new/@vue/server-renderer@16545.tgz

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@16545
npm i https://pkg.pr.new/@vue/shared@16545
yarn add https://pkg.pr.new/@vue/shared@16545.tgz

vue

pnpm add https://pkg.pr.new/vue@16545
npm i https://pkg.pr.new/vue@16545
yarn add https://pkg.pr.new/vue@16545.tgz

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@16545
npm i https://pkg.pr.new/@vue/compat@16545
yarn add https://pkg.pr.new/@vue/compat@16545.tgz

commit: 5630661

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.5 kB 30.7 kB 27 kB
runtime-dom.global.prod.js 127 kB 47.4 kB 42.4 kB
vue.global.prod.js 187 kB 67.7 kB 60.2 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 55.9 kB 21.7 kB 19.8 kB
createApp 65.5 kB 25.2 kB 22.9 kB
createApp + vaporInteropPlugin 127 kB 46.6 kB 41.8 kB
createVaporApp 37.2 kB 14.2 kB 13.1 kB
createSSRApp 70.4 kB 27.2 kB 24.7 kB
createVaporSSRApp 46 kB 17.5 kB 16.1 kB
defineCustomElement 72.1 kB 27.2 kB 24.7 kB
defineVaporCustomElement 52.3 kB 19.1 kB 17.5 kB
overall 82.7 kB 31.3 kB 28.3 kB

Apps

Name Size Gzip Brotli
counter app (CAPI only) 57.5 kB 22.3 kB 20.4 kB
counter vapor app (CAPI only) 47.5 kB 17.7 kB 16.2 kB
todo app (CAPI only) 73.9 kB 28.4 kB 25.8 kB
todo vapor app (CAPI only) 80.9 kB (+43 B) 29.9 kB (+42 B) 27.2 kB (+49 B)

@edison1105 edison1105 added the scope: vapor related to vapor mode label Dec 3, 2026
@edison1105
edison1105 merged commit 670bfe0 into vuejs:minor Dec 3, 2026
11 checks passed
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.

2 participants