Skip to content

Commit c1547b5

Browse files
committed
wip: save
1 parent b474ce0 commit c1547b5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Diff for: packages/runtime-vapor/src/components/Teleport.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,20 @@ import { renderEffect } from '../renderEffect'
2525
import { extend, isArray } from '@vue/shared'
2626
import { EffectScope, pauseTracking, resetTracking } from '@vue/reactivity'
2727

28-
export const teleportStack: TeleportFragment[] = []
28+
export const teleportStack: TeleportFragment[] = __DEV__
29+
? ([] as TeleportFragment[])
30+
: (undefined as any)
2931
export const instanceToTeleportMap: WeakMap<
3032
VaporComponentInstance,
3133
TeleportFragment
32-
> = __DEV__ ? new WeakMap() : (null as any)
34+
> = __DEV__ ? new WeakMap() : (undefined as any)
3335

3436
/**
3537
* dev only.
36-
* when the **root** child component updates, synchronously update
38+
* when the root child component updates, synchronously update
3739
* the TeleportFragment's children and nodes.
3840
*/
39-
export function handleTeleportChildrenHmrReload(
41+
export function handleTeleportRootComponentHmrReload(
4042
instance: VaporComponentInstance,
4143
newInstance: VaporComponentInstance,
4244
): void {

Diff for: packages/runtime-vapor/src/hmr.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
mountComponent,
1414
unmountComponent,
1515
} from './component'
16-
import { handleTeleportChildrenHmrReload } from './components/Teleport'
16+
import { handleTeleportRootComponentHmrReload } from './components/Teleport'
1717

1818
export function hmrRerender(instance: VaporComponentInstance): void {
1919
const normalized = normalizeBlock(instance.block)
@@ -55,5 +55,5 @@ export function hmrReload(
5555
)
5656
simpleSetCurrentInstance(prev, instance.parent)
5757
mountComponent(newInstance, parent, anchor)
58-
handleTeleportChildrenHmrReload(instance, newInstance)
58+
handleTeleportRootComponentHmrReload(instance, newInstance)
5959
}

0 commit comments

Comments
 (0)