mirror of https://github.com/vuejs/core.git
fix(runtime-core): ensure suspense creates dep component's render effect with correct optimized flag (#7689)
close #7688
This commit is contained in:
parent
c73847f2be
commit
c521f956e1
|
@ -438,6 +438,7 @@ export interface SuspenseBoundary {
|
||||||
registerDep(
|
registerDep(
|
||||||
instance: ComponentInternalInstance,
|
instance: ComponentInternalInstance,
|
||||||
setupRenderEffect: SetupRenderEffectFn,
|
setupRenderEffect: SetupRenderEffectFn,
|
||||||
|
optimized: boolean,
|
||||||
): void
|
): void
|
||||||
unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void
|
unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void
|
||||||
}
|
}
|
||||||
|
@ -679,7 +680,7 @@ function createSuspenseBoundary(
|
||||||
return suspense.activeBranch && next(suspense.activeBranch)
|
return suspense.activeBranch && next(suspense.activeBranch)
|
||||||
},
|
},
|
||||||
|
|
||||||
registerDep(instance, setupRenderEffect) {
|
registerDep(instance, setupRenderEffect, optimized) {
|
||||||
const isInPendingSuspense = !!suspense.pendingBranch
|
const isInPendingSuspense = !!suspense.pendingBranch
|
||||||
if (isInPendingSuspense) {
|
if (isInPendingSuspense) {
|
||||||
suspense.deps++
|
suspense.deps++
|
||||||
|
|
|
@ -1238,7 +1238,8 @@ function baseCreateRenderer(
|
||||||
// setup() is async. This component relies on async logic to be resolved
|
// setup() is async. This component relies on async logic to be resolved
|
||||||
// before proceeding
|
// before proceeding
|
||||||
if (__FEATURE_SUSPENSE__ && instance.asyncDep) {
|
if (__FEATURE_SUSPENSE__ && instance.asyncDep) {
|
||||||
parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect)
|
parentSuspense &&
|
||||||
|
parentSuspense.registerDep(instance, setupRenderEffect, optimized)
|
||||||
|
|
||||||
// Give it a placeholder if this is not hydration
|
// Give it a placeholder if this is not hydration
|
||||||
// TODO handle self-defined fallback
|
// TODO handle self-defined fallback
|
||||||
|
|
Loading…
Reference in New Issue