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.
@@ -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
  **/
@@ -323,6 +323,10 @@ class EffectScope {
323
323
  * @internal
324
324
  */
325
325
  this._active = true;
326
+ /**
327
+ * @internal track `on` calls, allow `on` call multiple times
328
+ */
329
+ this._on = 0;
326
330
  /**
327
331
  * @internal
328
332
  */
@@ -393,14 +397,20 @@ class EffectScope {
393
397
  * @internal
394
398
  */
395
399
  on() {
396
- activeEffectScope = this;
400
+ if (++this._on === 1) {
401
+ this.prevScope = activeEffectScope;
402
+ activeEffectScope = this;
403
+ }
397
404
  }
398
405
  /**
399
406
  * This should only be called on non-detached scopes
400
407
  * @internal
401
408
  */
402
409
  off() {
403
- activeEffectScope = this.parent;
410
+ if (this._on > 0 && --this._on === 0) {
411
+ activeEffectScope = this.prevScope;
412
+ this.prevScope = void 0;
413
+ }
404
414
  }
405
415
  stop(fromParent) {
406
416
  if (this._active) {
@@ -482,7 +492,7 @@ class ReactiveEffect {
482
492
  }
483
493
  resume() {
484
494
  if (this.flags & 64) {
485
- this.flags &= ~64;
495
+ this.flags &= -65;
486
496
  if (pausedQueueEffects.has(this)) {
487
497
  pausedQueueEffects.delete(this);
488
498
  this.trigger();
@@ -522,7 +532,7 @@ class ReactiveEffect {
522
532
  cleanupDeps(this);
523
533
  activeSub = prevEffect;
524
534
  shouldTrack = prevShouldTrack;
525
- this.flags &= ~2;
535
+ this.flags &= -3;
526
536
  }
527
537
  }
528
538
  stop() {
@@ -533,7 +543,7 @@ class ReactiveEffect {
533
543
  this.deps = this.depsTail = void 0;
534
544
  cleanupEffect(this);
535
545
  this.onStop && this.onStop();
536
- this.flags &= ~1;
546
+ this.flags &= -2;
537
547
  }
538
548
  }
539
549
  trigger() {
@@ -583,7 +593,7 @@ function endBatch() {
583
593
  while (e) {
584
594
  const next = e.next;
585
595
  e.next = void 0;
586
- e.flags &= ~8;
596
+ e.flags &= -9;
587
597
  e = next;
588
598
  }
589
599
  }
@@ -594,7 +604,7 @@ function endBatch() {
594
604
  while (e) {
595
605
  const next = e.next;
596
606
  e.next = void 0;
597
- e.flags &= ~8;
607
+ e.flags &= -9;
598
608
  if (e.flags & 1) {
599
609
  try {
600
610
  ;
@@ -650,17 +660,16 @@ function refreshComputed(computed) {
650
660
  if (computed.flags & 4 && !(computed.flags & 16)) {
651
661
  return;
652
662
  }
653
- computed.flags &= ~16;
663
+ computed.flags &= -17;
654
664
  if (computed.globalVersion === globalVersion) {
655
665
  return;
656
666
  }
657
667
  computed.globalVersion = globalVersion;
658
- const dep = computed.dep;
659
- computed.flags |= 2;
660
- if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
661
- computed.flags &= ~2;
668
+ if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {
662
669
  return;
663
670
  }
671
+ computed.flags |= 2;
672
+ const dep = computed.dep;
664
673
  const prevSub = activeSub;
665
674
  const prevShouldTrack = shouldTrack;
666
675
  activeSub = computed;
@@ -669,6 +678,7 @@ function refreshComputed(computed) {
669
678
  prepareDeps(computed);
670
679
  const value = computed.fn(computed._value);
671
680
  if (dep.version === 0 || hasChanged(value, computed._value)) {
681
+ computed.flags |= 128;
672
682
  computed._value = value;
673
683
  dep.version++;
674
684
  }
@@ -679,7 +689,7 @@ function refreshComputed(computed) {
679
689
  activeSub = prevSub;
680
690
  shouldTrack = prevShouldTrack;
681
691
  cleanupDeps(computed);
682
- computed.flags &= ~2;
692
+ computed.flags &= -3;
683
693
  }
684
694
  }
685
695
  function removeSub(link, soft = false) {
@@ -698,7 +708,7 @@ function removeSub(link, soft = false) {
698
708
  if (dep.subs === link) {
699
709
  dep.subs = prevSub;
700
710
  if (!prevSub && dep.computed) {
701
- dep.computed.flags &= ~4;
711
+ dep.computed.flags &= -5;
702
712
  for (let l = dep.computed.deps; l; l = l.nextDep) {
703
713
  removeSub(l, true);
704
714
  }
@@ -1631,14 +1641,14 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
1631
1641
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1632
1642
  return target;
1633
1643
  }
1634
- const existingProxy = proxyMap.get(target);
1635
- if (existingProxy) {
1636
- return existingProxy;
1637
- }
1638
1644
  const targetType = getTargetType(target);
1639
1645
  if (targetType === 0 /* INVALID */) {
1640
1646
  return target;
1641
1647
  }
1648
+ const existingProxy = proxyMap.get(target);
1649
+ if (existingProxy) {
1650
+ return existingProxy;
1651
+ }
1642
1652
  const proxy = new Proxy(
1643
1653
  target,
1644
1654
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -2482,11 +2492,11 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2482
2492
  queue.splice(i, 1);
2483
2493
  i--;
2484
2494
  if (cb.flags & 4) {
2485
- cb.flags &= ~1;
2495
+ cb.flags &= -2;
2486
2496
  }
2487
2497
  cb();
2488
2498
  if (!(cb.flags & 4)) {
2489
- cb.flags &= ~1;
2499
+ cb.flags &= -2;
2490
2500
  }
2491
2501
  }
2492
2502
  }
@@ -2511,10 +2521,10 @@ function flushPostFlushCbs(seen) {
2511
2521
  continue;
2512
2522
  }
2513
2523
  if (cb.flags & 4) {
2514
- cb.flags &= ~1;
2524
+ cb.flags &= -2;
2515
2525
  }
2516
2526
  if (!(cb.flags & 8)) cb();
2517
- cb.flags &= ~1;
2527
+ cb.flags &= -2;
2518
2528
  }
2519
2529
  activePostFlushCbs = null;
2520
2530
  postFlushIndex = 0;
@@ -2550,7 +2560,7 @@ function flushJobs(seen) {
2550
2560
  for (; flushIndex < queue.length; flushIndex++) {
2551
2561
  const job = queue[flushIndex];
2552
2562
  if (job) {
2553
- job.flags &= ~1;
2563
+ job.flags &= -2;
2554
2564
  }
2555
2565
  }
2556
2566
  flushIndex = -1;
@@ -3039,7 +3049,7 @@ const TeleportImpl = {
3039
3049
  namespace,
3040
3050
  slotScopeIds
3041
3051
  );
3042
- traverseStaticChildren(n1, n2, true);
3052
+ traverseStaticChildren(n1, n2, false);
3043
3053
  } else if (!optimized) {
3044
3054
  patchChildren(
3045
3055
  n1,
@@ -4724,6 +4734,9 @@ const KeepAliveImpl = {
4724
4734
  {
4725
4735
  devtoolsComponentAdded(instance2);
4726
4736
  }
4737
+ {
4738
+ instance2.__keepAliveStorageContainer = storageContainer;
4739
+ }
4727
4740
  };
4728
4741
  function unmount(vnode) {
4729
4742
  resetShapeFlag(vnode);
@@ -4811,7 +4824,7 @@ const KeepAliveImpl = {
4811
4824
  );
4812
4825
  const { include, exclude, max } = props;
4813
4826
  if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
4814
- vnode.shapeFlag &= ~256;
4827
+ vnode.shapeFlag &= -257;
4815
4828
  current = vnode;
4816
4829
  return rawVNode;
4817
4830
  }
@@ -4898,8 +4911,8 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4898
4911
  }, target);
4899
4912
  }
4900
4913
  function resetShapeFlag(vnode) {
4901
- vnode.shapeFlag &= ~256;
4902
- vnode.shapeFlag &= ~512;
4914
+ vnode.shapeFlag &= -257;
4915
+ vnode.shapeFlag &= -513;
4903
4916
  }
4904
4917
  function getInnerChild(vnode) {
4905
4918
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
@@ -5014,14 +5027,16 @@ function renderList(source, renderItem, cache, index) {
5014
5027
  if (sourceIsArray || isString(source)) {
5015
5028
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5016
5029
  let needsWrap = false;
5030
+ let isReadonlySource = false;
5017
5031
  if (sourceIsReactiveArray) {
5018
5032
  needsWrap = !isShallow(source);
5033
+ isReadonlySource = isReadonly(source);
5019
5034
  source = shallowReadArray(source);
5020
5035
  }
5021
5036
  ret = new Array(source.length);
5022
5037
  for (let i = 0, l = source.length; i < l; i++) {
5023
5038
  ret[i] = renderItem(
5024
- needsWrap ? toReactive(source[i]) : source[i],
5039
+ needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
5025
5040
  i,
5026
5041
  void 0,
5027
5042
  cached && cached[i]
@@ -6043,11 +6058,9 @@ function createAppAPI(render, hydrate) {
6043
6058
  }
6044
6059
  {
6045
6060
  context.reload = () => {
6046
- render(
6047
- cloneVNode(vnode),
6048
- rootContainer,
6049
- namespace
6050
- );
6061
+ const cloned = cloneVNode(vnode);
6062
+ cloned.el = null;
6063
+ render(cloned, rootContainer, namespace);
6051
6064
  };
6052
6065
  }
6053
6066
  if (isHydrate && hydrate) {
@@ -6570,7 +6583,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
6570
6583
  return rawSlot;
6571
6584
  }
6572
6585
  const normalized = withCtx((...args) => {
6573
- if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
6586
+ if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
6574
6587
  warn$1(
6575
6588
  `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.`
6576
6589
  );
@@ -6609,7 +6622,7 @@ const normalizeVNodeSlots = (instance, children) => {
6609
6622
  };
6610
6623
  const assignSlots = (slots, children, optimized) => {
6611
6624
  for (const key in children) {
6612
- if (optimized || key !== "_") {
6625
+ if (optimized || !isInternalKey(key)) {
6613
6626
  slots[key] = children[key];
6614
6627
  }
6615
6628
  }
@@ -7295,8 +7308,8 @@ function baseCreateRenderer(options, createHydrationFns) {
7295
7308
  endMeasure(instance, `init`);
7296
7309
  }
7297
7310
  }
7311
+ if (isHmrUpdating) initialVNode.el = null;
7298
7312
  if (instance.asyncDep) {
7299
- if (isHmrUpdating) initialVNode.el = null;
7300
7313
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
7301
7314
  if (!initialVNode.el) {
7302
7315
  const placeholder = instance.subTree = createVNode(Comment);
@@ -7858,7 +7871,13 @@ function baseCreateRenderer(options, createHydrationFns) {
7858
7871
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
7859
7872
  } else {
7860
7873
  const { leave, delayLeave, afterLeave } = transition;
7861
- const remove2 = () => hostInsert(el, container, anchor);
7874
+ const remove2 = () => {
7875
+ if (vnode.ctx.isUnmounted) {
7876
+ hostRemove(el);
7877
+ } else {
7878
+ hostInsert(el, container, anchor);
7879
+ }
7880
+ };
7862
7881
  const performLeave = () => {
7863
7882
  leave(el, () => {
7864
7883
  remove2();
@@ -7891,7 +7910,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7891
7910
  optimized = false;
7892
7911
  }
7893
7912
  if (ref != null) {
7913
+ pauseTracking();
7894
7914
  setRef(ref, null, parentSuspense, vnode, true);
7915
+ resetTracking();
7895
7916
  }
7896
7917
  if (cacheIndex != null) {
7897
7918
  parentComponent.renderCache[cacheIndex] = void 0;
@@ -8003,12 +8024,27 @@ function baseCreateRenderer(options, createHydrationFns) {
8003
8024
  if (instance.type.__hmrId) {
8004
8025
  unregisterHMR(instance);
8005
8026
  }
8006
- const { bum, scope, job, subTree, um, m, a } = instance;
8027
+ const {
8028
+ bum,
8029
+ scope,
8030
+ job,
8031
+ subTree,
8032
+ um,
8033
+ m,
8034
+ a,
8035
+ parent,
8036
+ slots: { __: slotCacheKeys }
8037
+ } = instance;
8007
8038
  invalidateMount(m);
8008
8039
  invalidateMount(a);
8009
8040
  if (bum) {
8010
8041
  invokeArrayFns(bum);
8011
8042
  }
8043
+ if (parent && isArray(slotCacheKeys)) {
8044
+ slotCacheKeys.forEach((v) => {
8045
+ parent.renderCache[v] = void 0;
8046
+ });
8047
+ }
8012
8048
  scope.stop();
8013
8049
  if (job) {
8014
8050
  job.flags |= 8;
@@ -8104,8 +8140,8 @@ function toggleRecurse({ effect, job }, allowed) {
8104
8140
  effect.flags |= 32;
8105
8141
  job.flags |= 4;
8106
8142
  } else {
8107
- effect.flags &= ~32;
8108
- job.flags &= ~4;
8143
+ effect.flags &= -33;
8144
+ job.flags &= -5;
8109
8145
  }
8110
8146
  }
8111
8147
  function needTransition(parentSuspense, transition) {
@@ -8132,6 +8168,9 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8132
8168
  if (c2.type === Comment && !c2.el) {
8133
8169
  c2.el = c1.el;
8134
8170
  }
8171
+ {
8172
+ c2.el && (c2.el.__vnode = c2);
8173
+ }
8135
8174
  }
8136
8175
  }
8137
8176
  }
@@ -9477,8 +9516,8 @@ function isSameVNodeType(n1, n2) {
9477
9516
  if (n2.shapeFlag & 6 && n1.component) {
9478
9517
  const dirtyInstances = hmrDirtyComponents.get(n2.type);
9479
9518
  if (dirtyInstances && dirtyInstances.has(n1.component)) {
9480
- n1.shapeFlag &= ~256;
9481
- n2.shapeFlag &= ~512;
9519
+ n1.shapeFlag &= -257;
9520
+ n2.shapeFlag &= -513;
9482
9521
  return false;
9483
9522
  }
9484
9523
  }
@@ -9939,7 +9978,7 @@ function setupComponent(instance, isSSR = false, optimized = false) {
9939
9978
  const { props, children } = instance.vnode;
9940
9979
  const isStateful = isStatefulComponent(instance);
9941
9980
  initProps(instance, props, isStateful, isSSR);
9942
- initSlots(instance, children, optimized);
9981
+ initSlots(instance, children, optimized || isSSR);
9943
9982
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
9944
9983
  isSSR && setInSSRSetupState(false);
9945
9984
  return setupResult;
@@ -10270,13 +10309,15 @@ function initCustomFormatter() {
10270
10309
  if (obj.__isVue) {
10271
10310
  return ["div", vueStyle, `VueInstance`];
10272
10311
  } else if (isRef(obj)) {
10312
+ pauseTracking();
10313
+ const value = obj.value;
10314
+ resetTracking();
10273
10315
  return [
10274
10316
  "div",
10275
10317
  {},
10276
10318
  ["span", vueStyle, genRefFlag(obj)],
10277
10319
  "<",
10278
- // avoid debugger accessing value affecting behavior
10279
- formatValue("_value" in obj ? obj._value : obj),
10320
+ formatValue(value),
10280
10321
  `>`
10281
10322
  ];
10282
10323
  } else if (isReactive(obj)) {
@@ -10457,7 +10498,7 @@ function isMemoSame(cached, memo) {
10457
10498
  return true;
10458
10499
  }
10459
10500
 
10460
- const version = "3.5.13";
10501
+ const version = "3.5.14";
10461
10502
  const warn = warn$1 ;
10462
10503
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10463
10504
  const devtools = devtools$1 ;
@@ -11275,7 +11316,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
11275
11316
  }
11276
11317
  return false;
11277
11318
  }
11278
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
11319
+ if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
11279
11320
  return false;
11280
11321
  }
11281
11322
  if (key === "form") {
@@ -11764,6 +11805,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11764
11805
  instance.vnode.el,
11765
11806
  moveClass
11766
11807
  )) {
11808
+ prevChildren = [];
11767
11809
  return;
11768
11810
  }
11769
11811
  prevChildren.forEach(callPendingCbs);
@@ -11787,6 +11829,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11787
11829
  };
11788
11830
  el.addEventListener("transitionend", cb);
11789
11831
  });
11832
+ prevChildren = [];
11790
11833
  });
11791
11834
  return () => {
11792
11835
  const rawProps = toRaw(props);