@vue/compat 3.5.8 → 3.5.9

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.8
2
+ * @vue/compat v3.5.9
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -572,11 +572,14 @@ function endBatch() {
572
572
  let error;
573
573
  while (batchedSub) {
574
574
  let e = batchedSub;
575
- batchedSub = void 0;
575
+ let next;
576
576
  while (e) {
577
- const next = e.next;
578
- e.next = void 0;
579
577
  e.flags &= ~8;
578
+ e = e.next;
579
+ }
580
+ e = batchedSub;
581
+ batchedSub = void 0;
582
+ while (e) {
580
583
  if (e.flags & 1) {
581
584
  try {
582
585
  ;
@@ -585,6 +588,8 @@ function endBatch() {
585
588
  if (!error) error = err;
586
589
  }
587
590
  }
591
+ next = e.next;
592
+ e.next = void 0;
588
593
  e = next;
589
594
  }
590
595
  }
@@ -597,7 +602,7 @@ function prepareDeps(sub) {
597
602
  link.dep.activeLink = link;
598
603
  }
599
604
  }
600
- function cleanupDeps(sub, fromComputed = false) {
605
+ function cleanupDeps(sub) {
601
606
  let head;
602
607
  let tail = sub.depsTail;
603
608
  let link = tail;
@@ -605,7 +610,7 @@ function cleanupDeps(sub, fromComputed = false) {
605
610
  const prev = link.prevDep;
606
611
  if (link.version === -1) {
607
612
  if (link === tail) tail = prev;
608
- removeSub(link, fromComputed);
613
+ removeSub(link);
609
614
  removeDep(link);
610
615
  } else {
611
616
  head = link;
@@ -660,11 +665,11 @@ function refreshComputed(computed) {
660
665
  } finally {
661
666
  activeSub = prevSub;
662
667
  shouldTrack = prevShouldTrack;
663
- cleanupDeps(computed, true);
668
+ cleanupDeps(computed);
664
669
  computed.flags &= ~2;
665
670
  }
666
671
  }
667
- function removeSub(link, fromComputed = false) {
672
+ function removeSub(link, soft = false) {
668
673
  const { dep, prevSub, nextSub } = link;
669
674
  if (prevSub) {
670
675
  prevSub.nextSub = nextSub;
@@ -680,17 +685,15 @@ function removeSub(link, fromComputed = false) {
680
685
  if (dep.subsHead === link) {
681
686
  dep.subsHead = nextSub;
682
687
  }
683
- if (!dep.subs) {
684
- if (dep.computed) {
685
- dep.computed.flags &= ~4;
686
- for (let l = dep.computed.deps; l; l = l.nextDep) {
687
- removeSub(l, true);
688
- }
689
- } else if (dep.map && !fromComputed) {
690
- dep.map.delete(dep.key);
691
- if (!dep.map.size) targetMap.delete(dep.target);
688
+ if (!dep.subs && dep.computed) {
689
+ dep.computed.flags &= ~4;
690
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
691
+ removeSub(l, true);
692
692
  }
693
693
  }
694
+ if (!soft && !--dep.sc && dep.map) {
695
+ dep.map.delete(dep.key);
696
+ }
694
697
  }
695
698
  function removeDep(link) {
696
699
  const { prevDep, nextDep } = link;
@@ -775,6 +778,10 @@ class Dep {
775
778
  this.target = void 0;
776
779
  this.map = void 0;
777
780
  this.key = void 0;
781
+ /**
782
+ * Subscriber counter
783
+ */
784
+ this.sc = 0;
778
785
  {
779
786
  this.subsHead = void 0;
780
787
  }
@@ -793,9 +800,7 @@ class Dep {
793
800
  activeSub.depsTail.nextDep = link;
794
801
  activeSub.depsTail = link;
795
802
  }
796
- if (activeSub.flags & 4) {
797
- addSub(link);
798
- }
803
+ addSub(link);
799
804
  } else if (link.version === -1) {
800
805
  link.version = this.version;
801
806
  if (link.nextDep) {
@@ -859,22 +864,25 @@ class Dep {
859
864
  }
860
865
  }
861
866
  function addSub(link) {
862
- const computed = link.dep.computed;
863
- if (computed && !link.dep.subs) {
864
- computed.flags |= 4 | 16;
865
- for (let l = computed.deps; l; l = l.nextDep) {
866
- addSub(l);
867
+ link.dep.sc++;
868
+ if (link.sub.flags & 4) {
869
+ const computed = link.dep.computed;
870
+ if (computed && !link.dep.subs) {
871
+ computed.flags |= 4 | 16;
872
+ for (let l = computed.deps; l; l = l.nextDep) {
873
+ addSub(l);
874
+ }
867
875
  }
876
+ const currentTail = link.dep.subs;
877
+ if (currentTail !== link) {
878
+ link.prevSub = currentTail;
879
+ if (currentTail) currentTail.nextSub = link;
880
+ }
881
+ if (link.dep.subsHead === void 0) {
882
+ link.dep.subsHead = link;
883
+ }
884
+ link.dep.subs = link;
868
885
  }
869
- const currentTail = link.dep.subs;
870
- if (currentTail !== link) {
871
- link.prevSub = currentTail;
872
- if (currentTail) currentTail.nextSub = link;
873
- }
874
- if (link.dep.subsHead === void 0) {
875
- link.dep.subsHead = link;
876
- }
877
- link.dep.subs = link;
878
886
  }
879
887
  const targetMap = /* @__PURE__ */ new WeakMap();
880
888
  const ITERATE_KEY = Symbol(
@@ -978,8 +986,8 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
978
986
  endBatch();
979
987
  }
980
988
  function getDepFromReactive(object, key) {
981
- var _a;
982
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
989
+ const depMap = targetMap.get(object);
990
+ return depMap && depMap.get(key);
983
991
  }
984
992
 
985
993
  function reactiveReadArray(array) {
@@ -4162,6 +4170,7 @@ function useId() {
4162
4170
  `useId() is called when there is no active component instance to be associated with.`
4163
4171
  );
4164
4172
  }
4173
+ return "";
4165
4174
  }
4166
4175
  function markAsyncBoundary(instance) {
4167
4176
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
@@ -7083,7 +7092,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7083
7092
  return vm;
7084
7093
  }
7085
7094
  }
7086
- Vue.version = `2.6.14-compat:${"3.5.8"}`;
7095
+ Vue.version = `2.6.14-compat:${"3.5.9"}`;
7087
7096
  Vue.config = singletonApp.config;
7088
7097
  Vue.use = (plugin, ...options) => {
7089
7098
  if (plugin && isFunction(plugin.install)) {
@@ -11441,7 +11450,7 @@ function normalizeVNode(child) {
11441
11450
  // #3666, avoid reference pollution when reusing vnode
11442
11451
  child.slice()
11443
11452
  );
11444
- } else if (typeof child === "object") {
11453
+ } else if (isVNode(child)) {
11445
11454
  return cloneIfMounted(child);
11446
11455
  } else {
11447
11456
  return createVNode(Text, null, String(child));
@@ -12198,7 +12207,7 @@ function isMemoSame(cached, memo) {
12198
12207
  return true;
12199
12208
  }
12200
12209
 
12201
- const version = "3.5.8";
12210
+ const version = "3.5.9";
12202
12211
  const warn = warn$1 ;
12203
12212
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12204
12213
  const devtools = devtools$1 ;
@@ -13805,7 +13814,7 @@ const vModelCheckbox = {
13805
13814
  setChecked(el, binding, vnode);
13806
13815
  }
13807
13816
  };
13808
- function setChecked(el, { value, oldValue }, vnode) {
13817
+ function setChecked(el, { value }, vnode) {
13809
13818
  el._modelValue = value;
13810
13819
  let checked;
13811
13820
  if (isArray(value)) {
@@ -13855,19 +13864,19 @@ const vModelSelect = {
13855
13864
  },
13856
13865
  // set value in mounted & updated because <select> relies on its children
13857
13866
  // <option>s.
13858
- mounted(el, { value, modifiers: { number } }) {
13867
+ mounted(el, { value }) {
13859
13868
  setSelected(el, value);
13860
13869
  },
13861
13870
  beforeUpdate(el, _binding, vnode) {
13862
13871
  el[assignKey] = getModelAssigner(vnode);
13863
13872
  },
13864
- updated(el, { value, modifiers: { number } }) {
13873
+ updated(el, { value }) {
13865
13874
  if (!el._assigning) {
13866
13875
  setSelected(el, value);
13867
13876
  }
13868
13877
  }
13869
13878
  };
13870
- function setSelected(el, value, number) {
13879
+ function setSelected(el, value) {
13871
13880
  const isMultiple = el.multiple;
13872
13881
  const isArrayValue = isArray(value);
13873
13882
  if (isMultiple && !isArrayValue && !isSet(value)) {