-
-
Couldn't load subscription status.
- 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
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 (beta)
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
a9a643e to
41d322e
Compare
37cee48 to
df2c42a
Compare
5657d0b to
f8ef17c
Compare
0d39b58 to
532dbfd
Compare
532dbfd to
be48dc6
Compare
Compiler Changes
child/nthChild/nextcalls when asetInsertionStatecall is present, ensuring they execute sequentially rather than entirely beforesetInsertionState(reverting fix(compiler-vapor): movenext,childandnthChildbefore 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/nextto shift, we need to create a backup copy ofinsertionParent.childNodeswhen executingsetInsertionState. Thechild/nthChild/nextoperations should then perform lookups on this backed-up childNodes.createIf,createFor,createDynamicComponent, andcreateSlotare 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
enableHydrationNodeHelperanddisableHydrationNodeHelperto switch between standard and hydration-specific traversal logic.see benchmark for
direct function callvsdelegated function callbenchmark result
Core Runtime (
@vue/runtime-core):hydration.tsto 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).slotsand dynamic components (<component :is="...">).