File tree 8 files changed +569
-605
lines changed
8 files changed +569
-605
lines changed Original file line number Diff line number Diff line change @@ -302,8 +302,8 @@ function processChildrenDynamicInfo(
302
302
const child = filteredChildren [ i ]
303
303
if (
304
304
isStaticChildNode ( child ) ||
305
- // v-if has an anchor, which can be used to distinguish the boundary
306
- child . type === NodeTypes . IF
305
+ // fragment has it's own anchor, which can be used to distinguish the boundary
306
+ isFragmentChild ( child )
307
307
) {
308
308
continue
309
309
}
@@ -359,10 +359,10 @@ function processChildrenDynamicInfo(
359
359
}
360
360
361
361
/**
362
- * Check if a node should be processed as dynamic.
362
+ * Check if a node should be processed as dynamic child .
363
363
* This is primarily used in Vapor mode hydration to wrap dynamic parts
364
364
* with markers (`<!--[[-->` and `<!--]]-->`).
365
- * The purpose is to distinguish the boundaries of nodes during hydration
365
+ * The purpose is to distinguish the boundaries of nodes during vapor hydration
366
366
*
367
367
* 1. two consecutive dynamic nodes should only wrap the second one
368
368
* <element>
@@ -416,3 +416,8 @@ function shouldProcessChildAsDynamic(
416
416
417
417
return false
418
418
}
419
+
420
+ function isFragmentChild ( child : TemplateChildNode ) : boolean {
421
+ const { type } = child
422
+ return type === NodeTypes . IF || type === NodeTypes . FOR
423
+ }
Original file line number Diff line number Diff line change @@ -26,13 +26,13 @@ import {
26
26
includeBooleanAttr ,
27
27
isBooleanAttr ,
28
28
isDynamicAnchor ,
29
- isDynamicFragmentEndAnchor ,
30
29
isKnownHtmlAttr ,
31
30
isKnownSvgAttr ,
32
31
isOn ,
33
32
isRenderableAttrValue ,
34
33
isReservedProp ,
35
34
isString ,
35
+ isVaporFragmentEndAnchor ,
36
36
normalizeClass ,
37
37
normalizeStyle ,
38
38
stringifyStyle ,
@@ -126,7 +126,7 @@ export function createHydrationFunctions(
126
126
// skip if:
127
127
// - dynamic anchors (`<!--[[-->`, `<!--][-->`)
128
128
// - dynamic fragment end anchors (e.g. `<!--if-->`, `<!--for-->`)
129
- if ( n && ( isDynamicAnchor ( n ) || isDynamicFragmentEndAnchor ( n ) ) ) {
129
+ if ( n && ( isDynamicAnchor ( n ) || isVaporFragmentEndAnchor ( n ) ) ) {
130
130
n = next ( n )
131
131
}
132
132
return n
@@ -158,7 +158,7 @@ export function createHydrationFunctions(
158
158
slotScopeIds : string [ ] | null ,
159
159
optimized = false ,
160
160
) : Node | null => {
161
- if ( isDynamicAnchor ( node ) || isDynamicFragmentEndAnchor ( node ) ) {
161
+ if ( isDynamicAnchor ( node ) || isVaporFragmentEndAnchor ( node ) ) {
162
162
node = nextSibling ( node ) !
163
163
}
164
164
optimized = optimized || ! ! vnode . dynamicChildren
You can’t perform that action at this time.
0 commit comments