@vue/runtime-core 3.5.29 → 3.5.31

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.29
2
+ * @vue/runtime-core v3.5.31
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -445,6 +445,13 @@ function checkRecursiveUpdates(seen, fn) {
445
445
  }
446
446
 
447
447
  let isHmrUpdating = false;
448
+ const setHmrUpdating = (v) => {
449
+ try {
450
+ return isHmrUpdating;
451
+ } finally {
452
+ isHmrUpdating = v;
453
+ }
454
+ };
448
455
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
449
456
  {
450
457
  shared.getGlobalThis().__VUE_HMR_RUNTIME__ = {
@@ -1031,9 +1038,10 @@ const TeleportImpl = {
1031
1038
  mount(container, mainAnchor);
1032
1039
  updateCssVars(n2, true);
1033
1040
  }
1034
- if (isTeleportDeferred(n2.props)) {
1041
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
1035
1042
  n2.el.__isMounted = false;
1036
1043
  queuePostRenderEffect(() => {
1044
+ if (n2.el.__isMounted !== false) return;
1037
1045
  mountToTarget();
1038
1046
  delete n2.el.__isMounted;
1039
1047
  }, parentSuspense);
@@ -1041,7 +1049,12 @@ const TeleportImpl = {
1041
1049
  mountToTarget();
1042
1050
  }
1043
1051
  } else {
1044
- if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
1052
+ n2.el = n1.el;
1053
+ n2.targetStart = n1.targetStart;
1054
+ const mainAnchor = n2.anchor = n1.anchor;
1055
+ const target = n2.target = n1.target;
1056
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
1057
+ if (n1.el.__isMounted === false) {
1045
1058
  queuePostRenderEffect(() => {
1046
1059
  TeleportImpl.process(
1047
1060
  n1,
@@ -1058,11 +1071,6 @@ const TeleportImpl = {
1058
1071
  }, parentSuspense);
1059
1072
  return;
1060
1073
  }
1061
- n2.el = n1.el;
1062
- n2.targetStart = n1.targetStart;
1063
- const mainAnchor = n2.anchor = n1.anchor;
1064
- const target = n2.target = n1.target;
1065
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
1066
1074
  const wasDisabled = isTeleportDisabled(n1.props);
1067
1075
  const currentContainer = wasDisabled ? container : target;
1068
1076
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -1525,7 +1533,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1525
1533
  callHook(hook, [el]);
1526
1534
  },
1527
1535
  enter(el) {
1528
- if (leavingVNodesCache[key] === vnode) return;
1536
+ if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
1529
1537
  let hook = onEnter;
1530
1538
  let afterHook = onAfterEnter;
1531
1539
  let cancelHook = onEnterCancelled;
@@ -3159,12 +3167,16 @@ function renderList(source, renderItem, cache, index) {
3159
3167
  );
3160
3168
  }
3161
3169
  } else if (typeof source === "number") {
3162
- if (!Number.isInteger(source)) {
3163
- warn$1(`The v-for range expect an integer value but got ${source}.`);
3164
- }
3165
- ret = new Array(source);
3166
- for (let i = 0; i < source; i++) {
3167
- ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
3170
+ if (!Number.isInteger(source) || source < 0) {
3171
+ warn$1(
3172
+ `The v-for range expects a positive integer value but got ${source}.`
3173
+ );
3174
+ ret = [];
3175
+ } else {
3176
+ ret = new Array(source);
3177
+ for (let i = 0; i < source; i++) {
3178
+ ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
3179
+ }
3168
3180
  }
3169
3181
  } else if (shared.isObject(source)) {
3170
3182
  if (source[Symbol.iterator]) {
@@ -3615,6 +3627,7 @@ function createPropsRestProxy(props, excludedKeys) {
3615
3627
  }
3616
3628
  function withAsyncContext(getAwaitable) {
3617
3629
  const ctx = getCurrentInstance();
3630
+ const inSSRSetup = isInSSRComponentSetup;
3618
3631
  if (!ctx) {
3619
3632
  warn$1(
3620
3633
  `withAsyncContext called without active current instance. This is likely a bug.`
@@ -3622,13 +3635,25 @@ function withAsyncContext(getAwaitable) {
3622
3635
  }
3623
3636
  let awaitable = getAwaitable();
3624
3637
  unsetCurrentInstance();
3638
+ if (inSSRSetup) {
3639
+ setInSSRSetupState(false);
3640
+ }
3641
+ const restore = () => {
3642
+ setCurrentInstance(ctx);
3643
+ if (inSSRSetup) {
3644
+ setInSSRSetupState(true);
3645
+ }
3646
+ };
3625
3647
  const cleanup = () => {
3626
3648
  if (getCurrentInstance() !== ctx) ctx.scope.off();
3627
3649
  unsetCurrentInstance();
3650
+ if (inSSRSetup) {
3651
+ setInSSRSetupState(false);
3652
+ }
3628
3653
  };
3629
3654
  if (shared.isPromise(awaitable)) {
3630
3655
  awaitable = awaitable.catch((e) => {
3631
- setCurrentInstance(ctx);
3656
+ restore();
3632
3657
  Promise.resolve().then(() => Promise.resolve().then(cleanup));
3633
3658
  throw e;
3634
3659
  });
@@ -3636,7 +3661,7 @@ function withAsyncContext(getAwaitable) {
3636
3661
  return [
3637
3662
  awaitable,
3638
3663
  () => {
3639
- setCurrentInstance(ctx);
3664
+ restore();
3640
3665
  Promise.resolve().then(cleanup);
3641
3666
  }
3642
3667
  ];
@@ -4749,11 +4774,12 @@ function hasPropValueChanged(nextProps, prevProps, key) {
4749
4774
  }
4750
4775
  return nextProp !== prevProp;
4751
4776
  }
4752
- function updateHOCHostEl({ vnode, parent }, el) {
4777
+ function updateHOCHostEl({ vnode, parent, suspense }, el) {
4753
4778
  while (parent) {
4754
4779
  const root = parent.subTree;
4755
4780
  if (root.suspense && root.suspense.activeBranch === vnode) {
4756
- root.el = vnode.el;
4781
+ root.suspense.vnode.el = root.el = el;
4782
+ vnode = root;
4757
4783
  }
4758
4784
  if (root === vnode) {
4759
4785
  (vnode = parent.vnode).el = el;
@@ -4762,6 +4788,9 @@ function updateHOCHostEl({ vnode, parent }, el) {
4762
4788
  break;
4763
4789
  }
4764
4790
  }
4791
+ if (suspense && suspense.activeBranch === vnode) {
4792
+ suspense.vnode.el = el;
4793
+ }
4765
4794
  }
4766
4795
 
4767
4796
  const internalObjectProto = {};
@@ -5603,10 +5632,17 @@ function baseCreateRenderer(options, createHydrationFns) {
5603
5632
  }
5604
5633
  hostInsert(el, container, anchor);
5605
5634
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
5635
+ const isHmr = isHmrUpdating;
5606
5636
  queuePostRenderEffect(() => {
5607
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
5608
- needCallTransitionHooks && transition.enter(el);
5609
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
5637
+ let prev;
5638
+ prev = setHmrUpdating(isHmr);
5639
+ try {
5640
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
5641
+ needCallTransitionHooks && transition.enter(el);
5642
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
5643
+ } finally {
5644
+ setHmrUpdating(prev);
5645
+ }
5610
5646
  }, parentSuspense);
5611
5647
  }
5612
5648
  };
@@ -6011,7 +6047,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6011
6047
  }
6012
6048
  } else {
6013
6049
  if (root.ce && root.ce._hasShadowRoot()) {
6014
- root.ce._injectChildStyle(type);
6050
+ root.ce._injectChildStyle(
6051
+ type,
6052
+ instance.parent ? instance.parent.type : void 0
6053
+ );
6015
6054
  }
6016
6055
  {
6017
6056
  startMeasure(instance, `render`);
@@ -6524,7 +6563,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6524
6563
  shapeFlag,
6525
6564
  patchFlag,
6526
6565
  dirs,
6527
- cacheIndex
6566
+ cacheIndex,
6567
+ memo
6528
6568
  } = vnode;
6529
6569
  if (patchFlag === -2) {
6530
6570
  optimized = false;
@@ -6586,10 +6626,14 @@ function baseCreateRenderer(options, createHydrationFns) {
6586
6626
  remove(vnode);
6587
6627
  }
6588
6628
  }
6589
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
6629
+ const shouldInvalidateMemo = memo != null && cacheIndex == null;
6630
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
6590
6631
  queuePostRenderEffect(() => {
6591
6632
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
6592
6633
  shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
6634
+ if (shouldInvalidateMemo) {
6635
+ vnode.el = null;
6636
+ }
6593
6637
  }, parentSuspense);
6594
6638
  }
6595
6639
  };
@@ -7143,6 +7187,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7143
7187
  pendingId: suspenseId++,
7144
7188
  timeout: typeof timeout === "number" ? timeout : -1,
7145
7189
  activeBranch: null,
7190
+ isFallbackMountPending: false,
7146
7191
  pendingBranch: null,
7147
7192
  isInFallback: !isHydrating,
7148
7193
  isHydrating,
@@ -7192,7 +7237,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7192
7237
  }
7193
7238
  };
7194
7239
  }
7195
- if (activeBranch) {
7240
+ if (activeBranch && !suspense.isFallbackMountPending) {
7196
7241
  if (parentNode(activeBranch.el) === container2) {
7197
7242
  anchor = next(activeBranch);
7198
7243
  }
@@ -7205,6 +7250,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7205
7250
  move(pendingBranch, container2, anchor, 0);
7206
7251
  }
7207
7252
  }
7253
+ suspense.isFallbackMountPending = false;
7208
7254
  setActiveBranch(suspense, pendingBranch);
7209
7255
  suspense.pendingBranch = null;
7210
7256
  suspense.isInFallback = false;
@@ -7240,6 +7286,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7240
7286
  triggerEvent(vnode2, "onFallback");
7241
7287
  const anchor2 = next(activeBranch);
7242
7288
  const mountFallback = () => {
7289
+ suspense.isFallbackMountPending = false;
7243
7290
  if (!suspense.isInFallback) {
7244
7291
  return;
7245
7292
  }
@@ -7259,6 +7306,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7259
7306
  };
7260
7307
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
7261
7308
  if (delayEnter) {
7309
+ suspense.isFallbackMountPending = true;
7262
7310
  activeBranch.transition.afterLeave = mountFallback;
7263
7311
  }
7264
7312
  suspense.isInFallback = true;
@@ -7809,6 +7857,10 @@ function mergeProps(...args) {
7809
7857
  const incoming = toMerge[key];
7810
7858
  if (incoming && existing !== incoming && !(shared.isArray(existing) && existing.includes(incoming))) {
7811
7859
  ret[key] = existing ? [].concat(existing, incoming) : incoming;
7860
+ } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
7861
+ // the model listener.
7862
+ !shared.isModelListener(key)) {
7863
+ ret[key] = incoming;
7812
7864
  }
7813
7865
  } else if (key !== "") {
7814
7866
  ret[key] = toMerge[key];
@@ -8493,7 +8545,7 @@ function isMemoSame(cached, memo) {
8493
8545
  return true;
8494
8546
  }
8495
8547
 
8496
- const version = "3.5.29";
8548
+ const version = "3.5.31";
8497
8549
  const warn = warn$1 ;
8498
8550
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8499
8551
  const devtools = devtools$1 ;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.29
2
+ * @vue/runtime-core v3.5.31
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -584,9 +584,10 @@ const TeleportImpl = {
584
584
  mount(container, mainAnchor);
585
585
  updateCssVars(n2, true);
586
586
  }
587
- if (isTeleportDeferred(n2.props)) {
587
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
588
588
  n2.el.__isMounted = false;
589
589
  queuePostRenderEffect(() => {
590
+ if (n2.el.__isMounted !== false) return;
590
591
  mountToTarget();
591
592
  delete n2.el.__isMounted;
592
593
  }, parentSuspense);
@@ -594,7 +595,12 @@ const TeleportImpl = {
594
595
  mountToTarget();
595
596
  }
596
597
  } else {
597
- if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
598
+ n2.el = n1.el;
599
+ n2.targetStart = n1.targetStart;
600
+ const mainAnchor = n2.anchor = n1.anchor;
601
+ const target = n2.target = n1.target;
602
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
603
+ if (n1.el.__isMounted === false) {
598
604
  queuePostRenderEffect(() => {
599
605
  TeleportImpl.process(
600
606
  n1,
@@ -611,11 +617,6 @@ const TeleportImpl = {
611
617
  }, parentSuspense);
612
618
  return;
613
619
  }
614
- n2.el = n1.el;
615
- n2.targetStart = n1.targetStart;
616
- const mainAnchor = n2.anchor = n1.anchor;
617
- const target = n2.target = n1.target;
618
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
619
620
  const wasDisabled = isTeleportDisabled(n1.props);
620
621
  const currentContainer = wasDisabled ? container : target;
621
622
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -2449,9 +2450,11 @@ function renderList(source, renderItem, cache, index) {
2449
2450
  );
2450
2451
  }
2451
2452
  } else if (typeof source === "number") {
2452
- ret = new Array(source);
2453
- for (let i = 0; i < source; i++) {
2454
- ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
2453
+ {
2454
+ ret = new Array(source);
2455
+ for (let i = 0; i < source; i++) {
2456
+ ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
2457
+ }
2455
2458
  }
2456
2459
  } else if (shared.isObject(source)) {
2457
2460
  if (source[Symbol.iterator]) {
@@ -2758,15 +2761,28 @@ function createPropsRestProxy(props, excludedKeys) {
2758
2761
  }
2759
2762
  function withAsyncContext(getAwaitable) {
2760
2763
  const ctx = getCurrentInstance();
2764
+ const inSSRSetup = isInSSRComponentSetup;
2761
2765
  let awaitable = getAwaitable();
2762
2766
  unsetCurrentInstance();
2767
+ if (inSSRSetup) {
2768
+ setInSSRSetupState(false);
2769
+ }
2770
+ const restore = () => {
2771
+ setCurrentInstance(ctx);
2772
+ if (inSSRSetup) {
2773
+ setInSSRSetupState(true);
2774
+ }
2775
+ };
2763
2776
  const cleanup = () => {
2764
2777
  if (getCurrentInstance() !== ctx) ctx.scope.off();
2765
2778
  unsetCurrentInstance();
2779
+ if (inSSRSetup) {
2780
+ setInSSRSetupState(false);
2781
+ }
2766
2782
  };
2767
2783
  if (shared.isPromise(awaitable)) {
2768
2784
  awaitable = awaitable.catch((e) => {
2769
- setCurrentInstance(ctx);
2785
+ restore();
2770
2786
  Promise.resolve().then(() => Promise.resolve().then(cleanup));
2771
2787
  throw e;
2772
2788
  });
@@ -2774,7 +2790,7 @@ function withAsyncContext(getAwaitable) {
2774
2790
  return [
2775
2791
  awaitable,
2776
2792
  () => {
2777
- setCurrentInstance(ctx);
2793
+ restore();
2778
2794
  Promise.resolve().then(cleanup);
2779
2795
  }
2780
2796
  ];
@@ -3609,11 +3625,12 @@ function hasPropValueChanged(nextProps, prevProps, key) {
3609
3625
  }
3610
3626
  return nextProp !== prevProp;
3611
3627
  }
3612
- function updateHOCHostEl({ vnode, parent }, el) {
3628
+ function updateHOCHostEl({ vnode, parent, suspense }, el) {
3613
3629
  while (parent) {
3614
3630
  const root = parent.subTree;
3615
3631
  if (root.suspense && root.suspense.activeBranch === vnode) {
3616
- root.el = vnode.el;
3632
+ root.suspense.vnode.el = root.el = el;
3633
+ vnode = root;
3617
3634
  }
3618
3635
  if (root === vnode) {
3619
3636
  (vnode = parent.vnode).el = el;
@@ -3622,6 +3639,9 @@ function updateHOCHostEl({ vnode, parent }, el) {
3622
3639
  break;
3623
3640
  }
3624
3641
  }
3642
+ if (suspense && suspense.activeBranch === vnode) {
3643
+ suspense.vnode.el = el;
3644
+ }
3625
3645
  }
3626
3646
 
3627
3647
  const internalObjectProto = {};
@@ -4248,9 +4268,12 @@ function baseCreateRenderer(options, createHydrationFns) {
4248
4268
  hostInsert(el, container, anchor);
4249
4269
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
4250
4270
  queuePostRenderEffect(() => {
4251
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
4252
- needCallTransitionHooks && transition.enter(el);
4253
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
4271
+ try {
4272
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
4273
+ needCallTransitionHooks && transition.enter(el);
4274
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
4275
+ } finally {
4276
+ }
4254
4277
  }, parentSuspense);
4255
4278
  }
4256
4279
  };
@@ -4608,7 +4631,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4608
4631
  }
4609
4632
  } else {
4610
4633
  if (root.ce && root.ce._hasShadowRoot()) {
4611
- root.ce._injectChildStyle(type);
4634
+ root.ce._injectChildStyle(
4635
+ type,
4636
+ instance.parent ? instance.parent.type : void 0
4637
+ );
4612
4638
  }
4613
4639
  const subTree = instance.subTree = renderComponentRoot(instance);
4614
4640
  patch(
@@ -5074,7 +5100,8 @@ function baseCreateRenderer(options, createHydrationFns) {
5074
5100
  shapeFlag,
5075
5101
  patchFlag,
5076
5102
  dirs,
5077
- cacheIndex
5103
+ cacheIndex,
5104
+ memo
5078
5105
  } = vnode;
5079
5106
  if (patchFlag === -2) {
5080
5107
  optimized = false;
@@ -5136,10 +5163,14 @@ function baseCreateRenderer(options, createHydrationFns) {
5136
5163
  remove(vnode);
5137
5164
  }
5138
5165
  }
5139
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
5166
+ const shouldInvalidateMemo = memo != null && cacheIndex == null;
5167
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
5140
5168
  queuePostRenderEffect(() => {
5141
5169
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
5142
5170
  shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
5171
+ if (shouldInvalidateMemo) {
5172
+ vnode.el = null;
5173
+ }
5143
5174
  }, parentSuspense);
5144
5175
  }
5145
5176
  };
@@ -5666,6 +5697,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5666
5697
  pendingId: suspenseId++,
5667
5698
  timeout: typeof timeout === "number" ? timeout : -1,
5668
5699
  activeBranch: null,
5700
+ isFallbackMountPending: false,
5669
5701
  pendingBranch: null,
5670
5702
  isInFallback: !isHydrating,
5671
5703
  isHydrating,
@@ -5703,7 +5735,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5703
5735
  }
5704
5736
  };
5705
5737
  }
5706
- if (activeBranch) {
5738
+ if (activeBranch && !suspense.isFallbackMountPending) {
5707
5739
  if (parentNode(activeBranch.el) === container2) {
5708
5740
  anchor = next(activeBranch);
5709
5741
  }
@@ -5716,6 +5748,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5716
5748
  move(pendingBranch, container2, anchor, 0);
5717
5749
  }
5718
5750
  }
5751
+ suspense.isFallbackMountPending = false;
5719
5752
  setActiveBranch(suspense, pendingBranch);
5720
5753
  suspense.pendingBranch = null;
5721
5754
  suspense.isInFallback = false;
@@ -5751,6 +5784,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5751
5784
  triggerEvent(vnode2, "onFallback");
5752
5785
  const anchor2 = next(activeBranch);
5753
5786
  const mountFallback = () => {
5787
+ suspense.isFallbackMountPending = false;
5754
5788
  if (!suspense.isInFallback) {
5755
5789
  return;
5756
5790
  }
@@ -5770,6 +5804,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5770
5804
  };
5771
5805
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
5772
5806
  if (delayEnter) {
5807
+ suspense.isFallbackMountPending = true;
5773
5808
  activeBranch.transition.afterLeave = mountFallback;
5774
5809
  }
5775
5810
  suspense.isInFallback = true;
@@ -6274,6 +6309,10 @@ function mergeProps(...args) {
6274
6309
  const incoming = toMerge[key];
6275
6310
  if (incoming && existing !== incoming && !(shared.isArray(existing) && existing.includes(incoming))) {
6276
6311
  ret[key] = existing ? [].concat(existing, incoming) : incoming;
6312
+ } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
6313
+ // the model listener.
6314
+ !shared.isModelListener(key)) {
6315
+ ret[key] = incoming;
6277
6316
  }
6278
6317
  } else if (key !== "") {
6279
6318
  ret[key] = toMerge[key];
@@ -6640,7 +6679,7 @@ function isMemoSame(cached, memo) {
6640
6679
  return true;
6641
6680
  }
6642
6681
 
6643
- const version = "3.5.29";
6682
+ const version = "3.5.31";
6644
6683
  const warn$1 = shared.NOOP;
6645
6684
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6646
6685
  const devtools = void 0;
@@ -271,6 +271,22 @@ export declare function defineOptions<RawBindings = {}, D = {}, C extends Comput
271
271
  */
272
272
  slots?: never;
273
273
  }): void;
274
+ /**
275
+ * Vue `<script setup>` compiler macro for providing type hints to IDEs for
276
+ * slot name and slot props type checking.
277
+ *
278
+ * Example usage:
279
+ * ```ts
280
+ * const slots = defineSlots<{
281
+ * default(props: { msg: string }): any
282
+ * }>()
283
+ * ```
284
+ *
285
+ * This is only usable inside `<script setup>`, is compiled away in the
286
+ * output and should **not** be actually called at runtime.
287
+ *
288
+ * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineslots}
289
+ */
274
290
  export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
275
291
  export type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [
276
292
  ModelRef<T, M, G, S>,
@@ -489,7 +505,7 @@ C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOpt
489
505
  $: ComponentInternalInstance;
490
506
  $data: D;
491
507
  $props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
492
- $attrs: Data;
508
+ $attrs: Attrs;
493
509
  $refs: Data & TypeRefs;
494
510
  $slots: UnwrapSlotsType<S>;
495
511
  $root: ComponentPublicInstance | null;
@@ -524,6 +540,10 @@ export interface SuspenseProps {
524
540
  onResolve?: () => void;
525
541
  onPending?: () => void;
526
542
  onFallback?: () => void;
543
+ /**
544
+ * Switch to fallback content if it takes longer than `timeout` milliseconds to render the new default content.
545
+ * A `timeout` value of `0` will cause the fallback content to be displayed immediately when default content is replaced.
546
+ */
527
547
  timeout?: string | number;
528
548
  /**
529
549
  * Allow suspense to be captured by parent suspense
@@ -557,6 +577,7 @@ export interface SuspenseBoundary {
557
577
  container: RendererElement;
558
578
  hiddenContainer: RendererElement;
559
579
  activeBranch: VNode | null;
580
+ isFallbackMountPending: boolean;
560
581
  pendingBranch: VNode | null;
561
582
  deps: number;
562
583
  pendingId: number;
@@ -985,7 +1006,7 @@ export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C
985
1006
  export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
986
1007
  type ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> & Readonly<EmitsToProps<Emits>>;
987
1008
  export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
988
- props?: (keyof Props)[];
1009
+ props?: (keyof NoInfer<Props>)[];
989
1010
  emits?: E | EE[];
990
1011
  slots?: S;
991
1012
  }): DefineSetupFnComponent<Props, E, S>;
@@ -1307,6 +1328,12 @@ export declare function createCommentVNode(text?: string, asBlock?: boolean): VN
1307
1328
  export declare function mergeProps(...args: (Data & VNodeProps)[]): Data;
1308
1329
 
1309
1330
  type Data = Record<string, unknown>;
1331
+ /**
1332
+ * For extending allowed non-declared attrs on components in TSX
1333
+ */
1334
+ export interface AllowedAttrs {
1335
+ }
1336
+ export type Attrs = Data & AllowedAttrs;
1310
1337
  /**
1311
1338
  * Public utility type for extracting the instance type of a component.
1312
1339
  * Works with all valid component definition types. This is intended to replace
@@ -1415,7 +1442,7 @@ export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends
1415
1442
  export type Component<PropsOrInstance = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any> = ConcreteComponent<PropsOrInstance, RawBindings, D, C, M, E, S> | ComponentPublicInstanceConstructor<PropsOrInstance>;
1416
1443
 
1417
1444
  export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
1418
- attrs: Data;
1445
+ attrs: Attrs;
1419
1446
  slots: UnwrapSlotsType<S>;
1420
1447
  emit: EmitFn<E>;
1421
1448
  expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.29
2
+ * @vue/runtime-core v3.5.31
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -448,6 +448,13 @@ function checkRecursiveUpdates(seen, fn) {
448
448
  }
449
449
 
450
450
  let isHmrUpdating = false;
451
+ const setHmrUpdating = (v) => {
452
+ try {
453
+ return isHmrUpdating;
454
+ } finally {
455
+ isHmrUpdating = v;
456
+ }
457
+ };
451
458
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
452
459
  if (!!(process.env.NODE_ENV !== "production")) {
453
460
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
@@ -1034,9 +1041,10 @@ const TeleportImpl = {
1034
1041
  mount(container, mainAnchor);
1035
1042
  updateCssVars(n2, true);
1036
1043
  }
1037
- if (isTeleportDeferred(n2.props)) {
1044
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
1038
1045
  n2.el.__isMounted = false;
1039
1046
  queuePostRenderEffect(() => {
1047
+ if (n2.el.__isMounted !== false) return;
1040
1048
  mountToTarget();
1041
1049
  delete n2.el.__isMounted;
1042
1050
  }, parentSuspense);
@@ -1044,7 +1052,12 @@ const TeleportImpl = {
1044
1052
  mountToTarget();
1045
1053
  }
1046
1054
  } else {
1047
- if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
1055
+ n2.el = n1.el;
1056
+ n2.targetStart = n1.targetStart;
1057
+ const mainAnchor = n2.anchor = n1.anchor;
1058
+ const target = n2.target = n1.target;
1059
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
1060
+ if (n1.el.__isMounted === false) {
1048
1061
  queuePostRenderEffect(() => {
1049
1062
  TeleportImpl.process(
1050
1063
  n1,
@@ -1061,11 +1074,6 @@ const TeleportImpl = {
1061
1074
  }, parentSuspense);
1062
1075
  return;
1063
1076
  }
1064
- n2.el = n1.el;
1065
- n2.targetStart = n1.targetStart;
1066
- const mainAnchor = n2.anchor = n1.anchor;
1067
- const target = n2.target = n1.target;
1068
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
1069
1077
  const wasDisabled = isTeleportDisabled(n1.props);
1070
1078
  const currentContainer = wasDisabled ? container : target;
1071
1079
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -1529,7 +1537,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1529
1537
  callHook(hook, [el]);
1530
1538
  },
1531
1539
  enter(el) {
1532
- if (leavingVNodesCache[key] === vnode) return;
1540
+ if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
1533
1541
  let hook = onEnter;
1534
1542
  let afterHook = onAfterEnter;
1535
1543
  let cancelHook = onEnterCancelled;
@@ -3177,12 +3185,16 @@ function renderList(source, renderItem, cache, index) {
3177
3185
  );
3178
3186
  }
3179
3187
  } else if (typeof source === "number") {
3180
- if (!!(process.env.NODE_ENV !== "production") && !Number.isInteger(source)) {
3181
- warn$1(`The v-for range expect an integer value but got ${source}.`);
3182
- }
3183
- ret = new Array(source);
3184
- for (let i = 0; i < source; i++) {
3185
- ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
3188
+ if (!!(process.env.NODE_ENV !== "production") && (!Number.isInteger(source) || source < 0)) {
3189
+ warn$1(
3190
+ `The v-for range expects a positive integer value but got ${source}.`
3191
+ );
3192
+ ret = [];
3193
+ } else {
3194
+ ret = new Array(source);
3195
+ for (let i = 0; i < source; i++) {
3196
+ ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
3197
+ }
3186
3198
  }
3187
3199
  } else if (isObject(source)) {
3188
3200
  if (source[Symbol.iterator]) {
@@ -3633,6 +3645,7 @@ function createPropsRestProxy(props, excludedKeys) {
3633
3645
  }
3634
3646
  function withAsyncContext(getAwaitable) {
3635
3647
  const ctx = getCurrentInstance();
3648
+ const inSSRSetup = isInSSRComponentSetup;
3636
3649
  if (!!(process.env.NODE_ENV !== "production") && !ctx) {
3637
3650
  warn$1(
3638
3651
  `withAsyncContext called without active current instance. This is likely a bug.`
@@ -3640,13 +3653,25 @@ function withAsyncContext(getAwaitable) {
3640
3653
  }
3641
3654
  let awaitable = getAwaitable();
3642
3655
  unsetCurrentInstance();
3656
+ if (inSSRSetup) {
3657
+ setInSSRSetupState(false);
3658
+ }
3659
+ const restore = () => {
3660
+ setCurrentInstance(ctx);
3661
+ if (inSSRSetup) {
3662
+ setInSSRSetupState(true);
3663
+ }
3664
+ };
3643
3665
  const cleanup = () => {
3644
3666
  if (getCurrentInstance() !== ctx) ctx.scope.off();
3645
3667
  unsetCurrentInstance();
3668
+ if (inSSRSetup) {
3669
+ setInSSRSetupState(false);
3670
+ }
3646
3671
  };
3647
3672
  if (isPromise(awaitable)) {
3648
3673
  awaitable = awaitable.catch((e) => {
3649
- setCurrentInstance(ctx);
3674
+ restore();
3650
3675
  Promise.resolve().then(() => Promise.resolve().then(cleanup));
3651
3676
  throw e;
3652
3677
  });
@@ -3654,7 +3679,7 @@ function withAsyncContext(getAwaitable) {
3654
3679
  return [
3655
3680
  awaitable,
3656
3681
  () => {
3657
- setCurrentInstance(ctx);
3682
+ restore();
3658
3683
  Promise.resolve().then(cleanup);
3659
3684
  }
3660
3685
  ];
@@ -4771,11 +4796,12 @@ function hasPropValueChanged(nextProps, prevProps, key) {
4771
4796
  }
4772
4797
  return nextProp !== prevProp;
4773
4798
  }
4774
- function updateHOCHostEl({ vnode, parent }, el) {
4799
+ function updateHOCHostEl({ vnode, parent, suspense }, el) {
4775
4800
  while (parent) {
4776
4801
  const root = parent.subTree;
4777
4802
  if (root.suspense && root.suspense.activeBranch === vnode) {
4778
- root.el = vnode.el;
4803
+ root.suspense.vnode.el = root.el = el;
4804
+ vnode = root;
4779
4805
  }
4780
4806
  if (root === vnode) {
4781
4807
  (vnode = parent.vnode).el = el;
@@ -4784,6 +4810,9 @@ function updateHOCHostEl({ vnode, parent }, el) {
4784
4810
  break;
4785
4811
  }
4786
4812
  }
4813
+ if (suspense && suspense.activeBranch === vnode) {
4814
+ suspense.vnode.el = el;
4815
+ }
4787
4816
  }
4788
4817
 
4789
4818
  const internalObjectProto = {};
@@ -5652,10 +5681,17 @@ function baseCreateRenderer(options, createHydrationFns) {
5652
5681
  }
5653
5682
  hostInsert(el, container, anchor);
5654
5683
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
5684
+ const isHmr = !!(process.env.NODE_ENV !== "production") && isHmrUpdating;
5655
5685
  queuePostRenderEffect(() => {
5656
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
5657
- needCallTransitionHooks && transition.enter(el);
5658
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
5686
+ let prev;
5687
+ if (!!(process.env.NODE_ENV !== "production")) prev = setHmrUpdating(isHmr);
5688
+ try {
5689
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
5690
+ needCallTransitionHooks && transition.enter(el);
5691
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
5692
+ } finally {
5693
+ if (!!(process.env.NODE_ENV !== "production")) setHmrUpdating(prev);
5694
+ }
5659
5695
  }, parentSuspense);
5660
5696
  }
5661
5697
  };
@@ -6071,7 +6107,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6071
6107
  }
6072
6108
  } else {
6073
6109
  if (root.ce && root.ce._hasShadowRoot()) {
6074
- root.ce._injectChildStyle(type);
6110
+ root.ce._injectChildStyle(
6111
+ type,
6112
+ instance.parent ? instance.parent.type : void 0
6113
+ );
6075
6114
  }
6076
6115
  if (!!(process.env.NODE_ENV !== "production")) {
6077
6116
  startMeasure(instance, `render`);
@@ -6584,7 +6623,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6584
6623
  shapeFlag,
6585
6624
  patchFlag,
6586
6625
  dirs,
6587
- cacheIndex
6626
+ cacheIndex,
6627
+ memo
6588
6628
  } = vnode;
6589
6629
  if (patchFlag === -2) {
6590
6630
  optimized = false;
@@ -6646,10 +6686,14 @@ function baseCreateRenderer(options, createHydrationFns) {
6646
6686
  remove(vnode);
6647
6687
  }
6648
6688
  }
6649
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
6689
+ const shouldInvalidateMemo = memo != null && cacheIndex == null;
6690
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
6650
6691
  queuePostRenderEffect(() => {
6651
6692
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
6652
6693
  shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
6694
+ if (shouldInvalidateMemo) {
6695
+ vnode.el = null;
6696
+ }
6653
6697
  }, parentSuspense);
6654
6698
  }
6655
6699
  };
@@ -7203,6 +7247,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7203
7247
  pendingId: suspenseId++,
7204
7248
  timeout: typeof timeout === "number" ? timeout : -1,
7205
7249
  activeBranch: null,
7250
+ isFallbackMountPending: false,
7206
7251
  pendingBranch: null,
7207
7252
  isInFallback: !isHydrating,
7208
7253
  isHydrating,
@@ -7252,7 +7297,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7252
7297
  }
7253
7298
  };
7254
7299
  }
7255
- if (activeBranch) {
7300
+ if (activeBranch && !suspense.isFallbackMountPending) {
7256
7301
  if (parentNode(activeBranch.el) === container2) {
7257
7302
  anchor = next(activeBranch);
7258
7303
  }
@@ -7265,6 +7310,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7265
7310
  move(pendingBranch, container2, anchor, 0);
7266
7311
  }
7267
7312
  }
7313
+ suspense.isFallbackMountPending = false;
7268
7314
  setActiveBranch(suspense, pendingBranch);
7269
7315
  suspense.pendingBranch = null;
7270
7316
  suspense.isInFallback = false;
@@ -7300,6 +7346,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7300
7346
  triggerEvent(vnode2, "onFallback");
7301
7347
  const anchor2 = next(activeBranch);
7302
7348
  const mountFallback = () => {
7349
+ suspense.isFallbackMountPending = false;
7303
7350
  if (!suspense.isInFallback) {
7304
7351
  return;
7305
7352
  }
@@ -7319,6 +7366,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7319
7366
  };
7320
7367
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
7321
7368
  if (delayEnter) {
7369
+ suspense.isFallbackMountPending = true;
7322
7370
  activeBranch.transition.afterLeave = mountFallback;
7323
7371
  }
7324
7372
  suspense.isInFallback = true;
@@ -7869,6 +7917,10 @@ function mergeProps(...args) {
7869
7917
  const incoming = toMerge[key];
7870
7918
  if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
7871
7919
  ret[key] = existing ? [].concat(existing, incoming) : incoming;
7920
+ } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
7921
+ // the model listener.
7922
+ !isModelListener(key)) {
7923
+ ret[key] = incoming;
7872
7924
  }
7873
7925
  } else if (key !== "") {
7874
7926
  ret[key] = toMerge[key];
@@ -8567,7 +8619,7 @@ function isMemoSame(cached, memo) {
8567
8619
  return true;
8568
8620
  }
8569
8621
 
8570
- const version = "3.5.29";
8622
+ const version = "3.5.31";
8571
8623
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8572
8624
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8573
8625
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.5.29",
3
+ "version": "3.5.31",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
48
48
  "dependencies": {
49
- "@vue/reactivity": "3.5.29",
50
- "@vue/shared": "3.5.29"
49
+ "@vue/shared": "3.5.31",
50
+ "@vue/reactivity": "3.5.31"
51
51
  }
52
52
  }