-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
feat(vapor): hydration #13226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: minor
Are you sure you want to change the base?
feat(vapor): hydration #13226
Conversation
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 You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests
Comment |
✅ Deploy Preview for vapor-repl ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@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: |
e704d07
to
58cd7db
Compare
16c91ca
to
287700c
Compare
9b7e68d
to
03bf24c
Compare
03bf24c
to
d8443d3
Compare
0cf3a63
to
86f0746
Compare
…p functions for node handling
86f0746
to
25b8fbe
Compare
b0852aa
to
3e7f093
Compare
e26120f
to
04eadd8
Compare
9f0a509
to
b5762b5
Compare
027b019
to
e9c9e49
Compare
66bca69
to
e4fcb9d
Compare
❌ Deploy Preview for vue-sfc-playground failed. Why did it fail? →
|
a9a643e
to
41d322e
Compare
37cee48
to
df2c42a
Compare
Compiler Changes
child/nthChild/next
calls when asetInsertionState
call is present, ensuring they execute sequentially rather than entirely beforesetInsertionState
(reverting fix(compiler-vapor): movenext
,child
andnthChild
before setInsertionState #13057).setInsertionState
. For append scenarios, the anchor now has two possible values:null
: Indicates that there are no nodes before the dynamic node to be appended.Runtime Changes
Hydration-Aware APIs (
@vue/runtime-vapor
):insertionParent
, which could cause the nodes returned bychild/nthChild/next
to shift, we need to create a backup copy ofinsertionParent.childNodes
when executingsetInsertionState
. Thechild/nthChild/next
operations should then perform lookups on this backed-up childNodes.createIf
,createFor
,createDynamicComponent
, andcreateSlot
are now hydration-aware.DOM Traversal (
@vue/runtime-vapor/dom
):Introduced hydration-specific implementations for DOM traversal helpers (
__child
,__next
,__nthChild
,__txt
). These versions skip over the dynamic node to correctly locate the target nodes for hydration.Added
enableHydrationNodeHelper
anddisableHydrationNodeHelper
to switch between standard and hydration-specific traversal logic.see benchmark for
direct function call
vsdelegated function call
benchmark result
Core Runtime (
@vue/runtime-core
):hydration.ts
to recognize and correctly handle the hydration of Vapor components within VDOM components.VDOM Interop (
@vue/runtime-vapor/vdomInterop.ts
):Tests
runtime-vapor/__tests__/hydration.spec.ts
):v-if
,v-for
).slots
and dynamic components (<component :is="...">
).