]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(suspense): don't immediately resolve suspense on last dep unmount
authordaiwei <daiwei521@126.com>
Tue, 10 Jun 2025 03:26:36 +0000 (11:26 +0800)
committerdaiwei <daiwei521@126.com>
Tue, 10 Jun 2025 03:26:36 +0000 (11:26 +0800)
because new vnodes may contain async components

packages/runtime-core/src/renderer.ts

index a57be791a44eb807796520ea2833bc2ea7ee6cbe..16ed847076aa9e770df418a92e9344e2dc738b37 100644 (file)
@@ -2332,24 +2332,6 @@ function baseCreateRenderer(
       instance.isUnmounted = true
     }, parentSuspense)
 
-    // A component with async dep inside a pending suspense is unmounted before
-    // its async dep resolves. This should remove the dep from the suspense, and
-    // cause the suspense to resolve immediately if that was the last dep.
-    if (
-      __FEATURE_SUSPENSE__ &&
-      parentSuspense &&
-      parentSuspense.pendingBranch &&
-      !parentSuspense.isUnmounted &&
-      instance.asyncDep &&
-      !instance.asyncResolved &&
-      instance.suspenseId === parentSuspense.pendingId
-    ) {
-      parentSuspense.deps--
-      if (parentSuspense.deps === 0) {
-        parentSuspense.resolve()
-      }
-    }
-
     if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
       devtoolsComponentRemoved(instance)
     }