@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
  **/
@@ -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;
@@ -3567,7 +3577,7 @@ const TeleportImpl = {
3567
3577
  namespace,
3568
3578
  slotScopeIds
3569
3579
  );
3570
- traverseStaticChildren(n1, n2, true);
3580
+ traverseStaticChildren(n1, n2, false);
3571
3581
  } else if (!optimized) {
3572
3582
  patchChildren(
3573
3583
  n1,
@@ -5255,6 +5265,9 @@ const KeepAliveImpl = {
5255
5265
  {
5256
5266
  devtoolsComponentAdded(instance2);
5257
5267
  }
5268
+ {
5269
+ instance2.__keepAliveStorageContainer = storageContainer;
5270
+ }
5258
5271
  };
5259
5272
  function unmount(vnode) {
5260
5273
  resetShapeFlag(vnode);
@@ -5342,7 +5355,7 @@ const KeepAliveImpl = {
5342
5355
  );
5343
5356
  const { include, exclude, max } = props;
5344
5357
  if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
5345
- vnode.shapeFlag &= ~256;
5358
+ vnode.shapeFlag &= -257;
5346
5359
  current = vnode;
5347
5360
  return rawVNode;
5348
5361
  }
@@ -5433,8 +5446,8 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
5433
5446
  }, target);
5434
5447
  }
5435
5448
  function resetShapeFlag(vnode) {
5436
- vnode.shapeFlag &= ~256;
5437
- vnode.shapeFlag &= ~512;
5449
+ vnode.shapeFlag &= -257;
5450
+ vnode.shapeFlag &= -513;
5438
5451
  }
5439
5452
  function getInnerChild(vnode) {
5440
5453
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
@@ -5836,14 +5849,16 @@ function renderList(source, renderItem, cache, index) {
5836
5849
  if (sourceIsArray || isString(source)) {
5837
5850
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5838
5851
  let needsWrap = false;
5852
+ let isReadonlySource = false;
5839
5853
  if (sourceIsReactiveArray) {
5840
5854
  needsWrap = !isShallow(source);
5855
+ isReadonlySource = isReadonly(source);
5841
5856
  source = shallowReadArray(source);
5842
5857
  }
5843
5858
  ret = new Array(source.length);
5844
5859
  for (let i = 0, l = source.length; i < l; i++) {
5845
5860
  ret[i] = renderItem(
5846
- needsWrap ? toReactive(source[i]) : source[i],
5861
+ needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
5847
5862
  i,
5848
5863
  void 0,
5849
5864
  cached && cached[i]
@@ -7095,7 +7110,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7095
7110
  return vm;
7096
7111
  }
7097
7112
  }
7098
- Vue.version = `2.6.14-compat:${"3.5.13"}`;
7113
+ Vue.version = `2.6.14-compat:${"3.5.14"}`;
7099
7114
  Vue.config = singletonApp.config;
7100
7115
  Vue.use = (plugin, ...options) => {
7101
7116
  if (plugin && isFunction(plugin.install)) {
@@ -7589,11 +7604,9 @@ function createAppAPI(render, hydrate) {
7589
7604
  }
7590
7605
  {
7591
7606
  context.reload = () => {
7592
- render(
7593
- cloneVNode(vnode),
7594
- rootContainer,
7595
- namespace
7596
- );
7607
+ const cloned = cloneVNode(vnode);
7608
+ cloned.el = null;
7609
+ render(cloned, rootContainer, namespace);
7597
7610
  };
7598
7611
  }
7599
7612
  if (isHydrate && hydrate) {
@@ -8191,7 +8204,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
8191
8204
  return rawSlot;
8192
8205
  }
8193
8206
  const normalized = withCtx((...args) => {
8194
- if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
8207
+ if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
8195
8208
  warn$1(
8196
8209
  `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.`
8197
8210
  );
@@ -8230,7 +8243,7 @@ const normalizeVNodeSlots = (instance, children) => {
8230
8243
  };
8231
8244
  const assignSlots = (slots, children, optimized) => {
8232
8245
  for (const key in children) {
8233
- if (optimized || key !== "_") {
8246
+ if (optimized || !isInternalKey(key)) {
8234
8247
  slots[key] = children[key];
8235
8248
  }
8236
8249
  }
@@ -8917,8 +8930,8 @@ function baseCreateRenderer(options, createHydrationFns) {
8917
8930
  endMeasure(instance, `init`);
8918
8931
  }
8919
8932
  }
8933
+ if (isHmrUpdating) initialVNode.el = null;
8920
8934
  if (instance.asyncDep) {
8921
- if (isHmrUpdating) initialVNode.el = null;
8922
8935
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
8923
8936
  if (!initialVNode.el) {
8924
8937
  const placeholder = instance.subTree = createVNode(Comment);
@@ -9504,7 +9517,13 @@ function baseCreateRenderer(options, createHydrationFns) {
9504
9517
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
9505
9518
  } else {
9506
9519
  const { leave, delayLeave, afterLeave } = transition;
9507
- const remove2 = () => hostInsert(el, container, anchor);
9520
+ const remove2 = () => {
9521
+ if (vnode.ctx.isUnmounted) {
9522
+ hostRemove(el);
9523
+ } else {
9524
+ hostInsert(el, container, anchor);
9525
+ }
9526
+ };
9508
9527
  const performLeave = () => {
9509
9528
  leave(el, () => {
9510
9529
  remove2();
@@ -9537,7 +9556,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9537
9556
  optimized = false;
9538
9557
  }
9539
9558
  if (ref != null) {
9559
+ pauseTracking();
9540
9560
  setRef(ref, null, parentSuspense, vnode, true);
9561
+ resetTracking();
9541
9562
  }
9542
9563
  if (cacheIndex != null) {
9543
9564
  parentComponent.renderCache[cacheIndex] = void 0;
@@ -9649,12 +9670,27 @@ function baseCreateRenderer(options, createHydrationFns) {
9649
9670
  if (instance.type.__hmrId) {
9650
9671
  unregisterHMR(instance);
9651
9672
  }
9652
- const { bum, scope, job, subTree, um, m, a } = instance;
9673
+ const {
9674
+ bum,
9675
+ scope,
9676
+ job,
9677
+ subTree,
9678
+ um,
9679
+ m,
9680
+ a,
9681
+ parent,
9682
+ slots: { __: slotCacheKeys }
9683
+ } = instance;
9653
9684
  invalidateMount(m);
9654
9685
  invalidateMount(a);
9655
9686
  if (bum) {
9656
9687
  invokeArrayFns(bum);
9657
9688
  }
9689
+ if (parent && isArray(slotCacheKeys)) {
9690
+ slotCacheKeys.forEach((v) => {
9691
+ parent.renderCache[v] = void 0;
9692
+ });
9693
+ }
9658
9694
  if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
9659
9695
  instance.emit("hook:beforeDestroy");
9660
9696
  }
@@ -9759,8 +9795,8 @@ function toggleRecurse({ effect, job }, allowed) {
9759
9795
  effect.flags |= 32;
9760
9796
  job.flags |= 4;
9761
9797
  } else {
9762
- effect.flags &= ~32;
9763
- job.flags &= ~4;
9798
+ effect.flags &= -33;
9799
+ job.flags &= -5;
9764
9800
  }
9765
9801
  }
9766
9802
  function needTransition(parentSuspense, transition) {
@@ -9787,6 +9823,9 @@ function traverseStaticChildren(n1, n2, shallow = false) {
9787
9823
  if (c2.type === Comment && !c2.el) {
9788
9824
  c2.el = c1.el;
9789
9825
  }
9826
+ {
9827
+ c2.el && (c2.el.__vnode = c2);
9828
+ }
9790
9829
  }
9791
9830
  }
9792
9831
  }
@@ -11217,8 +11256,8 @@ function isSameVNodeType(n1, n2) {
11217
11256
  if (n2.shapeFlag & 6 && n1.component) {
11218
11257
  const dirtyInstances = hmrDirtyComponents.get(n2.type);
11219
11258
  if (dirtyInstances && dirtyInstances.has(n1.component)) {
11220
- n1.shapeFlag &= ~256;
11221
- n2.shapeFlag &= ~512;
11259
+ n1.shapeFlag &= -257;
11260
+ n2.shapeFlag &= -513;
11222
11261
  return false;
11223
11262
  }
11224
11263
  }
@@ -11689,7 +11728,7 @@ function setupComponent(instance, isSSR = false, optimized = false) {
11689
11728
  const { props, children } = instance.vnode;
11690
11729
  const isStateful = isStatefulComponent(instance);
11691
11730
  initProps(instance, props, isStateful, isSSR);
11692
- initSlots(instance, children, optimized);
11731
+ initSlots(instance, children, optimized || isSSR);
11693
11732
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
11694
11733
  isSSR && setInSSRSetupState(false);
11695
11734
  return setupResult;
@@ -12032,13 +12071,15 @@ function initCustomFormatter() {
12032
12071
  if (obj.__isVue) {
12033
12072
  return ["div", vueStyle, `VueInstance`];
12034
12073
  } else if (isRef(obj)) {
12074
+ pauseTracking();
12075
+ const value = obj.value;
12076
+ resetTracking();
12035
12077
  return [
12036
12078
  "div",
12037
12079
  {},
12038
12080
  ["span", vueStyle, genRefFlag(obj)],
12039
12081
  "<",
12040
- // avoid debugger accessing value affecting behavior
12041
- formatValue("_value" in obj ? obj._value : obj),
12082
+ formatValue(value),
12042
12083
  `>`
12043
12084
  ];
12044
12085
  } else if (isReactive(obj)) {
@@ -12219,7 +12260,7 @@ function isMemoSame(cached, memo) {
12219
12260
  return true;
12220
12261
  }
12221
12262
 
12222
- const version = "3.5.13";
12263
+ const version = "3.5.14";
12223
12264
  const warn = warn$1 ;
12224
12265
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12225
12266
  const devtools = devtools$1 ;
@@ -13125,7 +13166,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
13125
13166
  }
13126
13167
  return false;
13127
13168
  }
13128
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
13169
+ if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
13129
13170
  return false;
13130
13171
  }
13131
13172
  if (key === "form") {
@@ -13617,6 +13658,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
13617
13658
  instance.vnode.el,
13618
13659
  moveClass
13619
13660
  )) {
13661
+ prevChildren = [];
13620
13662
  return;
13621
13663
  }
13622
13664
  prevChildren.forEach(callPendingCbs);
@@ -13640,6 +13682,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
13640
13682
  };
13641
13683
  el.addEventListener("transitionend", cb);
13642
13684
  });
13685
+ prevChildren = [];
13643
13686
  });
13644
13687
  return () => {
13645
13688
  const rawProps = toRaw(props);