@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
  }
@@ -1635,14 +1645,14 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
1635
1645
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1636
1646
  return target;
1637
1647
  }
1638
- const existingProxy = proxyMap.get(target);
1639
- if (existingProxy) {
1640
- return existingProxy;
1641
- }
1642
1648
  const targetType = getTargetType(target);
1643
1649
  if (targetType === 0 /* INVALID */) {
1644
1650
  return target;
1645
1651
  }
1652
+ const existingProxy = proxyMap.get(target);
1653
+ if (existingProxy) {
1654
+ return existingProxy;
1655
+ }
1646
1656
  const proxy = new Proxy(
1647
1657
  target,
1648
1658
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -2497,11 +2507,11 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2497
2507
  queue.splice(i, 1);
2498
2508
  i--;
2499
2509
  if (cb.flags & 4) {
2500
- cb.flags &= ~1;
2510
+ cb.flags &= -2;
2501
2511
  }
2502
2512
  cb();
2503
2513
  if (!(cb.flags & 4)) {
2504
- cb.flags &= ~1;
2514
+ cb.flags &= -2;
2505
2515
  }
2506
2516
  }
2507
2517
  }
@@ -2526,10 +2536,10 @@ function flushPostFlushCbs(seen) {
2526
2536
  continue;
2527
2537
  }
2528
2538
  if (cb.flags & 4) {
2529
- cb.flags &= ~1;
2539
+ cb.flags &= -2;
2530
2540
  }
2531
2541
  if (!(cb.flags & 8)) cb();
2532
- cb.flags &= ~1;
2542
+ cb.flags &= -2;
2533
2543
  }
2534
2544
  activePostFlushCbs = null;
2535
2545
  postFlushIndex = 0;
@@ -2565,7 +2575,7 @@ function flushJobs(seen) {
2565
2575
  for (; flushIndex < queue.length; flushIndex++) {
2566
2576
  const job = queue[flushIndex];
2567
2577
  if (job) {
2568
- job.flags &= ~1;
2578
+ job.flags &= -2;
2569
2579
  }
2570
2580
  }
2571
2581
  flushIndex = -1;
@@ -3585,7 +3595,7 @@ const TeleportImpl = {
3585
3595
  namespace,
3586
3596
  slotScopeIds
3587
3597
  );
3588
- traverseStaticChildren(n1, n2, true);
3598
+ traverseStaticChildren(n1, n2, !!!(process.env.NODE_ENV !== "production"));
3589
3599
  } else if (!optimized) {
3590
3600
  patchChildren(
3591
3601
  n1,
@@ -4105,7 +4115,7 @@ function getInnerChild$1(vnode) {
4105
4115
  }
4106
4116
  return vnode;
4107
4117
  }
4108
- if (!!(process.env.NODE_ENV !== "production") && vnode.component) {
4118
+ if (vnode.component) {
4109
4119
  return vnode.component.subTree;
4110
4120
  }
4111
4121
  const { shapeFlag, children } = vnode;
@@ -5285,6 +5295,9 @@ const KeepAliveImpl = {
5285
5295
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
5286
5296
  devtoolsComponentAdded(instance2);
5287
5297
  }
5298
+ if (!!(process.env.NODE_ENV !== "production") && true) {
5299
+ instance2.__keepAliveStorageContainer = storageContainer;
5300
+ }
5288
5301
  };
5289
5302
  function unmount(vnode) {
5290
5303
  resetShapeFlag(vnode);
@@ -5372,7 +5385,7 @@ const KeepAliveImpl = {
5372
5385
  );
5373
5386
  const { include, exclude, max } = props;
5374
5387
  if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
5375
- vnode.shapeFlag &= ~256;
5388
+ vnode.shapeFlag &= -257;
5376
5389
  current = vnode;
5377
5390
  return rawVNode;
5378
5391
  }
@@ -5463,8 +5476,8 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
5463
5476
  }, target);
5464
5477
  }
5465
5478
  function resetShapeFlag(vnode) {
5466
- vnode.shapeFlag &= ~256;
5467
- vnode.shapeFlag &= ~512;
5479
+ vnode.shapeFlag &= -257;
5480
+ vnode.shapeFlag &= -513;
5468
5481
  }
5469
5482
  function getInnerChild(vnode) {
5470
5483
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
@@ -5866,14 +5879,16 @@ function renderList(source, renderItem, cache, index) {
5866
5879
  if (sourceIsArray || isString(source)) {
5867
5880
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5868
5881
  let needsWrap = false;
5882
+ let isReadonlySource = false;
5869
5883
  if (sourceIsReactiveArray) {
5870
5884
  needsWrap = !isShallow(source);
5885
+ isReadonlySource = isReadonly(source);
5871
5886
  source = shallowReadArray(source);
5872
5887
  }
5873
5888
  ret = new Array(source.length);
5874
5889
  for (let i = 0, l = source.length; i < l; i++) {
5875
5890
  ret[i] = renderItem(
5876
- needsWrap ? toReactive(source[i]) : source[i],
5891
+ needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
5877
5892
  i,
5878
5893
  void 0,
5879
5894
  cached && cached[i]
@@ -7127,7 +7142,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7127
7142
  return vm;
7128
7143
  }
7129
7144
  }
7130
- Vue.version = `2.6.14-compat:${"3.5.13"}`;
7145
+ Vue.version = `2.6.14-compat:${"3.5.14"}`;
7131
7146
  Vue.config = singletonApp.config;
7132
7147
  Vue.use = (plugin, ...options) => {
7133
7148
  if (plugin && isFunction(plugin.install)) {
@@ -7623,11 +7638,9 @@ function createAppAPI(render, hydrate) {
7623
7638
  }
7624
7639
  if (!!(process.env.NODE_ENV !== "production")) {
7625
7640
  context.reload = () => {
7626
- render(
7627
- cloneVNode(vnode),
7628
- rootContainer,
7629
- namespace
7630
- );
7641
+ const cloned = cloneVNode(vnode);
7642
+ cloned.el = null;
7643
+ render(cloned, rootContainer, namespace);
7631
7644
  };
7632
7645
  }
7633
7646
  if (isHydrate && hydrate) {
@@ -8225,7 +8238,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
8225
8238
  return rawSlot;
8226
8239
  }
8227
8240
  const normalized = withCtx((...args) => {
8228
- if (!!(process.env.NODE_ENV !== "production") && currentInstance && (!ctx || ctx.root === currentInstance.root)) {
8241
+ if (!!(process.env.NODE_ENV !== "production") && currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
8229
8242
  warn$1(
8230
8243
  `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.`
8231
8244
  );
@@ -8264,7 +8277,7 @@ const normalizeVNodeSlots = (instance, children) => {
8264
8277
  };
8265
8278
  const assignSlots = (slots, children, optimized) => {
8266
8279
  for (const key in children) {
8267
- if (optimized || key !== "_") {
8280
+ if (optimized || !isInternalKey(key)) {
8268
8281
  slots[key] = children[key];
8269
8282
  }
8270
8283
  }
@@ -8989,8 +9002,8 @@ function baseCreateRenderer(options, createHydrationFns) {
8989
9002
  endMeasure(instance, `init`);
8990
9003
  }
8991
9004
  }
9005
+ if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) initialVNode.el = null;
8992
9006
  if (instance.asyncDep) {
8993
- if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) initialVNode.el = null;
8994
9007
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
8995
9008
  if (!initialVNode.el) {
8996
9009
  const placeholder = instance.subTree = createVNode(Comment);
@@ -9576,7 +9589,13 @@ function baseCreateRenderer(options, createHydrationFns) {
9576
9589
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
9577
9590
  } else {
9578
9591
  const { leave, delayLeave, afterLeave } = transition;
9579
- const remove2 = () => hostInsert(el, container, anchor);
9592
+ const remove2 = () => {
9593
+ if (vnode.ctx.isUnmounted) {
9594
+ hostRemove(el);
9595
+ } else {
9596
+ hostInsert(el, container, anchor);
9597
+ }
9598
+ };
9580
9599
  const performLeave = () => {
9581
9600
  leave(el, () => {
9582
9601
  remove2();
@@ -9609,7 +9628,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9609
9628
  optimized = false;
9610
9629
  }
9611
9630
  if (ref != null) {
9631
+ pauseTracking();
9612
9632
  setRef(ref, null, parentSuspense, vnode, true);
9633
+ resetTracking();
9613
9634
  }
9614
9635
  if (cacheIndex != null) {
9615
9636
  parentComponent.renderCache[cacheIndex] = void 0;
@@ -9721,12 +9742,27 @@ function baseCreateRenderer(options, createHydrationFns) {
9721
9742
  if (!!(process.env.NODE_ENV !== "production") && instance.type.__hmrId) {
9722
9743
  unregisterHMR(instance);
9723
9744
  }
9724
- const { bum, scope, job, subTree, um, m, a } = instance;
9745
+ const {
9746
+ bum,
9747
+ scope,
9748
+ job,
9749
+ subTree,
9750
+ um,
9751
+ m,
9752
+ a,
9753
+ parent,
9754
+ slots: { __: slotCacheKeys }
9755
+ } = instance;
9725
9756
  invalidateMount(m);
9726
9757
  invalidateMount(a);
9727
9758
  if (bum) {
9728
9759
  invokeArrayFns(bum);
9729
9760
  }
9761
+ if (parent && isArray(slotCacheKeys)) {
9762
+ slotCacheKeys.forEach((v) => {
9763
+ parent.renderCache[v] = void 0;
9764
+ });
9765
+ }
9730
9766
  if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
9731
9767
  instance.emit("hook:beforeDestroy");
9732
9768
  }
@@ -9831,8 +9867,8 @@ function toggleRecurse({ effect, job }, allowed) {
9831
9867
  effect.flags |= 32;
9832
9868
  job.flags |= 4;
9833
9869
  } else {
9834
- effect.flags &= ~32;
9835
- job.flags &= ~4;
9870
+ effect.flags &= -33;
9871
+ job.flags &= -5;
9836
9872
  }
9837
9873
  }
9838
9874
  function needTransition(parentSuspense, transition) {
@@ -9856,9 +9892,12 @@ function traverseStaticChildren(n1, n2, shallow = false) {
9856
9892
  if (c2.type === Text) {
9857
9893
  c2.el = c1.el;
9858
9894
  }
9859
- if (!!(process.env.NODE_ENV !== "production") && c2.type === Comment && !c2.el) {
9895
+ if (c2.type === Comment && !c2.el) {
9860
9896
  c2.el = c1.el;
9861
9897
  }
9898
+ if (!!(process.env.NODE_ENV !== "production")) {
9899
+ c2.el && (c2.el.__vnode = c2);
9900
+ }
9862
9901
  }
9863
9902
  }
9864
9903
  }
@@ -11289,8 +11328,8 @@ function isSameVNodeType(n1, n2) {
11289
11328
  if (!!(process.env.NODE_ENV !== "production") && n2.shapeFlag & 6 && n1.component) {
11290
11329
  const dirtyInstances = hmrDirtyComponents.get(n2.type);
11291
11330
  if (dirtyInstances && dirtyInstances.has(n1.component)) {
11292
- n1.shapeFlag &= ~256;
11293
- n2.shapeFlag &= ~512;
11331
+ n1.shapeFlag &= -257;
11332
+ n2.shapeFlag &= -513;
11294
11333
  return false;
11295
11334
  }
11296
11335
  }
@@ -11763,7 +11802,7 @@ function setupComponent(instance, isSSR = false, optimized = false) {
11763
11802
  const { props, children } = instance.vnode;
11764
11803
  const isStateful = isStatefulComponent(instance);
11765
11804
  initProps(instance, props, isStateful, isSSR);
11766
- initSlots(instance, children, optimized);
11805
+ initSlots(instance, children, optimized || isSSR);
11767
11806
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
11768
11807
  isSSR && setInSSRSetupState(false);
11769
11808
  return setupResult;
@@ -12118,13 +12157,15 @@ function initCustomFormatter() {
12118
12157
  if (obj.__isVue) {
12119
12158
  return ["div", vueStyle, `VueInstance`];
12120
12159
  } else if (isRef(obj)) {
12160
+ pauseTracking();
12161
+ const value = obj.value;
12162
+ resetTracking();
12121
12163
  return [
12122
12164
  "div",
12123
12165
  {},
12124
12166
  ["span", vueStyle, genRefFlag(obj)],
12125
12167
  "<",
12126
- // avoid debugger accessing value affecting behavior
12127
- formatValue("_value" in obj ? obj._value : obj),
12168
+ formatValue(value),
12128
12169
  `>`
12129
12170
  ];
12130
12171
  } else if (isReactive(obj)) {
@@ -12305,7 +12346,7 @@ function isMemoSame(cached, memo) {
12305
12346
  return true;
12306
12347
  }
12307
12348
 
12308
- const version = "3.5.13";
12349
+ const version = "3.5.14";
12309
12350
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12310
12351
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12311
12352
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -13211,7 +13252,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
13211
13252
  }
13212
13253
  return false;
13213
13254
  }
13214
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
13255
+ if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
13215
13256
  return false;
13216
13257
  }
13217
13258
  if (key === "form") {
@@ -13703,6 +13744,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
13703
13744
  instance.vnode.el,
13704
13745
  moveClass
13705
13746
  )) {
13747
+ prevChildren = [];
13706
13748
  return;
13707
13749
  }
13708
13750
  prevChildren.forEach(callPendingCbs);
@@ -13726,6 +13768,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
13726
13768
  };
13727
13769
  el.addEventListener("transitionend", cb);
13728
13770
  });
13771
+ prevChildren = [];
13729
13772
  });
13730
13773
  return () => {
13731
13774
  const rawProps = toRaw(props);