-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ 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
b8efc8b
to
d776a26
Compare
remove unnecessary locateHydrationNode for DynamicFragment
Size ReportBundles
Usages
|
0aa27ae
to
cb7779b
Compare
5620aae
to
4141370
Compare
4141370
to
5ee1628
Compare
2153dbb
to
85693f0
Compare
25860bb
to
58b5bcd
Compare
58b5bcd
to
32542fb
Compare
Compiler Changes
@vue/compiler-ssr
): In Vapor components:<!--if-->
- the anchor of if<!--for-->
- the anchor of for<!--slot-->
- the anchor of slot<!--dynamic-component-->
- the anchor of dynamic component<!--[p--><!--p]-->
- wrap prepend block node<!--[a--><!--a]-->
- wrap append block node<!--[i--><!--i]-->
- wrap insertion block nodev-if
andv-for
no longer render the<!--[-->
and<!--]-->
anchor markers because Vapor components do not need them.Runtime Changes
Hydration-Aware APIs (
@vue/runtime-vapor
):createIf
,createFor
,createDynamicComponent
, andcreateSlot
are now hydration-aware. They use the SSR anchors (identified by labels likeIF_ANCHOR_LABEL
,FOR_ANCHOR_LABEL
, etc.) to locate and reuse corresponding DOM nodes rendered by the server.DOM Traversal (
@vue/runtime-vapor/dom
):Introduced hydration-specific implementations for DOM traversal helpers (
__child
,__next
,__nthChild
,__txt
). These versions skip over the block node by insertion anchors to correctly find the target nodes for hydration.Added
enableHydrationNodeLookup
anddisableHydrationNodeLookup
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
):Shared Utilities (
@vue/shared
):domAnchors.ts
defining constants for the various anchor labels (e.g.,IF_ANCHOR_LABEL
,DYNAMIC_START_ANCHOR_LABEL
).Tests
runtime-vapor/__tests__/hydration.spec.ts
):v-if
,v-for
).slots
and dynamic components (<component :is="...">
).NOTE
The following two PR changes have already been included in this PR
next
,child
andnthChild
before setInsertionState #13057