vue 3.5.13 → 3.5.14

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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.13
2
+ * vue v3.5.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.13
2
+ * vue v3.5.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.13
2
+ * vue v3.5.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -396,6 +396,10 @@ class EffectScope {
396
396
  * @internal
397
397
  */
398
398
  this._active = true;
399
+ /**
400
+ * @internal track `on` calls, allow `on` call multiple times
401
+ */
402
+ this._on = 0;
399
403
  /**
400
404
  * @internal
401
405
  */
@@ -466,14 +470,20 @@ class EffectScope {
466
470
  * @internal
467
471
  */
468
472
  on() {
469
- activeEffectScope = this;
473
+ if (++this._on === 1) {
474
+ this.prevScope = activeEffectScope;
475
+ activeEffectScope = this;
476
+ }
470
477
  }
471
478
  /**
472
479
  * This should only be called on non-detached scopes
473
480
  * @internal
474
481
  */
475
482
  off() {
476
- activeEffectScope = this.parent;
483
+ if (this._on > 0 && --this._on === 0) {
484
+ activeEffectScope = this.prevScope;
485
+ this.prevScope = void 0;
486
+ }
477
487
  }
478
488
  stop(fromParent) {
479
489
  if (this._active) {
@@ -555,7 +565,7 @@ class ReactiveEffect {
555
565
  }
556
566
  resume() {
557
567
  if (this.flags & 64) {
558
- this.flags &= ~64;
568
+ this.flags &= -65;
559
569
  if (pausedQueueEffects.has(this)) {
560
570
  pausedQueueEffects.delete(this);
561
571
  this.trigger();
@@ -595,7 +605,7 @@ class ReactiveEffect {
595
605
  cleanupDeps(this);
596
606
  activeSub = prevEffect;
597
607
  shouldTrack = prevShouldTrack;
598
- this.flags &= ~2;
608
+ this.flags &= -3;
599
609
  }
600
610
  }
601
611
  stop() {
@@ -606,7 +616,7 @@ class ReactiveEffect {
606
616
  this.deps = this.depsTail = void 0;
607
617
  cleanupEffect(this);
608
618
  this.onStop && this.onStop();
609
- this.flags &= ~1;
619
+ this.flags &= -2;
610
620
  }
611
621
  }
612
622
  trigger() {
@@ -656,7 +666,7 @@ function endBatch() {
656
666
  while (e) {
657
667
  const next = e.next;
658
668
  e.next = void 0;
659
- e.flags &= ~8;
669
+ e.flags &= -9;
660
670
  e = next;
661
671
  }
662
672
  }
@@ -667,7 +677,7 @@ function endBatch() {
667
677
  while (e) {
668
678
  const next = e.next;
669
679
  e.next = void 0;
670
- e.flags &= ~8;
680
+ e.flags &= -9;
671
681
  if (e.flags & 1) {
672
682
  try {
673
683
  ;
@@ -723,17 +733,16 @@ function refreshComputed(computed) {
723
733
  if (computed.flags & 4 && !(computed.flags & 16)) {
724
734
  return;
725
735
  }
726
- computed.flags &= ~16;
736
+ computed.flags &= -17;
727
737
  if (computed.globalVersion === globalVersion) {
728
738
  return;
729
739
  }
730
740
  computed.globalVersion = globalVersion;
731
- const dep = computed.dep;
732
- computed.flags |= 2;
733
- if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
734
- computed.flags &= ~2;
741
+ if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {
735
742
  return;
736
743
  }
744
+ computed.flags |= 2;
745
+ const dep = computed.dep;
737
746
  const prevSub = activeSub;
738
747
  const prevShouldTrack = shouldTrack;
739
748
  activeSub = computed;
@@ -742,6 +751,7 @@ function refreshComputed(computed) {
742
751
  prepareDeps(computed);
743
752
  const value = computed.fn(computed._value);
744
753
  if (dep.version === 0 || hasChanged(value, computed._value)) {
754
+ computed.flags |= 128;
745
755
  computed._value = value;
746
756
  dep.version++;
747
757
  }
@@ -752,7 +762,7 @@ function refreshComputed(computed) {
752
762
  activeSub = prevSub;
753
763
  shouldTrack = prevShouldTrack;
754
764
  cleanupDeps(computed);
755
- computed.flags &= ~2;
765
+ computed.flags &= -3;
756
766
  }
757
767
  }
758
768
  function removeSub(link, soft = false) {
@@ -771,7 +781,7 @@ function removeSub(link, soft = false) {
771
781
  if (dep.subs === link) {
772
782
  dep.subs = prevSub;
773
783
  if (!prevSub && dep.computed) {
774
- dep.computed.flags &= ~4;
784
+ dep.computed.flags &= -5;
775
785
  for (let l = dep.computed.deps; l; l = l.nextDep) {
776
786
  removeSub(l, true);
777
787
  }
@@ -1704,14 +1714,14 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
1704
1714
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1705
1715
  return target;
1706
1716
  }
1707
- const existingProxy = proxyMap.get(target);
1708
- if (existingProxy) {
1709
- return existingProxy;
1710
- }
1711
1717
  const targetType = getTargetType(target);
1712
1718
  if (targetType === 0 /* INVALID */) {
1713
1719
  return target;
1714
1720
  }
1721
+ const existingProxy = proxyMap.get(target);
1722
+ if (existingProxy) {
1723
+ return existingProxy;
1724
+ }
1715
1725
  const proxy = new Proxy(
1716
1726
  target,
1717
1727
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -2555,11 +2565,11 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2555
2565
  queue.splice(i, 1);
2556
2566
  i--;
2557
2567
  if (cb.flags & 4) {
2558
- cb.flags &= ~1;
2568
+ cb.flags &= -2;
2559
2569
  }
2560
2570
  cb();
2561
2571
  if (!(cb.flags & 4)) {
2562
- cb.flags &= ~1;
2572
+ cb.flags &= -2;
2563
2573
  }
2564
2574
  }
2565
2575
  }
@@ -2584,10 +2594,10 @@ function flushPostFlushCbs(seen) {
2584
2594
  continue;
2585
2595
  }
2586
2596
  if (cb.flags & 4) {
2587
- cb.flags &= ~1;
2597
+ cb.flags &= -2;
2588
2598
  }
2589
2599
  if (!(cb.flags & 8)) cb();
2590
- cb.flags &= ~1;
2600
+ cb.flags &= -2;
2591
2601
  }
2592
2602
  activePostFlushCbs = null;
2593
2603
  postFlushIndex = 0;
@@ -2623,7 +2633,7 @@ function flushJobs(seen) {
2623
2633
  for (; flushIndex < queue.length; flushIndex++) {
2624
2634
  const job = queue[flushIndex];
2625
2635
  if (job) {
2626
- job.flags &= ~1;
2636
+ job.flags &= -2;
2627
2637
  }
2628
2638
  }
2629
2639
  flushIndex = -1;
@@ -3112,7 +3122,7 @@ const TeleportImpl = {
3112
3122
  namespace,
3113
3123
  slotScopeIds
3114
3124
  );
3115
- traverseStaticChildren(n1, n2, true);
3125
+ traverseStaticChildren(n1, n2, false);
3116
3126
  } else if (!optimized) {
3117
3127
  patchChildren(
3118
3128
  n1,
@@ -4797,6 +4807,9 @@ const KeepAliveImpl = {
4797
4807
  {
4798
4808
  devtoolsComponentAdded(instance2);
4799
4809
  }
4810
+ {
4811
+ instance2.__keepAliveStorageContainer = storageContainer;
4812
+ }
4800
4813
  };
4801
4814
  function unmount(vnode) {
4802
4815
  resetShapeFlag(vnode);
@@ -4884,7 +4897,7 @@ const KeepAliveImpl = {
4884
4897
  );
4885
4898
  const { include, exclude, max } = props;
4886
4899
  if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
4887
- vnode.shapeFlag &= ~256;
4900
+ vnode.shapeFlag &= -257;
4888
4901
  current = vnode;
4889
4902
  return rawVNode;
4890
4903
  }
@@ -4971,8 +4984,8 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4971
4984
  }, target);
4972
4985
  }
4973
4986
  function resetShapeFlag(vnode) {
4974
- vnode.shapeFlag &= ~256;
4975
- vnode.shapeFlag &= ~512;
4987
+ vnode.shapeFlag &= -257;
4988
+ vnode.shapeFlag &= -513;
4976
4989
  }
4977
4990
  function getInnerChild(vnode) {
4978
4991
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
@@ -5087,14 +5100,16 @@ function renderList(source, renderItem, cache, index) {
5087
5100
  if (sourceIsArray || isString(source)) {
5088
5101
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5089
5102
  let needsWrap = false;
5103
+ let isReadonlySource = false;
5090
5104
  if (sourceIsReactiveArray) {
5091
5105
  needsWrap = !isShallow(source);
5106
+ isReadonlySource = isReadonly(source);
5092
5107
  source = shallowReadArray(source);
5093
5108
  }
5094
5109
  ret = new Array(source.length);
5095
5110
  for (let i = 0, l = source.length; i < l; i++) {
5096
5111
  ret[i] = renderItem(
5097
- needsWrap ? toReactive(source[i]) : source[i],
5112
+ needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
5098
5113
  i,
5099
5114
  void 0,
5100
5115
  cached && cached[i]
@@ -6116,11 +6131,9 @@ function createAppAPI(render, hydrate) {
6116
6131
  }
6117
6132
  {
6118
6133
  context.reload = () => {
6119
- render(
6120
- cloneVNode(vnode),
6121
- rootContainer,
6122
- namespace
6123
- );
6134
+ const cloned = cloneVNode(vnode);
6135
+ cloned.el = null;
6136
+ render(cloned, rootContainer, namespace);
6124
6137
  };
6125
6138
  }
6126
6139
  if (isHydrate && hydrate) {
@@ -6643,7 +6656,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
6643
6656
  return rawSlot;
6644
6657
  }
6645
6658
  const normalized = withCtx((...args) => {
6646
- if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
6659
+ if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
6647
6660
  warn$1(
6648
6661
  `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
6649
6662
  );
@@ -6682,7 +6695,7 @@ const normalizeVNodeSlots = (instance, children) => {
6682
6695
  };
6683
6696
  const assignSlots = (slots, children, optimized) => {
6684
6697
  for (const key in children) {
6685
- if (optimized || key !== "_") {
6698
+ if (optimized || !isInternalKey(key)) {
6686
6699
  slots[key] = children[key];
6687
6700
  }
6688
6701
  }
@@ -7368,8 +7381,8 @@ function baseCreateRenderer(options, createHydrationFns) {
7368
7381
  endMeasure(instance, `init`);
7369
7382
  }
7370
7383
  }
7384
+ if (isHmrUpdating) initialVNode.el = null;
7371
7385
  if (instance.asyncDep) {
7372
- if (isHmrUpdating) initialVNode.el = null;
7373
7386
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
7374
7387
  if (!initialVNode.el) {
7375
7388
  const placeholder = instance.subTree = createVNode(Comment);
@@ -7931,7 +7944,13 @@ function baseCreateRenderer(options, createHydrationFns) {
7931
7944
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
7932
7945
  } else {
7933
7946
  const { leave, delayLeave, afterLeave } = transition;
7934
- const remove2 = () => hostInsert(el, container, anchor);
7947
+ const remove2 = () => {
7948
+ if (vnode.ctx.isUnmounted) {
7949
+ hostRemove(el);
7950
+ } else {
7951
+ hostInsert(el, container, anchor);
7952
+ }
7953
+ };
7935
7954
  const performLeave = () => {
7936
7955
  leave(el, () => {
7937
7956
  remove2();
@@ -7964,7 +7983,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7964
7983
  optimized = false;
7965
7984
  }
7966
7985
  if (ref != null) {
7986
+ pauseTracking();
7967
7987
  setRef(ref, null, parentSuspense, vnode, true);
7988
+ resetTracking();
7968
7989
  }
7969
7990
  if (cacheIndex != null) {
7970
7991
  parentComponent.renderCache[cacheIndex] = void 0;
@@ -8076,12 +8097,27 @@ function baseCreateRenderer(options, createHydrationFns) {
8076
8097
  if (instance.type.__hmrId) {
8077
8098
  unregisterHMR(instance);
8078
8099
  }
8079
- const { bum, scope, job, subTree, um, m, a } = instance;
8100
+ const {
8101
+ bum,
8102
+ scope,
8103
+ job,
8104
+ subTree,
8105
+ um,
8106
+ m,
8107
+ a,
8108
+ parent,
8109
+ slots: { __: slotCacheKeys }
8110
+ } = instance;
8080
8111
  invalidateMount(m);
8081
8112
  invalidateMount(a);
8082
8113
  if (bum) {
8083
8114
  invokeArrayFns(bum);
8084
8115
  }
8116
+ if (parent && isArray(slotCacheKeys)) {
8117
+ slotCacheKeys.forEach((v) => {
8118
+ parent.renderCache[v] = void 0;
8119
+ });
8120
+ }
8085
8121
  scope.stop();
8086
8122
  if (job) {
8087
8123
  job.flags |= 8;
@@ -8177,8 +8213,8 @@ function toggleRecurse({ effect, job }, allowed) {
8177
8213
  effect.flags |= 32;
8178
8214
  job.flags |= 4;
8179
8215
  } else {
8180
- effect.flags &= ~32;
8181
- job.flags &= ~4;
8216
+ effect.flags &= -33;
8217
+ job.flags &= -5;
8182
8218
  }
8183
8219
  }
8184
8220
  function needTransition(parentSuspense, transition) {
@@ -8205,6 +8241,9 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8205
8241
  if (c2.type === Comment && !c2.el) {
8206
8242
  c2.el = c1.el;
8207
8243
  }
8244
+ {
8245
+ c2.el && (c2.el.__vnode = c2);
8246
+ }
8208
8247
  }
8209
8248
  }
8210
8249
  }
@@ -9550,8 +9589,8 @@ function isSameVNodeType(n1, n2) {
9550
9589
  if (n2.shapeFlag & 6 && n1.component) {
9551
9590
  const dirtyInstances = hmrDirtyComponents.get(n2.type);
9552
9591
  if (dirtyInstances && dirtyInstances.has(n1.component)) {
9553
- n1.shapeFlag &= ~256;
9554
- n2.shapeFlag &= ~512;
9592
+ n1.shapeFlag &= -257;
9593
+ n2.shapeFlag &= -513;
9555
9594
  return false;
9556
9595
  }
9557
9596
  }
@@ -10012,7 +10051,7 @@ function setupComponent(instance, isSSR = false, optimized = false) {
10012
10051
  const { props, children } = instance.vnode;
10013
10052
  const isStateful = isStatefulComponent(instance);
10014
10053
  initProps(instance, props, isStateful, isSSR);
10015
- initSlots(instance, children, optimized);
10054
+ initSlots(instance, children, optimized || isSSR);
10016
10055
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
10017
10056
  isSSR && setInSSRSetupState(false);
10018
10057
  return setupResult;
@@ -10343,13 +10382,15 @@ function initCustomFormatter() {
10343
10382
  if (obj.__isVue) {
10344
10383
  return ["div", vueStyle, `VueInstance`];
10345
10384
  } else if (isRef(obj)) {
10385
+ pauseTracking();
10386
+ const value = obj.value;
10387
+ resetTracking();
10346
10388
  return [
10347
10389
  "div",
10348
10390
  {},
10349
10391
  ["span", vueStyle, genRefFlag(obj)],
10350
10392
  "<",
10351
- // avoid debugger accessing value affecting behavior
10352
- formatValue("_value" in obj ? obj._value : obj),
10393
+ formatValue(value),
10353
10394
  `>`
10354
10395
  ];
10355
10396
  } else if (isReactive(obj)) {
@@ -10530,7 +10571,7 @@ function isMemoSame(cached, memo) {
10530
10571
  return true;
10531
10572
  }
10532
10573
 
10533
- const version = "3.5.13";
10574
+ const version = "3.5.14";
10534
10575
  const warn = warn$1 ;
10535
10576
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10536
10577
  const devtools = devtools$1 ;
@@ -11348,7 +11389,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
11348
11389
  }
11349
11390
  return false;
11350
11391
  }
11351
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
11392
+ if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
11352
11393
  return false;
11353
11394
  }
11354
11395
  if (key === "form") {
@@ -11837,6 +11878,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11837
11878
  instance.vnode.el,
11838
11879
  moveClass
11839
11880
  )) {
11881
+ prevChildren = [];
11840
11882
  return;
11841
11883
  }
11842
11884
  prevChildren.forEach(callPendingCbs);
@@ -11860,6 +11902,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11860
11902
  };
11861
11903
  el.addEventListener("transitionend", cb);
11862
11904
  });
11905
+ prevChildren = [];
11863
11906
  });
11864
11907
  return () => {
11865
11908
  const rawProps = toRaw(props);
@@ -14709,6 +14752,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14709
14752
  }
14710
14753
  }
14711
14754
  let cachedAsArray = false;
14755
+ const slotCacheKeys = [];
14712
14756
  if (toCache.length === children.length && node.type === 1) {
14713
14757
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
14714
14758
  node.codegenNode.children = getCacheExpression(
@@ -14718,6 +14762,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14718
14762
  } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
14719
14763
  const slot = getSlotNode(node.codegenNode, "default");
14720
14764
  if (slot) {
14765
+ slotCacheKeys.push(context.cached.length);
14721
14766
  slot.returns = getCacheExpression(
14722
14767
  createArrayExpression(slot.returns)
14723
14768
  );
@@ -14727,6 +14772,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14727
14772
  const slotName = findDir(node, "slot", true);
14728
14773
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
14729
14774
  if (slot) {
14775
+ slotCacheKeys.push(context.cached.length);
14730
14776
  slot.returns = getCacheExpression(
14731
14777
  createArrayExpression(slot.returns)
14732
14778
  );
@@ -14736,9 +14782,18 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14736
14782
  }
14737
14783
  if (!cachedAsArray) {
14738
14784
  for (const child of toCache) {
14785
+ slotCacheKeys.push(context.cached.length);
14739
14786
  child.codegenNode = context.cache(child.codegenNode);
14740
14787
  }
14741
14788
  }
14789
+ if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
14790
+ node.codegenNode.children.properties.push(
14791
+ createObjectProperty(
14792
+ `__`,
14793
+ createSimpleExpression(JSON.stringify(slotCacheKeys), false)
14794
+ )
14795
+ );
14796
+ }
14742
14797
  function getCacheExpression(value) {
14743
14798
  const exp = context.cache(value);
14744
14799
  if (inFor && context.hmr) {
@@ -17383,8 +17438,7 @@ const transformModel$1 = (dir, node, context) => {
17383
17438
  context.onError(createCompilerError(44, exp.loc));
17384
17439
  return createTransformProps();
17385
17440
  }
17386
- const maybeRef = false;
17387
- if (!expString.trim() || !isMemberExpression(exp) && !maybeRef) {
17441
+ if (!expString.trim() || !isMemberExpression(exp) && true) {
17388
17442
  context.onError(
17389
17443
  createCompilerError(42, exp.loc)
17390
17444
  );