Repository navigation
fix(runtime-vapor): track reactive object style keys during hydration - #15663
Merged
edison1105 merged 4 commits intoSep 29, 2026
Merged
edison1105 merged 4 commits into
edison1105 merged 4 commits into
Conversation
Port the vuejs#11372 fix to Vapor. setStyle skips the patch during hydration, so in production builds the keys of a reactive style object were never read and mutating one did not update the DOM.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Size ReportBundles
Usages
|
meta-syntax
added a commit
to meta-syntax/website
that referenced
this pull request
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the fix of #11372 to Vapor.
In a production build, when a component hydrates
<div :style="data.sty">anddata.styis a reactive object, mutating a key (data.sty.color = 'green') does not update the DOM.normalizeStylereturns an object style as is, and the keys are read bypatchStyle. During hydrationsetStyleskips the patch, so no key is read inside the render effect and the keys are not tracked. In a dev build the mismatch check reads them, which hides the bug.This PR reads the keys of a reactive style object at the top of
setStyleduring hydration, asruntime-core/src/hydration.tsdoes for VDOM. It is placed before theel.$rootbranch because both the template root (setStyleIncremental) and other elements skip the patch.Reproduction
<div :style="data.sty"></div>withdata.sty = reactive({ color: 'red' })createVaporSSRAppin a production build (__DEV__ = false)data.sty.color = 'green'nextTick, the DOM is still<div style="color:red;"></div>It updates as expected in a dev build, without hydration, when the whole object is replaced, and in the VDOM runtime.
The added test covers both the template root and a nested element, and fails without the fix.