+import { IF_ANCHOR_LABEL } from '@vue/shared'
import { type Block, type BlockFn, DynamicFragment, insert } from './block'
- import { isHydrating } from './dom/hydration'
+ import { isHydrating, locateHydrationNode } from './dom/hydration'
import {
insertionAnchor,
insertionParent,
): Block {
const _insertionParent = insertionParent
const _insertionAnchor = insertionAnchor
- if (!isHydrating) resetInsertionState()
+ if (isHydrating) {
- locateHydrationNode()
++ locateHydrationNode(true)
+ } else {
+ resetInsertionState()
+ }
let frag: Block
if (once) {
} else {
// fragment
if (block.insert) {
- // TODO handle hydration for vdom interop
-- block.insert(parent, anchor)
++ block.insert(parent, anchor, (block as TransitionBlock).$transition)
} else {
- insert(block.nodes, parent, anchor)
+ insert(block.nodes, parent, anchor, parentSuspense)
}
if (block.anchor) insert(block.anchor, parent, anchor)
}
): Block {
const _insertionParent = insertionParent
const _insertionAnchor = insertionAnchor
- if (!isHydrating) resetInsertionState()
+ if (isHydrating) {
- locateHydrationNode()
++ locateHydrationNode(true)
+ } else {
+ resetInsertionState()
+ }
- const instance = currentInstance as VaporComponentInstance
+ const instance = i || (currentInstance as VaporComponentInstance)
const rawSlots = instance.rawSlots
const slotProps = rawProps
? new Proxy(rawProps, rawPropsProxyHandlers)
internals.umt(vnode.component!, null, !!parentNode)
}
- frag.insert = (parentNode, anchor) => {
- if (!isMounted) {
- internals.mt(
- vnode,
- parentNode,
- anchor,
- parentInstance as any,
- null,
- undefined,
- false,
- )
+ vnode.scopeId = parentInstance.type.__scopeId!
+
- frag.insert = (parentNode, anchor) => {
++ frag.insert = (parentNode, anchor, transition) => {
+ const prev = currentInstance
+ simpleSetCurrentInstance(parentInstance)
+ if (!isMounted || isHydrating) {
++ if (transition) setVNodeTransitionHooks(vnode, transition)
++
+ if (isHydrating) {
+ ;(
+ vdomHydrateNode ||
+ (vdomHydrateNode = ensureHydrationRenderer().hydrateNode!)
+ )(
+ currentHydrationNode!,
+ vnode,
+ parentInstance as any,
+ null,
+ null,
+ false,
+ )
+ } else {
+ internals.mt(
+ vnode,
+ parentNode,
+ anchor,
+ parentInstance as any,
+ null,
+ undefined,
+ false,
+ )
+ }
onScopeDispose(unmount, true)
isMounted = true
} else {
parentInstance as any,
)
}
- simpleSetCurrentInstance(prev)
-
+
- frag.nodes = vnode.el as Block
+ // update the fragment nodes
++ frag.nodes = [vnode.el as Node]
++ simpleSetCurrentInstance(prev)
}
frag.remove = unmount