@vue/compat 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/compat v3.5.13
2
+ * @vue/compat v3.5.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -326,6 +326,10 @@ var Vue = (function () {
326
326
  * @internal
327
327
  */
328
328
  this._active = true;
329
+ /**
330
+ * @internal track `on` calls, allow `on` call multiple times
331
+ */
332
+ this._on = 0;
329
333
  /**
330
334
  * @internal
331
335
  */
@@ -396,14 +400,20 @@ var Vue = (function () {
396
400
  * @internal
397
401
  */
398
402
  on() {
399
- activeEffectScope = this;
403
+ if (++this._on === 1) {
404
+ this.prevScope = activeEffectScope;
405
+ activeEffectScope = this;
406
+ }
400
407
  }
401
408
  /**
402
409
  * This should only be called on non-detached scopes
403
410
  * @internal
404
411
  */
405
412
  off() {
406
- activeEffectScope = this.parent;
413
+ if (this._on > 0 && --this._on === 0) {
414
+ activeEffectScope = this.prevScope;
415
+ this.prevScope = void 0;
416
+ }
407
417
  }
408
418
  stop(fromParent) {
409
419
  if (this._active) {
@@ -485,7 +495,7 @@ var Vue = (function () {
485
495
  }
486
496
  resume() {
487
497
  if (this.flags & 64) {
488
- this.flags &= ~64;
498
+ this.flags &= -65;
489
499
  if (pausedQueueEffects.has(this)) {
490
500
  pausedQueueEffects.delete(this);
491
501
  this.trigger();
@@ -525,7 +535,7 @@ var Vue = (function () {
525
535
  cleanupDeps(this);
526
536
  activeSub = prevEffect;
527
537
  shouldTrack = prevShouldTrack;
528
- this.flags &= ~2;
538
+ this.flags &= -3;
529
539
  }
530
540
  }
531
541
  stop() {
@@ -536,7 +546,7 @@ var Vue = (function () {
536
546
  this.deps = this.depsTail = void 0;
537
547
  cleanupEffect(this);
538
548
  this.onStop && this.onStop();
539
- this.flags &= ~1;
549
+ this.flags &= -2;
540
550
  }
541
551
  }
542
552
  trigger() {
@@ -586,7 +596,7 @@ var Vue = (function () {
586
596
  while (e) {
587
597
  const next = e.next;
588
598
  e.next = void 0;
589
- e.flags &= ~8;
599
+ e.flags &= -9;
590
600
  e = next;
591
601
  }
592
602
  }
@@ -597,7 +607,7 @@ var Vue = (function () {
597
607
  while (e) {
598
608
  const next = e.next;
599
609
  e.next = void 0;
600
- e.flags &= ~8;
610
+ e.flags &= -9;
601
611
  if (e.flags & 1) {
602
612
  try {
603
613
  ;
@@ -653,17 +663,16 @@ var Vue = (function () {
653
663
  if (computed.flags & 4 && !(computed.flags & 16)) {
654
664
  return;
655
665
  }
656
- computed.flags &= ~16;
666
+ computed.flags &= -17;
657
667
  if (computed.globalVersion === globalVersion) {
658
668
  return;
659
669
  }
660
670
  computed.globalVersion = globalVersion;
661
- const dep = computed.dep;
662
- computed.flags |= 2;
663
- if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
664
- computed.flags &= ~2;
671
+ if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {
665
672
  return;
666
673
  }
674
+ computed.flags |= 2;
675
+ const dep = computed.dep;
667
676
  const prevSub = activeSub;
668
677
  const prevShouldTrack = shouldTrack;
669
678
  activeSub = computed;
@@ -672,6 +681,7 @@ var Vue = (function () {
672
681
  prepareDeps(computed);
673
682
  const value = computed.fn(computed._value);
674
683
  if (dep.version === 0 || hasChanged(value, computed._value)) {
684
+ computed.flags |= 128;
675
685
  computed._value = value;
676
686
  dep.version++;
677
687
  }
@@ -682,7 +692,7 @@ var Vue = (function () {
682
692
  activeSub = prevSub;
683
693
  shouldTrack = prevShouldTrack;
684
694
  cleanupDeps(computed);
685
- computed.flags &= ~2;
695
+ computed.flags &= -3;
686
696
  }
687
697
  }
688
698
  function removeSub(link, soft = false) {
@@ -701,7 +711,7 @@ var Vue = (function () {
701
711
  if (dep.subs === link) {
702
712
  dep.subs = prevSub;
703
713
  if (!prevSub && dep.computed) {
704
- dep.computed.flags &= ~4;
714
+ dep.computed.flags &= -5;
705
715
  for (let l = dep.computed.deps; l; l = l.nextDep) {
706
716
  removeSub(l, true);
707
717
  }
@@ -1634,14 +1644,14 @@ var Vue = (function () {
1634
1644
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1635
1645
  return target;
1636
1646
  }
1637
- const existingProxy = proxyMap.get(target);
1638
- if (existingProxy) {
1639
- return existingProxy;
1640
- }
1641
1647
  const targetType = getTargetType(target);
1642
1648
  if (targetType === 0 /* INVALID */) {
1643
1649
  return target;
1644
1650
  }
1651
+ const existingProxy = proxyMap.get(target);
1652
+ if (existingProxy) {
1653
+ return existingProxy;
1654
+ }
1645
1655
  const proxy = new Proxy(
1646
1656
  target,
1647
1657
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -2485,11 +2495,11 @@ var Vue = (function () {
2485
2495
  queue.splice(i, 1);
2486
2496
  i--;
2487
2497
  if (cb.flags & 4) {
2488
- cb.flags &= ~1;
2498
+ cb.flags &= -2;
2489
2499
  }
2490
2500
  cb();
2491
2501
  if (!(cb.flags & 4)) {
2492
- cb.flags &= ~1;
2502
+ cb.flags &= -2;
2493
2503
  }
2494
2504
  }
2495
2505
  }
@@ -2514,10 +2524,10 @@ var Vue = (function () {
2514
2524
  continue;
2515
2525
  }
2516
2526
  if (cb.flags & 4) {
2517
- cb.flags &= ~1;
2527
+ cb.flags &= -2;
2518
2528
  }
2519
2529
  if (!(cb.flags & 8)) cb();
2520
- cb.flags &= ~1;
2530
+ cb.flags &= -2;
2521
2531
  }
2522
2532
  activePostFlushCbs = null;
2523
2533
  postFlushIndex = 0;
@@ -2553,7 +2563,7 @@ var Vue = (function () {
2553
2563
  for (; flushIndex < queue.length; flushIndex++) {
2554
2564
  const job = queue[flushIndex];
2555
2565
  if (job) {
2556
- job.flags &= ~1;
2566
+ job.flags &= -2;
2557
2567
  }
2558
2568
  }
2559
2569
  flushIndex = -1;
@@ -3570,7 +3580,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3570
3580
  namespace,
3571
3581
  slotScopeIds
3572
3582
  );
3573
- traverseStaticChildren(n1, n2, true);
3583
+ traverseStaticChildren(n1, n2, false);
3574
3584
  } else if (!optimized) {
3575
3585
  patchChildren(
3576
3586
  n1,
@@ -5252,6 +5262,9 @@ Server rendered element contains fewer child nodes than client vdom.`
5252
5262
  {
5253
5263
  devtoolsComponentAdded(instance2);
5254
5264
  }
5265
+ {
5266
+ instance2.__keepAliveStorageContainer = storageContainer;
5267
+ }
5255
5268
  };
5256
5269
  function unmount(vnode) {
5257
5270
  resetShapeFlag(vnode);
@@ -5339,7 +5352,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5339
5352
  );
5340
5353
  const { include, exclude, max } = props;
5341
5354
  if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
5342
- vnode.shapeFlag &= ~256;
5355
+ vnode.shapeFlag &= -257;
5343
5356
  current = vnode;
5344
5357
  return rawVNode;
5345
5358
  }
@@ -5430,8 +5443,8 @@ Server rendered element contains fewer child nodes than client vdom.`
5430
5443
  }, target);
5431
5444
  }
5432
5445
  function resetShapeFlag(vnode) {
5433
- vnode.shapeFlag &= ~256;
5434
- vnode.shapeFlag &= ~512;
5446
+ vnode.shapeFlag &= -257;
5447
+ vnode.shapeFlag &= -513;
5435
5448
  }
5436
5449
  function getInnerChild(vnode) {
5437
5450
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
@@ -5833,14 +5846,16 @@ If this is a native custom element, make sure to exclude it from component resol
5833
5846
  if (sourceIsArray || isString(source)) {
5834
5847
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5835
5848
  let needsWrap = false;
5849
+ let isReadonlySource = false;
5836
5850
  if (sourceIsReactiveArray) {
5837
5851
  needsWrap = !isShallow(source);
5852
+ isReadonlySource = isReadonly(source);
5838
5853
  source = shallowReadArray(source);
5839
5854
  }
5840
5855
  ret = new Array(source.length);
5841
5856
  for (let i = 0, l = source.length; i < l; i++) {
5842
5857
  ret[i] = renderItem(
5843
- needsWrap ? toReactive(source[i]) : source[i],
5858
+ needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
5844
5859
  i,
5845
5860
  void 0,
5846
5861
  cached && cached[i]
@@ -7089,7 +7104,7 @@ If this is a native custom element, make sure to exclude it from component resol
7089
7104
  return vm;
7090
7105
  }
7091
7106
  }
7092
- Vue.version = `2.6.14-compat:${"3.5.13"}`;
7107
+ Vue.version = `2.6.14-compat:${"3.5.14"}`;
7093
7108
  Vue.config = singletonApp.config;
7094
7109
  Vue.use = (plugin, ...options) => {
7095
7110
  if (plugin && isFunction(plugin.install)) {
@@ -7583,11 +7598,9 @@ If this is a native custom element, make sure to exclude it from component resol
7583
7598
  }
7584
7599
  {
7585
7600
  context.reload = () => {
7586
- render(
7587
- cloneVNode(vnode),
7588
- rootContainer,
7589
- namespace
7590
- );
7601
+ const cloned = cloneVNode(vnode);
7602
+ cloned.el = null;
7603
+ render(cloned, rootContainer, namespace);
7591
7604
  };
7592
7605
  }
7593
7606
  if (isHydrate && hydrate) {
@@ -8185,7 +8198,7 @@ If you want to remount the same app, move your app creation logic into a factory
8185
8198
  return rawSlot;
8186
8199
  }
8187
8200
  const normalized = withCtx((...args) => {
8188
- if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
8201
+ if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
8189
8202
  warn$1(
8190
8203
  `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.`
8191
8204
  );
@@ -8224,7 +8237,7 @@ If you want to remount the same app, move your app creation logic into a factory
8224
8237
  };
8225
8238
  const assignSlots = (slots, children, optimized) => {
8226
8239
  for (const key in children) {
8227
- if (optimized || key !== "_") {
8240
+ if (optimized || !isInternalKey(key)) {
8228
8241
  slots[key] = children[key];
8229
8242
  }
8230
8243
  }
@@ -8911,8 +8924,8 @@ If you want to remount the same app, move your app creation logic into a factory
8911
8924
  endMeasure(instance, `init`);
8912
8925
  }
8913
8926
  }
8927
+ if (isHmrUpdating) initialVNode.el = null;
8914
8928
  if (instance.asyncDep) {
8915
- if (isHmrUpdating) initialVNode.el = null;
8916
8929
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
8917
8930
  if (!initialVNode.el) {
8918
8931
  const placeholder = instance.subTree = createVNode(Comment);
@@ -9498,7 +9511,13 @@ If you want to remount the same app, move your app creation logic into a factory
9498
9511
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
9499
9512
  } else {
9500
9513
  const { leave, delayLeave, afterLeave } = transition;
9501
- const remove2 = () => hostInsert(el, container, anchor);
9514
+ const remove2 = () => {
9515
+ if (vnode.ctx.isUnmounted) {
9516
+ hostRemove(el);
9517
+ } else {
9518
+ hostInsert(el, container, anchor);
9519
+ }
9520
+ };
9502
9521
  const performLeave = () => {
9503
9522
  leave(el, () => {
9504
9523
  remove2();
@@ -9531,7 +9550,9 @@ If you want to remount the same app, move your app creation logic into a factory
9531
9550
  optimized = false;
9532
9551
  }
9533
9552
  if (ref != null) {
9553
+ pauseTracking();
9534
9554
  setRef(ref, null, parentSuspense, vnode, true);
9555
+ resetTracking();
9535
9556
  }
9536
9557
  if (cacheIndex != null) {
9537
9558
  parentComponent.renderCache[cacheIndex] = void 0;
@@ -9643,12 +9664,27 @@ If you want to remount the same app, move your app creation logic into a factory
9643
9664
  if (instance.type.__hmrId) {
9644
9665
  unregisterHMR(instance);
9645
9666
  }
9646
- const { bum, scope, job, subTree, um, m, a } = instance;
9667
+ const {
9668
+ bum,
9669
+ scope,
9670
+ job,
9671
+ subTree,
9672
+ um,
9673
+ m,
9674
+ a,
9675
+ parent,
9676
+ slots: { __: slotCacheKeys }
9677
+ } = instance;
9647
9678
  invalidateMount(m);
9648
9679
  invalidateMount(a);
9649
9680
  if (bum) {
9650
9681
  invokeArrayFns(bum);
9651
9682
  }
9683
+ if (parent && isArray(slotCacheKeys)) {
9684
+ slotCacheKeys.forEach((v) => {
9685
+ parent.renderCache[v] = void 0;
9686
+ });
9687
+ }
9652
9688
  if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
9653
9689
  instance.emit("hook:beforeDestroy");
9654
9690
  }
@@ -9753,8 +9789,8 @@ If you want to remount the same app, move your app creation logic into a factory
9753
9789
  effect.flags |= 32;
9754
9790
  job.flags |= 4;
9755
9791
  } else {
9756
- effect.flags &= ~32;
9757
- job.flags &= ~4;
9792
+ effect.flags &= -33;
9793
+ job.flags &= -5;
9758
9794
  }
9759
9795
  }
9760
9796
  function needTransition(parentSuspense, transition) {
@@ -9781,6 +9817,9 @@ If you want to remount the same app, move your app creation logic into a factory
9781
9817
  if (c2.type === Comment && !c2.el) {
9782
9818
  c2.el = c1.el;
9783
9819
  }
9820
+ {
9821
+ c2.el && (c2.el.__vnode = c2);
9822
+ }
9784
9823
  }
9785
9824
  }
9786
9825
  }
@@ -11183,8 +11222,8 @@ If you want to remount the same app, move your app creation logic into a factory
11183
11222
  if (n2.shapeFlag & 6 && n1.component) {
11184
11223
  const dirtyInstances = hmrDirtyComponents.get(n2.type);
11185
11224
  if (dirtyInstances && dirtyInstances.has(n1.component)) {
11186
- n1.shapeFlag &= ~256;
11187
- n2.shapeFlag &= ~512;
11225
+ n1.shapeFlag &= -257;
11226
+ n2.shapeFlag &= -513;
11188
11227
  return false;
11189
11228
  }
11190
11229
  }
@@ -11643,7 +11682,7 @@ Component that was made reactive: `,
11643
11682
  const { props, children } = instance.vnode;
11644
11683
  const isStateful = isStatefulComponent(instance);
11645
11684
  initProps(instance, props, isStateful, isSSR);
11646
- initSlots(instance, children, optimized);
11685
+ initSlots(instance, children, optimized || isSSR);
11647
11686
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
11648
11687
  isSSR && setInSSRSetupState(false);
11649
11688
  return setupResult;
@@ -11984,13 +12023,15 @@ Component that was made reactive: `,
11984
12023
  if (obj.__isVue) {
11985
12024
  return ["div", vueStyle, `VueInstance`];
11986
12025
  } else if (isRef(obj)) {
12026
+ pauseTracking();
12027
+ const value = obj.value;
12028
+ resetTracking();
11987
12029
  return [
11988
12030
  "div",
11989
12031
  {},
11990
12032
  ["span", vueStyle, genRefFlag(obj)],
11991
12033
  "<",
11992
- // avoid debugger accessing value affecting behavior
11993
- formatValue("_value" in obj ? obj._value : obj),
12034
+ formatValue(value),
11994
12035
  `>`
11995
12036
  ];
11996
12037
  } else if (isReactive(obj)) {
@@ -12171,7 +12212,7 @@ Component that was made reactive: `,
12171
12212
  return true;
12172
12213
  }
12173
12214
 
12174
- const version = "3.5.13";
12215
+ const version = "3.5.14";
12175
12216
  const warn = warn$1 ;
12176
12217
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12177
12218
  const devtools = devtools$1 ;
@@ -13058,7 +13099,7 @@ Expected function or array of functions, received type ${typeof value}.`
13058
13099
  }
13059
13100
  return false;
13060
13101
  }
13061
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
13102
+ if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
13062
13103
  return false;
13063
13104
  }
13064
13105
  if (key === "form") {
@@ -13538,6 +13579,7 @@ Expected function or array of functions, received type ${typeof value}.`
13538
13579
  instance.vnode.el,
13539
13580
  moveClass
13540
13581
  )) {
13582
+ prevChildren = [];
13541
13583
  return;
13542
13584
  }
13543
13585
  prevChildren.forEach(callPendingCbs);
@@ -13561,6 +13603,7 @@ Expected function or array of functions, received type ${typeof value}.`
13561
13603
  };
13562
13604
  el.addEventListener("transitionend", cb);
13563
13605
  });
13606
+ prevChildren = [];
13564
13607
  });
13565
13608
  return () => {
13566
13609
  const rawProps = toRaw(props);