import { hmrReload, hmrRerender } from './hmr'
import { isHydrating, locateHydrationNode } from './dom/hydration'
import { insertionAnchor, insertionParent } from './insertionState'
-import type { VaporTeleportImpl } from './components/Teleport'
+import { isVaporTeleport } from './components/Teleport'
export { currentInstance } from '@vue/runtime-dom'
name?: string
vapor?: boolean
-
- __isTeleport?: boolean
}
interface SharedInternalOptions {
}
// teleport
- if (component.__isTeleport) {
- const frag = (component as typeof VaporTeleportImpl).process(
- rawProps!,
- rawSlots!,
- )
+ if (isVaporTeleport(component)) {
+ const frag = component.process(rawProps!, rawSlots!)
if (!isHydrating && _insertionParent) {
insert(frag, _insertionParent, _insertionAnchor)
} else {
},
}
-class TeleportFragment extends VaporFragment {
+export class TeleportFragment extends VaporFragment {
anchor: Node
private targetStart?: Node
}
}
+export function isVaporTeleport(
+ value: unknown,
+): value is typeof VaporTeleportImpl {
+ return value === VaporTeleportImpl
+}
+
/**
* dev only
* during root component HMR reload, since the old component will be unmounted