@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 (!!(process.env.NODE_ENV !== "production") && 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
  if (!!(process.env.NODE_ENV !== "production")) {
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 (!!(process.env.NODE_ENV !== "production") && 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 (!!(process.env.NODE_ENV !== "production") && 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(
@@ -982,8 +993,8 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
982
993
  endBatch();
983
994
  }
984
995
  function getDepFromReactive(object, key) {
985
- var _a;
986
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
996
+ const depMap = targetMap.get(object);
997
+ return depMap && depMap.get(key);
987
998
  }
988
999
 
989
1000
  function reactiveReadArray(array) {
@@ -1925,6 +1936,10 @@ class ComputedRefImpl {
1925
1936
  * @internal
1926
1937
  */
1927
1938
  this.globalVersion = globalVersion - 1;
1939
+ /**
1940
+ * @internal
1941
+ */
1942
+ this.next = void 0;
1928
1943
  // for backwards compat
1929
1944
  this.effect = this;
1930
1945
  this["__v_isReadonly"] = !setter;
@@ -4181,6 +4196,7 @@ function useId() {
4181
4196
  `useId() is called when there is no active component instance to be associated with.`
4182
4197
  );
4183
4198
  }
4199
+ return "";
4184
4200
  }
4185
4201
  function markAsyncBoundary(instance) {
4186
4202
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
@@ -7115,7 +7131,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7115
7131
  return vm;
7116
7132
  }
7117
7133
  }
7118
- Vue.version = `2.6.14-compat:${"3.5.8"}`;
7134
+ Vue.version = `2.6.14-compat:${"3.5.10"}`;
7119
7135
  Vue.config = singletonApp.config;
7120
7136
  Vue.use = (plugin, ...options) => {
7121
7137
  if (plugin && isFunction(plugin.install)) {
@@ -11513,7 +11529,7 @@ function normalizeVNode(child) {
11513
11529
  // #3666, avoid reference pollution when reusing vnode
11514
11530
  child.slice()
11515
11531
  );
11516
- } else if (typeof child === "object") {
11532
+ } else if (isVNode(child)) {
11517
11533
  return cloneIfMounted(child);
11518
11534
  } else {
11519
11535
  return createVNode(Text, null, String(child));
@@ -12284,7 +12300,7 @@ function isMemoSame(cached, memo) {
12284
12300
  return true;
12285
12301
  }
12286
12302
 
12287
- const version = "3.5.8";
12303
+ const version = "3.5.10";
12288
12304
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12289
12305
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12290
12306
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -13159,6 +13175,11 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
13159
13175
  if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
13160
13176
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
13161
13177
  }
13178
+ } else if (
13179
+ // #11081 force set props for possible async custom element
13180
+ el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13181
+ ) {
13182
+ patchDOMProp(el, camelize(key), nextValue, parentComponent);
13162
13183
  } else {
13163
13184
  if (key === "true-value") {
13164
13185
  el._trueValue = nextValue;
@@ -13199,13 +13220,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
13199
13220
  if (isNativeOn(key) && isString(value)) {
13200
13221
  return false;
13201
13222
  }
13202
- if (key in el) {
13203
- return true;
13204
- }
13205
- if (el._isVueCE && (/[A-Z]/.test(key) || !isString(value))) {
13206
- return true;
13207
- }
13208
- return false;
13223
+ return key in el;
13209
13224
  }
13210
13225
 
13211
13226
  const REMOVAL = {};
@@ -13891,7 +13906,7 @@ const vModelCheckbox = {
13891
13906
  setChecked(el, binding, vnode);
13892
13907
  }
13893
13908
  };
13894
- function setChecked(el, { value, oldValue }, vnode) {
13909
+ function setChecked(el, { value }, vnode) {
13895
13910
  el._modelValue = value;
13896
13911
  let checked;
13897
13912
  if (isArray(value)) {
@@ -13941,19 +13956,19 @@ const vModelSelect = {
13941
13956
  },
13942
13957
  // set value in mounted & updated because <select> relies on its children
13943
13958
  // <option>s.
13944
- mounted(el, { value, modifiers: { number } }) {
13959
+ mounted(el, { value }) {
13945
13960
  setSelected(el, value);
13946
13961
  },
13947
13962
  beforeUpdate(el, _binding, vnode) {
13948
13963
  el[assignKey] = getModelAssigner(vnode);
13949
13964
  },
13950
- updated(el, { value, modifiers: { number } }) {
13965
+ updated(el, { value }) {
13951
13966
  if (!el._assigning) {
13952
13967
  setSelected(el, value);
13953
13968
  }
13954
13969
  }
13955
13970
  };
13956
- function setSelected(el, value, number) {
13971
+ function setSelected(el, value) {
13957
13972
  const isMultiple = el.multiple;
13958
13973
  const isArrayValue = isArray(value);
13959
13974
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -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
  **/
@@ -575,9 +575,17 @@ var Vue = (function () {
575
575
  let error;
576
576
  while (batchedSub) {
577
577
  let e = batchedSub;
578
+ let next;
579
+ while (e) {
580
+ if (!(e.flags & 1)) {
581
+ e.flags &= ~8;
582
+ }
583
+ e = e.next;
584
+ }
585
+ e = batchedSub;
578
586
  batchedSub = void 0;
579
587
  while (e) {
580
- const next = e.next;
588
+ next = e.next;
581
589
  e.next = void 0;
582
590
  e.flags &= ~8;
583
591
  if (e.flags & 1) {
@@ -600,7 +608,7 @@ var Vue = (function () {
600
608
  link.dep.activeLink = link;
601
609
  }
602
610
  }
603
- function cleanupDeps(sub, fromComputed = false) {
611
+ function cleanupDeps(sub) {
604
612
  let head;
605
613
  let tail = sub.depsTail;
606
614
  let link = tail;
@@ -608,7 +616,7 @@ var Vue = (function () {
608
616
  const prev = link.prevDep;
609
617
  if (link.version === -1) {
610
618
  if (link === tail) tail = prev;
611
- removeSub(link, fromComputed);
619
+ removeSub(link);
612
620
  removeDep(link);
613
621
  } else {
614
622
  head = link;
@@ -663,11 +671,11 @@ var Vue = (function () {
663
671
  } finally {
664
672
  activeSub = prevSub;
665
673
  shouldTrack = prevShouldTrack;
666
- cleanupDeps(computed, true);
674
+ cleanupDeps(computed);
667
675
  computed.flags &= ~2;
668
676
  }
669
677
  }
670
- function removeSub(link, fromComputed = false) {
678
+ function removeSub(link, soft = false) {
671
679
  const { dep, prevSub, nextSub } = link;
672
680
  if (prevSub) {
673
681
  prevSub.nextSub = nextSub;
@@ -683,17 +691,15 @@ var Vue = (function () {
683
691
  if (dep.subsHead === link) {
684
692
  dep.subsHead = nextSub;
685
693
  }
686
- if (!dep.subs) {
687
- if (dep.computed) {
688
- dep.computed.flags &= ~4;
689
- for (let l = dep.computed.deps; l; l = l.nextDep) {
690
- removeSub(l, true);
691
- }
692
- } else if (dep.map && !fromComputed) {
693
- dep.map.delete(dep.key);
694
- if (!dep.map.size) targetMap.delete(dep.target);
694
+ if (!dep.subs && dep.computed) {
695
+ dep.computed.flags &= ~4;
696
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
697
+ removeSub(l, true);
695
698
  }
696
699
  }
700
+ if (!soft && !--dep.sc && dep.map) {
701
+ dep.map.delete(dep.key);
702
+ }
697
703
  }
698
704
  function removeDep(link) {
699
705
  const { prevDep, nextDep } = link;
@@ -778,6 +784,10 @@ var Vue = (function () {
778
784
  this.target = void 0;
779
785
  this.map = void 0;
780
786
  this.key = void 0;
787
+ /**
788
+ * Subscriber counter
789
+ */
790
+ this.sc = 0;
781
791
  {
782
792
  this.subsHead = void 0;
783
793
  }
@@ -796,9 +806,7 @@ var Vue = (function () {
796
806
  activeSub.depsTail.nextDep = link;
797
807
  activeSub.depsTail = link;
798
808
  }
799
- if (activeSub.flags & 4) {
800
- addSub(link);
801
- }
809
+ addSub(link);
802
810
  } else if (link.version === -1) {
803
811
  link.version = this.version;
804
812
  if (link.nextDep) {
@@ -862,22 +870,25 @@ var Vue = (function () {
862
870
  }
863
871
  }
864
872
  function addSub(link) {
865
- const computed = link.dep.computed;
866
- if (computed && !link.dep.subs) {
867
- computed.flags |= 4 | 16;
868
- for (let l = computed.deps; l; l = l.nextDep) {
869
- addSub(l);
873
+ link.dep.sc++;
874
+ if (link.sub.flags & 4) {
875
+ const computed = link.dep.computed;
876
+ if (computed && !link.dep.subs) {
877
+ computed.flags |= 4 | 16;
878
+ for (let l = computed.deps; l; l = l.nextDep) {
879
+ addSub(l);
880
+ }
870
881
  }
882
+ const currentTail = link.dep.subs;
883
+ if (currentTail !== link) {
884
+ link.prevSub = currentTail;
885
+ if (currentTail) currentTail.nextSub = link;
886
+ }
887
+ if (link.dep.subsHead === void 0) {
888
+ link.dep.subsHead = link;
889
+ }
890
+ link.dep.subs = link;
871
891
  }
872
- const currentTail = link.dep.subs;
873
- if (currentTail !== link) {
874
- link.prevSub = currentTail;
875
- if (currentTail) currentTail.nextSub = link;
876
- }
877
- if (link.dep.subsHead === void 0) {
878
- link.dep.subsHead = link;
879
- }
880
- link.dep.subs = link;
881
892
  }
882
893
  const targetMap = /* @__PURE__ */ new WeakMap();
883
894
  const ITERATE_KEY = Symbol(
@@ -981,8 +992,8 @@ var Vue = (function () {
981
992
  endBatch();
982
993
  }
983
994
  function getDepFromReactive(object, key) {
984
- var _a;
985
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
995
+ const depMap = targetMap.get(object);
996
+ return depMap && depMap.get(key);
986
997
  }
987
998
 
988
999
  function reactiveReadArray(array) {
@@ -1918,6 +1929,10 @@ var Vue = (function () {
1918
1929
  * @internal
1919
1930
  */
1920
1931
  this.globalVersion = globalVersion - 1;
1932
+ /**
1933
+ * @internal
1934
+ */
1935
+ this.next = void 0;
1921
1936
  // for backwards compat
1922
1937
  this.effect = this;
1923
1938
  this["__v_isReadonly"] = !setter;
@@ -4165,6 +4180,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4165
4180
  `useId() is called when there is no active component instance to be associated with.`
4166
4181
  );
4167
4182
  }
4183
+ return "";
4168
4184
  }
4169
4185
  function markAsyncBoundary(instance) {
4170
4186
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
@@ -7077,7 +7093,7 @@ If this is a native custom element, make sure to exclude it from component resol
7077
7093
  return vm;
7078
7094
  }
7079
7095
  }
7080
- Vue.version = `2.6.14-compat:${"3.5.8"}`;
7096
+ Vue.version = `2.6.14-compat:${"3.5.10"}`;
7081
7097
  Vue.config = singletonApp.config;
7082
7098
  Vue.use = (plugin, ...options) => {
7083
7099
  if (plugin && isFunction(plugin.install)) {
@@ -11412,7 +11428,7 @@ Component that was made reactive: `,
11412
11428
  // #3666, avoid reference pollution when reusing vnode
11413
11429
  child.slice()
11414
11430
  );
11415
- } else if (typeof child === "object") {
11431
+ } else if (isVNode(child)) {
11416
11432
  return cloneIfMounted(child);
11417
11433
  } else {
11418
11434
  return createVNode(Text, null, String(child));
@@ -12155,7 +12171,7 @@ Component that was made reactive: `,
12155
12171
  return true;
12156
12172
  }
12157
12173
 
12158
- const version = "3.5.8";
12174
+ const version = "3.5.10";
12159
12175
  const warn = warn$1 ;
12160
12176
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12161
12177
  const devtools = devtools$1 ;
@@ -13011,6 +13027,11 @@ Expected function or array of functions, received type ${typeof value}.`
13011
13027
  if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
13012
13028
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
13013
13029
  }
13030
+ } else if (
13031
+ // #11081 force set props for possible async custom element
13032
+ el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13033
+ ) {
13034
+ patchDOMProp(el, camelize(key), nextValue, parentComponent);
13014
13035
  } else {
13015
13036
  if (key === "true-value") {
13016
13037
  el._trueValue = nextValue;
@@ -13051,13 +13072,7 @@ Expected function or array of functions, received type ${typeof value}.`
13051
13072
  if (isNativeOn(key) && isString(value)) {
13052
13073
  return false;
13053
13074
  }
13054
- if (key in el) {
13055
- return true;
13056
- }
13057
- if (el._isVueCE && (/[A-Z]/.test(key) || !isString(value))) {
13058
- return true;
13059
- }
13060
- return false;
13075
+ return key in el;
13061
13076
  }
13062
13077
 
13063
13078
  const REMOVAL = {};
@@ -13731,7 +13746,7 @@ Expected function or array of functions, received type ${typeof value}.`
13731
13746
  setChecked(el, binding, vnode);
13732
13747
  }
13733
13748
  };
13734
- function setChecked(el, { value, oldValue }, vnode) {
13749
+ function setChecked(el, { value }, vnode) {
13735
13750
  el._modelValue = value;
13736
13751
  let checked;
13737
13752
  if (isArray(value)) {
@@ -13781,19 +13796,19 @@ Expected function or array of functions, received type ${typeof value}.`
13781
13796
  },
13782
13797
  // set value in mounted & updated because <select> relies on its children
13783
13798
  // <option>s.
13784
- mounted(el, { value, modifiers: { number } }) {
13799
+ mounted(el, { value }) {
13785
13800
  setSelected(el, value);
13786
13801
  },
13787
13802
  beforeUpdate(el, _binding, vnode) {
13788
13803
  el[assignKey] = getModelAssigner(vnode);
13789
13804
  },
13790
- updated(el, { value, modifiers: { number } }) {
13805
+ updated(el, { value }) {
13791
13806
  if (!el._assigning) {
13792
13807
  setSelected(el, value);
13793
13808
  }
13794
13809
  }
13795
13810
  };
13796
- function setSelected(el, value, number) {
13811
+ function setSelected(el, value) {
13797
13812
  const isMultiple = el.multiple;
13798
13813
  const isArrayValue = isArray(value);
13799
13814
  if (isMultiple && !isArrayValue && !isSet(value)) {