chore: Merge branch 'edison/feat/vaporHydration' into edison/testVapor
ci / test (push) Waiting to run Details
ci / continuous-release (push) Waiting to run Details

This commit is contained in:
daiwei 2025-06-25 14:52:10 +08:00
commit bba71becba
4 changed files with 7 additions and 19 deletions

View File

@ -10,7 +10,7 @@ import {
resetInsertionState, resetInsertionState,
} from './insertionState' } from './insertionState'
import { DYNAMIC_COMPONENT_ANCHOR_LABEL } from '@vue/shared' import { DYNAMIC_COMPONENT_ANCHOR_LABEL } from '@vue/shared'
import { isHydrating, locateHydrationNode } from './dom/hydration' import { isHydrating } from './dom/hydration'
import { DynamicFragment, type VaporFragment } from './fragment' import { DynamicFragment, type VaporFragment } from './fragment'
export function createDynamicComponent( export function createDynamicComponent(
@ -23,11 +23,7 @@ export function createDynamicComponent(
): VaporFragment { ): VaporFragment {
const _insertionParent = insertionParent const _insertionParent = insertionParent
const _insertionAnchor = insertionAnchor const _insertionAnchor = insertionAnchor
if (isHydrating) { if (!isHydrating) resetInsertionState()
locateHydrationNode()
} else {
resetInsertionState()
}
const frag = const frag =
isHydrating || __DEV__ isHydrating || __DEV__

View File

@ -25,7 +25,6 @@ import { currentInstance, isVaporComponent } from './component'
import type { DynamicSlot } from './componentSlots' import type { DynamicSlot } from './componentSlots'
import { renderEffect } from './renderEffect' import { renderEffect } from './renderEffect'
import { VaporVForFlags } from '../../shared/src/vaporFlags' import { VaporVForFlags } from '../../shared/src/vaporFlags'
import { applyTransitionHooks } from './components/Transition'
import { import {
currentHydrationNode, currentHydrationNode,
isHydrating, isHydrating,
@ -38,6 +37,7 @@ import {
insertionParent, insertionParent,
resetInsertionState, resetInsertionState,
} from './insertionState' } from './insertionState'
import { applyTransitionHooks } from './components/Transition'
class ForBlock extends VaporFragment { class ForBlock extends VaporFragment {
scope: EffectScope | undefined scope: EffectScope | undefined

View File

@ -1,6 +1,6 @@
import { IF_ANCHOR_LABEL } from '@vue/shared' import { IF_ANCHOR_LABEL } from '@vue/shared'
import { type Block, type BlockFn, insert } from './block' import { type Block, type BlockFn, insert } from './block'
import { isHydrating, locateHydrationNode } from './dom/hydration' import { isHydrating } from './dom/hydration'
import { import {
insertionAnchor, insertionAnchor,
insertionParent, insertionParent,
@ -17,11 +17,7 @@ export function createIf(
): Block { ): Block {
const _insertionParent = insertionParent const _insertionParent = insertionParent
const _insertionAnchor = insertionAnchor const _insertionAnchor = insertionAnchor
if (isHydrating) { if (!isHydrating) resetInsertionState()
locateHydrationNode(true)
} else {
resetInsertionState()
}
let frag: Block let frag: Block
if (once) { if (once) {

View File

@ -16,7 +16,7 @@ import {
insertionParent, insertionParent,
resetInsertionState, resetInsertionState,
} from './insertionState' } from './insertionState'
import { isHydrating, locateHydrationNode } from './dom/hydration' import { isHydrating } from './dom/hydration'
import { DynamicFragment, type VaporFragment, isFragment } from './fragment' import { DynamicFragment, type VaporFragment, isFragment } from './fragment'
export type RawSlots = Record<string, VaporSlot> & { export type RawSlots = Record<string, VaporSlot> & {
@ -117,11 +117,7 @@ export function createSlot(
): Block { ): Block {
const _insertionParent = insertionParent const _insertionParent = insertionParent
const _insertionAnchor = insertionAnchor const _insertionAnchor = insertionAnchor
if (isHydrating) { if (!isHydrating) resetInsertionState()
locateHydrationNode(true)
} else {
resetInsertionState()
}
const instance = i || (currentInstance as VaporComponentInstance) const instance = i || (currentInstance as VaporComponentInstance)
const rawSlots = instance.rawSlots const rawSlots = instance.rawSlots