Skip to content

Commit 4e20de0

Browse files
committed
wip: save
1 parent 7eddeaa commit 4e20de0

File tree

4 files changed

+20
-47
lines changed

4 files changed

+20
-47
lines changed

packages/runtime-core/src/apiCreateApp.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ export interface VaporInteropInterface {
183183
anchor: any,
184184
parentComponent: ComponentInternalInstance | null,
185185
parentSuspense: SuspenseBoundary | null,
186-
isSingleRoot?: boolean,
187186
): GenericComponentInstance // VaporComponentInstance
188187
update(n1: VNode, n2: VNode, shouldUpdate: boolean): void
189188
unmount(vnode: VNode, doRemove?: boolean): void

packages/runtime-core/src/renderer.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,24 +2387,6 @@ function baseCreateRenderer(
23872387
instance.isUnmounted = true
23882388
}, parentSuspense)
23892389

2390-
// A component with async dep inside a pending suspense is unmounted before
2391-
// its async dep resolves. This should remove the dep from the suspense, and
2392-
// cause the suspense to resolve immediately if that was the last dep.
2393-
if (
2394-
__FEATURE_SUSPENSE__ &&
2395-
parentSuspense &&
2396-
parentSuspense.pendingBranch &&
2397-
!parentSuspense.isUnmounted &&
2398-
instance.asyncDep &&
2399-
!instance.asyncResolved &&
2400-
instance.suspenseId === parentSuspense.pendingId
2401-
) {
2402-
parentSuspense.deps--
2403-
if (parentSuspense.deps === 0) {
2404-
parentSuspense.resolve()
2405-
}
2406-
}
2407-
24082390
if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
24092391
devtoolsComponentRemoved(instance)
24102392
}
@@ -2426,7 +2408,7 @@ function baseCreateRenderer(
24262408
const getNextHostNode: NextFn = vnode => {
24272409
if (vnode.shapeFlag & ShapeFlags.COMPONENT) {
24282410
if ((vnode.type as ConcreteComponent).__vapor) {
2429-
return hostNextSibling((vnode.component! as any).block)
2411+
return hostNextSibling(vnode.anchor!)
24302412
}
24312413
return getNextHostNode(vnode.component!.subTree)
24322414
}

packages/runtime-vapor/src/component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,8 @@ export function handleSetupResult(
532532
setupResult: any,
533533
component: VaporComponent,
534534
instance: VaporComponentInstance,
535-
isSingleRoot: boolean | undefined,
536-
setupFn: VaporSetupFn | undefined,
535+
isSingleRoot?: boolean,
536+
setupFn?: VaporSetupFn,
537537
): void {
538538
if (__DEV__) {
539539
pushWarningContext(instance)

packages/runtime-vapor/src/vdomInterop.ts

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,7 @@ const vaporInteropImpl: Omit<
4040
VaporInteropInterface,
4141
'vdomMount' | 'vdomUnmount' | 'vdomSlot'
4242
> = {
43-
mount(
44-
vnode,
45-
container,
46-
anchor,
47-
parentComponent,
48-
parentSuspense,
49-
isSingleRoot,
50-
) {
43+
mount(vnode, container, anchor, parentComponent, parentSuspense) {
5144
const selfAnchor = (vnode.el = vnode.anchor = createTextNode())
5245
container.insertBefore(selfAnchor, anchor)
5346
const prev = currentInstance
@@ -66,28 +59,27 @@ const vaporInteropImpl: Omit<
6659
{
6760
_: slotsRef, // pass the slots ref
6861
} as any as RawSlots,
69-
isSingleRoot,
62+
undefined,
7063
undefined,
7164
parentSuspense,
7265
))
7366
instance.rawPropsRef = propsRef
7467
instance.rawSlotsRef = slotsRef
75-
if (__FEATURE_SUSPENSE__ && instance.asyncDep) {
76-
parentSuspense &&
77-
parentSuspense.registerDep(
78-
instance as any,
79-
setupResult => {
80-
handleSetupResult(
81-
setupResult,
82-
component,
83-
instance,
84-
isSingleRoot,
85-
isFunction(component) ? component : component.setup,
86-
)
87-
mountComponent(instance, container, selfAnchor)
88-
},
89-
false,
90-
)
68+
if (__FEATURE_SUSPENSE__ && parentSuspense && instance.asyncDep) {
69+
parentSuspense.registerDep(
70+
instance as any,
71+
(setupResult: any) => {
72+
handleSetupResult(
73+
setupResult,
74+
component,
75+
instance,
76+
undefined,
77+
isFunction(component) ? component : component.setup,
78+
)
79+
mountComponent(instance, container, selfAnchor)
80+
},
81+
false,
82+
)
9183
} else {
9284
mountComponent(instance, container, selfAnchor)
9385
}

0 commit comments

Comments
 (0)