@vue/compat 3.5.8 → 3.5.10

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.10
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -572,9 +572,17 @@ function endBatch() {
572
572
  let error;
573
573
  while (batchedSub) {
574
574
  let e = batchedSub;
575
+ let next;
576
+ while (e) {
577
+ if (!(e.flags & 1)) {
578
+ e.flags &= ~8;
579
+ }
580
+ e = e.next;
581
+ }
582
+ e = batchedSub;
575
583
  batchedSub = void 0;
576
584
  while (e) {
577
- const next = e.next;
585
+ next = e.next;
578
586
  e.next = void 0;
579
587
  e.flags &= ~8;
580
588
  if (e.flags & 1) {
@@ -597,7 +605,7 @@ function prepareDeps(sub) {
597
605
  link.dep.activeLink = link;
598
606
  }
599
607
  }
600
- function cleanupDeps(sub, fromComputed = false) {
608
+ function cleanupDeps(sub) {
601
609
  let head;
602
610
  let tail = sub.depsTail;
603
611
  let link = tail;
@@ -605,7 +613,7 @@ function cleanupDeps(sub, fromComputed = false) {
605
613
  const prev = link.prevDep;
606
614
  if (link.version === -1) {
607
615
  if (link === tail) tail = prev;
608
- removeSub(link, fromComputed);
616
+ removeSub(link);
609
617
  removeDep(link);
610
618
  } else {
611
619
  head = link;
@@ -660,11 +668,11 @@ function refreshComputed(computed) {
660
668
  } finally {
661
669
  activeSub = prevSub;
662
670
  shouldTrack = prevShouldTrack;
663
- cleanupDeps(computed, true);
671
+ cleanupDeps(computed);
664
672
  computed.flags &= ~2;
665
673
  }
666
674
  }
667
- function removeSub(link, fromComputed = false) {
675
+ function removeSub(link, soft = false) {
668
676
  const { dep, prevSub, nextSub } = link;
669
677
  if (prevSub) {
670
678
  prevSub.nextSub = nextSub;
@@ -680,17 +688,15 @@ function removeSub(link, fromComputed = false) {
680
688
  if (dep.subsHead === link) {
681
689
  dep.subsHead = nextSub;
682
690
  }
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);
691
+ if (!dep.subs && dep.computed) {
692
+ dep.computed.flags &= ~4;
693
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
694
+ removeSub(l, true);
692
695
  }
693
696
  }
697
+ if (!soft && !--dep.sc && dep.map) {
698
+ dep.map.delete(dep.key);
699
+ }
694
700
  }
695
701
  function removeDep(link) {
696
702
  const { prevDep, nextDep } = link;
@@ -775,6 +781,10 @@ class Dep {
775
781
  this.target = void 0;
776
782
  this.map = void 0;
777
783
  this.key = void 0;
784
+ /**
785
+ * Subscriber counter
786
+ */
787
+ this.sc = 0;
778
788
  {
779
789
  this.subsHead = void 0;
780
790
  }
@@ -793,9 +803,7 @@ class Dep {
793
803
  activeSub.depsTail.nextDep = link;
794
804
  activeSub.depsTail = link;
795
805
  }
796
- if (activeSub.flags & 4) {
797
- addSub(link);
798
- }
806
+ addSub(link);
799
807
  } else if (link.version === -1) {
800
808
  link.version = this.version;
801
809
  if (link.nextDep) {
@@ -859,22 +867,25 @@ class Dep {
859
867
  }
860
868
  }
861
869
  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);
870
+ link.dep.sc++;
871
+ if (link.sub.flags & 4) {
872
+ const computed = link.dep.computed;
873
+ if (computed && !link.dep.subs) {
874
+ computed.flags |= 4 | 16;
875
+ for (let l = computed.deps; l; l = l.nextDep) {
876
+ addSub(l);
877
+ }
867
878
  }
879
+ const currentTail = link.dep.subs;
880
+ if (currentTail !== link) {
881
+ link.prevSub = currentTail;
882
+ if (currentTail) currentTail.nextSub = link;
883
+ }
884
+ if (link.dep.subsHead === void 0) {
885
+ link.dep.subsHead = link;
886
+ }
887
+ link.dep.subs = link;
868
888
  }
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
889
  }
879
890
  const targetMap = /* @__PURE__ */ new WeakMap();
880
891
  const ITERATE_KEY = Symbol(
@@ -978,8 +989,8 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
978
989
  endBatch();
979
990
  }
980
991
  function getDepFromReactive(object, key) {
981
- var _a;
982
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
992
+ const depMap = targetMap.get(object);
993
+ return depMap && depMap.get(key);
983
994
  }
984
995
 
985
996
  function reactiveReadArray(array) {
@@ -1915,6 +1926,10 @@ class ComputedRefImpl {
1915
1926
  * @internal
1916
1927
  */
1917
1928
  this.globalVersion = globalVersion - 1;
1929
+ /**
1930
+ * @internal
1931
+ */
1932
+ this.next = void 0;
1918
1933
  // for backwards compat
1919
1934
  this.effect = this;
1920
1935
  this["__v_isReadonly"] = !setter;
@@ -4162,6 +4177,7 @@ function useId() {
4162
4177
  `useId() is called when there is no active component instance to be associated with.`
4163
4178
  );
4164
4179
  }
4180
+ return "";
4165
4181
  }
4166
4182
  function markAsyncBoundary(instance) {
4167
4183
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
@@ -7083,7 +7099,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7083
7099
  return vm;
7084
7100
  }
7085
7101
  }
7086
- Vue.version = `2.6.14-compat:${"3.5.8"}`;
7102
+ Vue.version = `2.6.14-compat:${"3.5.10"}`;
7087
7103
  Vue.config = singletonApp.config;
7088
7104
  Vue.use = (plugin, ...options) => {
7089
7105
  if (plugin && isFunction(plugin.install)) {
@@ -11441,7 +11457,7 @@ function normalizeVNode(child) {
11441
11457
  // #3666, avoid reference pollution when reusing vnode
11442
11458
  child.slice()
11443
11459
  );
11444
- } else if (typeof child === "object") {
11460
+ } else if (isVNode(child)) {
11445
11461
  return cloneIfMounted(child);
11446
11462
  } else {
11447
11463
  return createVNode(Text, null, String(child));
@@ -12198,7 +12214,7 @@ function isMemoSame(cached, memo) {
12198
12214
  return true;
12199
12215
  }
12200
12216
 
12201
- const version = "3.5.8";
12217
+ const version = "3.5.10";
12202
12218
  const warn = warn$1 ;
12203
12219
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12204
12220
  const devtools = devtools$1 ;
@@ -13073,6 +13089,11 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
13073
13089
  if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
13074
13090
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
13075
13091
  }
13092
+ } else if (
13093
+ // #11081 force set props for possible async custom element
13094
+ el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13095
+ ) {
13096
+ patchDOMProp(el, camelize(key), nextValue, parentComponent);
13076
13097
  } else {
13077
13098
  if (key === "true-value") {
13078
13099
  el._trueValue = nextValue;
@@ -13113,13 +13134,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
13113
13134
  if (isNativeOn(key) && isString(value)) {
13114
13135
  return false;
13115
13136
  }
13116
- if (key in el) {
13117
- return true;
13118
- }
13119
- if (el._isVueCE && (/[A-Z]/.test(key) || !isString(value))) {
13120
- return true;
13121
- }
13122
- return false;
13137
+ return key in el;
13123
13138
  }
13124
13139
 
13125
13140
  const REMOVAL = {};
@@ -13805,7 +13820,7 @@ const vModelCheckbox = {
13805
13820
  setChecked(el, binding, vnode);
13806
13821
  }
13807
13822
  };
13808
- function setChecked(el, { value, oldValue }, vnode) {
13823
+ function setChecked(el, { value }, vnode) {
13809
13824
  el._modelValue = value;
13810
13825
  let checked;
13811
13826
  if (isArray(value)) {
@@ -13855,19 +13870,19 @@ const vModelSelect = {
13855
13870
  },
13856
13871
  // set value in mounted & updated because <select> relies on its children
13857
13872
  // <option>s.
13858
- mounted(el, { value, modifiers: { number } }) {
13873
+ mounted(el, { value }) {
13859
13874
  setSelected(el, value);
13860
13875
  },
13861
13876
  beforeUpdate(el, _binding, vnode) {
13862
13877
  el[assignKey] = getModelAssigner(vnode);
13863
13878
  },
13864
- updated(el, { value, modifiers: { number } }) {
13879
+ updated(el, { value }) {
13865
13880
  if (!el._assigning) {
13866
13881
  setSelected(el, value);
13867
13882
  }
13868
13883
  }
13869
13884
  };
13870
- function setSelected(el, value, number) {
13885
+ function setSelected(el, value) {
13871
13886
  const isMultiple = el.multiple;
13872
13887
  const isArrayValue = isArray(value);
13873
13888
  if (isMultiple && !isArrayValue && !isSet(value)) {