@vue/runtime-core 3.5.44 → 3.5.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.44
2
+ * @vue/runtime-core v3.5.45
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -207,7 +207,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
207
207
  const res = callWithErrorHandling(fn, instance, type, args);
208
208
  if (res && shared.isPromise(res)) {
209
209
  res.catch((err) => {
210
- handleError(err, instance, type);
210
+ handleError(err, instance, type, void 0, true);
211
211
  });
212
212
  }
213
213
  return res;
@@ -224,7 +224,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
224
224
  );
225
225
  }
226
226
  }
227
- function handleError(err, instance, type, throwInDev = true) {
227
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
228
228
  const contextVNode = instance ? instance.vnode : null;
229
229
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ;
230
230
  if (instance) {
@@ -233,7 +233,9 @@ function handleError(err, instance, type, throwInDev = true) {
233
233
  const errorInfo = ErrorTypeStrings$1[type] ;
234
234
  while (cur) {
235
235
  const errorCapturedHooks = cur.ec;
236
- if (errorCapturedHooks) {
236
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
237
+ // are deferred or discarded by Suspense.
238
+ (!isAsyncError || cur.scope.active)) {
237
239
  for (let i = 0; i < errorCapturedHooks.length; i++) {
238
240
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
239
241
  return;
@@ -561,14 +563,32 @@ function reload(id, newComp) {
561
563
  instance.ceReload(newComp.styles);
562
564
  dirtyInstances.delete(instance);
563
565
  } else if (instance.parent) {
564
- queueJob(() => {
565
- if (!(instance.job.flags & 8)) {
566
- isHmrUpdating = true;
566
+ const update = () => {
567
+ if (!instance.scope.active) return;
568
+ const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
569
+ if (pending) {
570
+ pending.asyncDep.catch(shared.NOOP).then(() => {
571
+ if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
572
+ queueJob(update);
573
+ }
574
+ });
575
+ return;
576
+ }
577
+ dirtyInstances = hmrDirtyComponents.get(oldComp);
578
+ if (!dirtyInstances) {
579
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
580
+ }
581
+ dirtyInstances.add(instance);
582
+ isHmrUpdating = true;
583
+ try {
567
584
  instance.parent.update();
585
+ } finally {
568
586
  isHmrUpdating = false;
569
587
  dirtyInstances.delete(instance);
588
+ queuePostFlushCb(() => hmrDirtyComponents.clear());
570
589
  }
571
- });
590
+ };
591
+ queueJob(update);
572
592
  } else if (instance.appContext.reload) {
573
593
  instance.appContext.reload();
574
594
  } else if (typeof window !== "undefined") {
@@ -784,12 +804,31 @@ function withDirectives(vnode, directives) {
784
804
  return vnode;
785
805
  }
786
806
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
787
- const bindings = vnode.dirs;
807
+ let hookVNode = vnode;
808
+ if (name === "beforeMount") {
809
+ vnode._mount = vnode;
810
+ } else if (name === "beforeUpdate") {
811
+ const mount = prevVNode && prevVNode._mount;
812
+ if (mount) {
813
+ mount._latest = vnode;
814
+ vnode._mount = mount;
815
+ }
816
+ } else if (name === "mounted") {
817
+ const latest = vnode._latest;
818
+ vnode._mount = vnode._latest = void 0;
819
+ if (latest) {
820
+ hookVNode = latest;
821
+ latest._mount = void 0;
822
+ }
823
+ }
824
+ const bindings = hookVNode.dirs;
788
825
  const oldBindings = prevVNode && prevVNode.dirs;
789
826
  for (let i = 0; i < bindings.length; i++) {
790
- const binding = bindings[i];
827
+ let binding = bindings[i];
791
828
  if (oldBindings) {
792
829
  binding.oldValue = oldBindings[i].value;
830
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
831
+ binding = shared.extend({}, binding, { oldValue: void 0 });
793
832
  }
794
833
  let hook = binding.dir[name];
795
834
  if (hook) {
@@ -797,7 +836,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
797
836
  callWithAsyncErrorHandling(hook, instance, 8, [
798
837
  vnode.el,
799
838
  binding,
800
- vnode,
839
+ hookVNode,
801
840
  prevVNode
802
841
  ]);
803
842
  reactivity.resetTracking();
@@ -1421,13 +1460,11 @@ const BaseTransitionImpl = {
1421
1460
  if (!innerChild) {
1422
1461
  return emptyPlaceholder(child);
1423
1462
  }
1424
- let enterHooks = resolveTransitionHooks(
1463
+ const enterHooks = resolveTransitionHooks(
1425
1464
  innerChild,
1426
1465
  rawProps,
1427
1466
  state,
1428
- instance,
1429
- // #11061, ensure enterHooks is fresh after clone
1430
- (hooks) => enterHooks = hooks
1467
+ instance
1431
1468
  );
1432
1469
  if (innerChild.type !== Comment) {
1433
1470
  setTransitionHooks(innerChild, enterHooks);
@@ -1446,7 +1483,17 @@ const BaseTransitionImpl = {
1446
1483
  leavingHooks.afterLeave = () => {
1447
1484
  state.isLeaving = false;
1448
1485
  if (!(instance.job.flags & 8)) {
1449
- instance.update();
1486
+ if (instance.effect.flags & 2) {
1487
+ const job = () => {
1488
+ if (!(instance.job.flags & 8)) {
1489
+ instance.update();
1490
+ }
1491
+ };
1492
+ job.i = instance;
1493
+ queueJob(job);
1494
+ } else {
1495
+ instance.update();
1496
+ }
1450
1497
  }
1451
1498
  delete leavingHooks.afterLeave;
1452
1499
  oldInnerChild = void 0;
@@ -1510,7 +1557,7 @@ function getLeavingNodesForType(state, vnode) {
1510
1557
  }
1511
1558
  return leavingVNodesCache;
1512
1559
  }
1513
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1560
+ function resolveTransitionHooks(vnode, props, state, instance) {
1514
1561
  const {
1515
1562
  appear,
1516
1563
  mode,
@@ -1649,15 +1696,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1649
1696
  }
1650
1697
  },
1651
1698
  clone(vnode2) {
1652
- const hooks2 = resolveTransitionHooks(
1653
- vnode2,
1654
- props,
1655
- state,
1656
- instance,
1657
- postClone
1658
- );
1659
- if (postClone) postClone(hooks2);
1660
- return hooks2;
1699
+ const cloned = resolveTransitionHooks(vnode2, props, state, instance);
1700
+ cloned.afterLeave = () => {
1701
+ if (hooks.afterLeave) hooks.afterLeave();
1702
+ };
1703
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
1704
+ if (hooks.delayLeave) {
1705
+ hooks.delayLeave(el, earlyRemove, delayedLeave);
1706
+ } else {
1707
+ delayedLeave();
1708
+ }
1709
+ };
1710
+ cloned.delayedLeave = () => {
1711
+ if (hooks.delayedLeave) hooks.delayedLeave();
1712
+ };
1713
+ return cloned;
1661
1714
  }
1662
1715
  };
1663
1716
  return hooks;
@@ -1698,8 +1751,16 @@ function setTransitionHooks(vnode, hooks) {
1698
1751
  hooks
1699
1752
  );
1700
1753
  } else if (vnode.shapeFlag & 128) {
1701
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1702
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1754
+ const suspense = vnode.suspense;
1755
+ if (suspense) {
1756
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
1757
+ if (branch) {
1758
+ setTransitionHooks(branch, hooks.clone(branch));
1759
+ }
1760
+ } else {
1761
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1762
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1763
+ }
1703
1764
  } else {
1704
1765
  vnode.transition = hooks;
1705
1766
  if (vnode.type === Fragment && shared.isArray(vnode.children)) {
@@ -2400,7 +2461,7 @@ Server rendered element contains fewer child nodes than client vdom.`
2400
2461
  getContainerType(container),
2401
2462
  slotScopeIds
2402
2463
  );
2403
- if (parentComponent) {
2464
+ if (parentComponent && parentComponent.vnode.el === node) {
2404
2465
  parentComponent.vnode.el = vnode.el;
2405
2466
  updateHOCHostEl(parentComponent, vnode.el);
2406
2467
  }
@@ -2834,7 +2895,8 @@ function defineAsyncComponent(source) {
2834
2895
  err,
2835
2896
  instance,
2836
2897
  13,
2837
- !errorComponent
2898
+ !errorComponent,
2899
+ true
2838
2900
  );
2839
2901
  };
2840
2902
  if (suspensible && instance.suspense || isInSSRComponentSetup) {
@@ -2852,7 +2914,7 @@ function defineAsyncComponent(source) {
2852
2914
  const delayed = reactivity.ref(!!delay);
2853
2915
  let timeoutTimer;
2854
2916
  let delayTimer;
2855
- onUnmounted(() => {
2917
+ reactivity.onScopeDispose(() => {
2856
2918
  if (timeoutTimer != null) clearTimeout(timeoutTimer);
2857
2919
  if (delayTimer != null) clearTimeout(delayTimer);
2858
2920
  });
@@ -2980,6 +3042,12 @@ const KeepAliveImpl = {
2980
3042
  }
2981
3043
  };
2982
3044
  sharedContext.deactivate = (vnode) => {
3045
+ const cached = cache.get(
3046
+ vnode.key == null ? vnode.type : vnode.key
3047
+ );
3048
+ if (!cached || cached.component !== vnode.component) {
3049
+ return false;
3050
+ }
2983
3051
  const instance2 = vnode.component;
2984
3052
  invalidateMount(instance2.m);
2985
3053
  invalidateMount(instance2.a);
@@ -2997,6 +3065,7 @@ const KeepAliveImpl = {
2997
3065
  {
2998
3066
  devtoolsComponentAdded(instance2);
2999
3067
  }
3068
+ return true;
3000
3069
  };
3001
3070
  function unmount(vnode) {
3002
3071
  resetShapeFlag(vnode);
@@ -3036,12 +3105,17 @@ const KeepAliveImpl = {
3036
3105
  const cacheSubtree = () => {
3037
3106
  if (pendingCacheKey != null) {
3038
3107
  if (isSuspense(instance.subTree.type)) {
3039
- queuePostRenderEffect(() => {
3108
+ const cacheInnerChild = () => {
3040
3109
  const vnode = getInnerChild(instance.subTree);
3041
3110
  if (vnode.component) {
3042
3111
  cache.set(pendingCacheKey, vnode);
3043
3112
  }
3044
- }, instance.subTree.suspense);
3113
+ };
3114
+ if (instance.subTree.suspense.pendingBranch) {
3115
+ queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
3116
+ } else {
3117
+ cacheInnerChild();
3118
+ }
3045
3119
  } else {
3046
3120
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
3047
3121
  }
@@ -3172,9 +3246,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
3172
3246
  true
3173
3247
  /* prepend */
3174
3248
  );
3175
- onUnmounted(() => {
3176
- shared.remove(keepAliveRoot[type], injected);
3177
- }, target);
3249
+ const removal = injectHook(
3250
+ "um",
3251
+ () => shared.remove(keepAliveRoot[type], injected),
3252
+ target
3253
+ );
3254
+ removal.flags = 16;
3178
3255
  }
3179
3256
  function resetShapeFlag(vnode) {
3180
3257
  vnode.shapeFlag &= -257;
@@ -5832,6 +5909,8 @@ function baseCreateRenderer(options, createHydrationFns) {
5832
5909
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
5833
5910
  if (needCallTransitionHooks) {
5834
5911
  transition.beforeEnter(el);
5912
+ } else if (transition && !transition.persisted) {
5913
+ el[deferredEnterKey] = true;
5835
5914
  }
5836
5915
  hostInsert(el, container, anchor);
5837
5916
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -6314,16 +6393,23 @@ function baseCreateRenderer(options, createHydrationFns) {
6314
6393
  } else {
6315
6394
  let { next, bu, u, parent, vnode } = instance;
6316
6395
  {
6317
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
6318
- if (nonHydratedAsyncRoot) {
6396
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
6397
+ if (unresolvedAsyncRoot) {
6319
6398
  if (next) {
6320
6399
  next.el = vnode.el;
6321
6400
  updateComponentPreRender(instance, next, optimized);
6322
6401
  }
6323
- nonHydratedAsyncRoot.asyncDep.then(() => {
6324
- queuePostRenderEffect(() => {
6325
- if (!instance.isUnmounted) update();
6326
- }, parentSuspense);
6402
+ unresolvedAsyncRoot.asyncDep.then(() => {
6403
+ const retry = () => {
6404
+ if (instance.job.flags & 8) return;
6405
+ if (parentSuspense && parentSuspense.pendingBranch) {
6406
+ queuePostRenderEffect(retry, parentSuspense);
6407
+ } else {
6408
+ update();
6409
+ }
6410
+ };
6411
+ retry.flags = 16 | 32;
6412
+ queuePostRenderEffect(retry, parentSuspense);
6327
6413
  });
6328
6414
  return;
6329
6415
  }
@@ -6362,8 +6448,11 @@ function baseCreateRenderer(options, createHydrationFns) {
6362
6448
  patch(
6363
6449
  prevTree,
6364
6450
  nextTree,
6365
- // parent may have changed if it's in a teleport
6366
- hostParentNode(prevTree.el),
6451
+ // parent may have changed if it's in a teleport. a root that is a
6452
+ // pending async component only has its placeholder comment
6453
+ hostParentNode(
6454
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
6455
+ ),
6367
6456
  // anchor may have changed if it's in a fragment
6368
6457
  getNextHostNode(prevTree),
6369
6458
  instance,
@@ -6803,8 +6892,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6803
6892
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
6804
6893
  parentComponent.renderCache[cacheIndex] = void 0;
6805
6894
  }
6806
- if (shapeFlag & 256) {
6807
- parentComponent.ctx.deactivate(vnode);
6895
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
6808
6896
  return;
6809
6897
  }
6810
6898
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -6926,16 +7014,18 @@ function baseCreateRenderer(options, createHydrationFns) {
6926
7014
  if (job) {
6927
7015
  job.flags |= 8;
6928
7016
  unmount(subTree, instance, parentSuspense, doRemove);
6929
- } else if (instance.vnode.el && subTree) {
7017
+ } else if (subTree) {
6930
7018
  subTree.transition = instance.vnode.transition;
6931
7019
  unmount(subTree, instance, parentSuspense, doRemove);
6932
7020
  }
6933
7021
  if (um) {
6934
7022
  queuePostRenderEffect(um, parentSuspense);
6935
7023
  }
6936
- queuePostRenderEffect(() => {
7024
+ const markUnmounted = () => {
6937
7025
  instance.isUnmounted = true;
6938
- }, parentSuspense);
7026
+ };
7027
+ markUnmounted.flags = 16;
7028
+ queuePostRenderEffect(markUnmounted, parentSuspense);
6939
7029
  {
6940
7030
  devtoolsComponentRemoved(instance);
6941
7031
  }
@@ -7087,13 +7177,13 @@ function getSequence(arr) {
7087
7177
  }
7088
7178
  return result;
7089
7179
  }
7090
- function locateNonHydratedAsyncRoot(instance) {
7180
+ function locateUnresolvedAsyncRoot(instance) {
7091
7181
  const subComponent = instance.subTree.component;
7092
7182
  if (subComponent) {
7093
7183
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
7094
7184
  return subComponent;
7095
7185
  } else {
7096
- return locateNonHydratedAsyncRoot(subComponent);
7186
+ return locateUnresolvedAsyncRoot(subComponent);
7097
7187
  }
7098
7188
  }
7099
7189
  }
@@ -7111,11 +7201,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
7111
7201
  if (instance) {
7112
7202
  return resolveAsyncComponentPlaceholder(instance.subTree);
7113
7203
  }
7204
+ const suspense = anchorVnode.suspense;
7205
+ if (suspense && suspense.activeBranch) {
7206
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
7207
+ }
7114
7208
  return null;
7115
7209
  }
7116
7210
 
7117
7211
  const isSuspense = (type) => type.__isSuspense;
7118
7212
  let suspenseId = 0;
7213
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
7119
7214
  const SuspenseImpl = {
7120
7215
  name: "Suspense",
7121
7216
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -7137,11 +7232,22 @@ const SuspenseImpl = {
7137
7232
  rendererInternals
7138
7233
  );
7139
7234
  } else {
7140
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
7141
- n2.suspense = n1.suspense;
7142
- n2.suspense.vnode = n2;
7143
- n2.el = n1.el;
7144
- return;
7235
+ const suspense = n1.suspense;
7236
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
7237
+ const owner = suspense.parentComponent;
7238
+ const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
7239
+ if (retained ? (
7240
+ // deps can outlive the pending branch: skip only while it exists
7241
+ parentSuspense.pendingBranch && !isSameVNodeType(
7242
+ n2.ssContent,
7243
+ suspense.pendingBranch || suspense.activeBranch
7244
+ )
7245
+ ) : !suspense.isInFallback) {
7246
+ n2.suspense = suspense;
7247
+ suspense.vnode = n2;
7248
+ n2.el = n1.el;
7249
+ return;
7250
+ }
7145
7251
  }
7146
7252
  patchSuspense(
7147
7253
  n1,
@@ -7166,6 +7272,38 @@ function triggerEvent(vnode, name) {
7166
7272
  eventListener();
7167
7273
  }
7168
7274
  }
7275
+ function enterDeferred(branch) {
7276
+ const enters = [];
7277
+ collectDeferredEnters(branch, enters, true);
7278
+ if (enters.length) {
7279
+ queuePostFlushCb(enters);
7280
+ }
7281
+ }
7282
+ function collectDeferredEnters(vnode, enters, isRoot) {
7283
+ const { el, transition, children, shapeFlag } = vnode;
7284
+ if (shapeFlag & 6) {
7285
+ collectDeferredEnters(vnode.component.subTree, enters, isRoot);
7286
+ return;
7287
+ }
7288
+ if (shapeFlag & (128 | 64)) {
7289
+ return;
7290
+ }
7291
+ if (shapeFlag & 1) {
7292
+ if (!isRoot && el && el[deferredEnterKey]) {
7293
+ el[deferredEnterKey] = void 0;
7294
+ if (transition && !transition.persisted) {
7295
+ transition.beforeEnter(el);
7296
+ enters.push(() => transition.enter(el));
7297
+ }
7298
+ }
7299
+ isRoot = false;
7300
+ }
7301
+ if (shapeFlag & 16) {
7302
+ for (let i = 0; i < children.length; i++) {
7303
+ collectDeferredEnters(children[i], enters, isRoot);
7304
+ }
7305
+ }
7306
+ }
7169
7307
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
7170
7308
  const {
7171
7309
  p: patch,
@@ -7265,7 +7403,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7265
7403
  unmount(pendingBranch, parentComponent, suspense);
7266
7404
  }
7267
7405
  suspense.deps = 0;
7268
- suspense.effects.length = 0;
7406
+ discardEffects(suspense);
7269
7407
  suspense.hiddenContainer = createElement("div");
7270
7408
  if (isInFallback) {
7271
7409
  patch(
@@ -7343,11 +7481,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7343
7481
  } else {
7344
7482
  triggerEvent(n2, "onPending");
7345
7483
  suspense.pendingBranch = newBranch;
7346
- if (newBranch.shapeFlag & 512) {
7347
- suspense.pendingId = newBranch.component.suspenseId;
7348
- } else {
7349
- suspense.pendingId = suspenseId++;
7350
- }
7484
+ suspense.pendingId = suspenseId++;
7351
7485
  patch(
7352
7486
  null,
7353
7487
  newBranch,
@@ -7362,12 +7496,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7362
7496
  if (suspense.deps <= 0) {
7363
7497
  suspense.resolve();
7364
7498
  } else {
7365
- const { timeout, pendingId } = suspense;
7499
+ const { timeout } = suspense;
7366
7500
  if (timeout > 0) {
7367
- setTimeout(() => {
7368
- if (suspense.pendingId === pendingId) {
7369
- suspense.fallback(newFallback);
7370
- }
7501
+ suspense.timeoutTimer = setTimeout(() => {
7502
+ suspense.timeoutTimer = void 0;
7503
+ suspense.fallback(suspense.vnode.ssFallback);
7371
7504
  }, timeout);
7372
7505
  } else if (timeout === 0) {
7373
7506
  suspense.fallback(newFallback);
@@ -7414,6 +7547,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7414
7547
  deps: 0,
7415
7548
  pendingId: suspenseId++,
7416
7549
  timeout: typeof timeout === "number" ? timeout : -1,
7550
+ timeoutTimer: void 0,
7417
7551
  activeBranch: null,
7418
7552
  isFallbackMountPending: false,
7419
7553
  pendingBranch: null,
@@ -7452,7 +7586,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7452
7586
  let hasUpdatedAnchor = false;
7453
7587
  if (delayEnter) {
7454
7588
  activeBranch.transition.afterLeave = () => {
7455
- if (pendingId === suspense.pendingId) {
7589
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
7590
+ enterDeferred(pendingBranch);
7456
7591
  move(
7457
7592
  pendingBranch,
7458
7593
  container2,
@@ -7467,7 +7602,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7467
7602
  };
7468
7603
  }
7469
7604
  if (activeBranch && !suspense.isFallbackMountPending) {
7470
- if (parentNode(activeBranch.el) === container2) {
7605
+ if (parentNode(
7606
+ activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
7607
+ ) === container2) {
7471
7608
  anchor = next(activeBranch);
7472
7609
  hasUpdatedAnchor = true;
7473
7610
  }
@@ -7477,13 +7614,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7477
7614
  }
7478
7615
  }
7479
7616
  if (!delayEnter) {
7617
+ enterDeferred(pendingBranch);
7480
7618
  move(pendingBranch, container2, anchor, 0);
7481
7619
  }
7482
7620
  }
7621
+ clearTimeout(suspense.timeoutTimer);
7622
+ suspense.timeoutTimer = void 0;
7483
7623
  suspense.isFallbackMountPending = false;
7484
7624
  setActiveBranch(suspense, pendingBranch);
7485
7625
  suspense.pendingBranch = null;
7486
7626
  suspense.isInFallback = false;
7627
+ let kept = 0;
7628
+ for (let i = 0; i < effects.length; i++) {
7629
+ const effect = effects[i];
7630
+ if (effect.flags & 32) {
7631
+ queuePostFlushCb(effect);
7632
+ } else {
7633
+ effects[kept++] = effect;
7634
+ }
7635
+ }
7636
+ effects.length = kept;
7487
7637
  let parent = suspense.parent;
7488
7638
  let hasUnresolvedAncestor = false;
7489
7639
  while (parent) {
@@ -7512,7 +7662,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7512
7662
  triggerEvent(vnode2, "onResolve");
7513
7663
  },
7514
7664
  fallback(fallbackVNode) {
7515
- if (!suspense.pendingBranch) {
7665
+ if (suspense.isUnmounted || !suspense.pendingBranch) {
7516
7666
  return;
7517
7667
  }
7518
7668
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
@@ -7520,7 +7670,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7520
7670
  const anchor2 = next(activeBranch);
7521
7671
  const mountFallback = () => {
7522
7672
  suspense.isFallbackMountPending = false;
7523
- if (!suspense.isInFallback) {
7673
+ if (suspense.isUnmounted || !suspense.isInFallback) {
7524
7674
  return;
7525
7675
  }
7526
7676
  const latestFallback = suspense.vnode.ssFallback;
@@ -7572,19 +7722,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7572
7722
  suspense.deps++;
7573
7723
  }
7574
7724
  const hydratedEl = instance.vnode.el;
7575
- instance.asyncDep.catch((err) => {
7576
- handleError(err, instance, 0);
7577
- }).then((asyncSetupResult) => {
7578
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
7579
- return;
7580
- }
7581
- unsetCurrentInstance();
7582
- if (!instance.scope.active) {
7583
- if (isInPendingSuspense && --suspense.deps === 0) {
7584
- suspense.resolve();
7585
- }
7586
- return;
7587
- }
7725
+ const render = (asyncSetupResult) => {
7588
7726
  instance.asyncResolved = true;
7589
7727
  const { vnode: vnode2 } = instance;
7590
7728
  {
@@ -7617,13 +7755,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7617
7755
  {
7618
7756
  popWarningContext();
7619
7757
  }
7620
- if (isInPendingSuspense && --suspense.deps === 0) {
7758
+ };
7759
+ instance.asyncDep.catch((err) => {
7760
+ handleError(err, instance, 0, false, true);
7761
+ return () => null;
7762
+ }).then((asyncSetupResult) => {
7763
+ if (instance.isUnmounted || suspense.isUnmounted) {
7764
+ return;
7765
+ }
7766
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
7767
+ unsetCurrentInstance();
7768
+ if (!instance.scope.active) {
7769
+ if (isPendingDep && --suspense.deps === 0) {
7770
+ suspense.resolve();
7771
+ }
7772
+ return;
7773
+ }
7774
+ if (!isPendingDep && suspense.pendingBranch) {
7775
+ const job = () => {
7776
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
7777
+ return;
7778
+ }
7779
+ if (suspense.pendingBranch) {
7780
+ queueEffectWithSuspense(job, suspense);
7781
+ } else {
7782
+ render(asyncSetupResult);
7783
+ }
7784
+ };
7785
+ job.flags = 16 | 32;
7786
+ queueEffectWithSuspense(job, suspense);
7787
+ return;
7788
+ }
7789
+ render(asyncSetupResult);
7790
+ if (isPendingDep && --suspense.deps === 0) {
7621
7791
  suspense.resolve();
7622
7792
  }
7623
7793
  });
7624
7794
  },
7625
7795
  unmount(parentSuspense2, doRemove) {
7626
7796
  suspense.isUnmounted = true;
7797
+ clearTimeout(suspense.timeoutTimer);
7798
+ suspense.timeoutTimer = void 0;
7799
+ if (parentSuspenseId !== void 0) {
7800
+ const parent = suspense.parent;
7801
+ const pendingId = parentSuspenseId;
7802
+ parentSuspenseId = void 0;
7803
+ queuePostFlushCb(() => {
7804
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
7805
+ parent.resolve();
7806
+ }
7807
+ });
7808
+ }
7627
7809
  if (suspense.activeBranch) {
7628
7810
  unmount(
7629
7811
  suspense.activeBranch,
@@ -7633,12 +7815,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7633
7815
  );
7634
7816
  }
7635
7817
  if (suspense.pendingBranch) {
7636
- unmount(
7637
- suspense.pendingBranch,
7638
- parentComponent,
7639
- parentSuspense2,
7640
- doRemove
7641
- );
7818
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
7819
+ discardEffects(suspense);
7642
7820
  }
7643
7821
  }
7644
7822
  };
@@ -7708,6 +7886,16 @@ function normalizeSuspenseSlot(s) {
7708
7886
  }
7709
7887
  return s;
7710
7888
  }
7889
+ function discardEffects(suspense) {
7890
+ const { effects } = suspense;
7891
+ for (let i = 0; i < effects.length; i++) {
7892
+ const effect = effects[i];
7893
+ if (effect.flags & 16) {
7894
+ queuePostFlushCb(effect);
7895
+ }
7896
+ }
7897
+ effects.length = 0;
7898
+ }
7711
7899
  function queueEffectWithSuspense(fn, suspense) {
7712
7900
  if (suspense && suspense.pendingBranch) {
7713
7901
  if (shared.isArray(fn)) {
@@ -7959,7 +8147,8 @@ Component that was made reactive: `,
7959
8147
  }
7960
8148
  function guardReactiveProps(props) {
7961
8149
  if (!props) return null;
7962
- return reactivity.isProxy(props) || isInternalObject(props) ? shared.extend({}, props) : props;
8150
+ if (reactivity.isProxy(props)) return shared.extend({}, props);
8151
+ return isInternalObject(props) ? shared.extend({}, props[rawAttrsKey] || props) : props;
7963
8152
  }
7964
8153
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
7965
8154
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -8138,7 +8327,7 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
8138
8327
  ]);
8139
8328
  }
8140
8329
 
8141
- const emptyAppContext = createAppContext();
8330
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
8142
8331
  let uid = 0;
8143
8332
  function getNextUid() {
8144
8333
  return uid;
@@ -8351,7 +8540,8 @@ function setupStatefulComponent(instance, isSSR) {
8351
8540
  setInSSRSetupState(false);
8352
8541
  }
8353
8542
  }).catch((e) => {
8354
- handleError(e, instance, 0);
8543
+ handleError(e, instance, 0, void 0, true);
8544
+ instance.ssrRender = (_, push) => push("<!---->");
8355
8545
  });
8356
8546
  } else {
8357
8547
  instance.asyncDep = setupResult;
@@ -8459,11 +8649,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8459
8649
  }
8460
8650
  }
8461
8651
  }
8652
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
8462
8653
  const attrsProxyHandlers = {
8463
8654
  get(target, key) {
8464
8655
  markAttrsAccessed();
8465
8656
  reactivity.track(target, "get", "");
8466
- return target[key];
8657
+ return key === rawAttrsKey ? target : target[key];
8467
8658
  },
8468
8659
  set() {
8469
8660
  warn$1(`setupContext.attrs is readonly.`);
@@ -8815,7 +9006,7 @@ function isMemoSame(cached, memo) {
8815
9006
  return true;
8816
9007
  }
8817
9008
 
8818
- const version = "3.5.44";
9009
+ const version = "3.5.45";
8819
9010
  const warn = warn$1 ;
8820
9011
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8821
9012
  const devtools = devtools$1 ;