@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
  **/
@@ -106,6 +106,12 @@ let _globalThis;
106
106
  const getGlobalThis = () => {
107
107
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
108
108
  };
109
+ function genCacheKey(source, options) {
110
+ return source + JSON.stringify(
111
+ options,
112
+ (_, val) => typeof val === "function" ? val.toString() : val
113
+ );
114
+ }
109
115
 
110
116
  const PatchFlagNames = {
111
117
  [1]: `TEXT`,
@@ -639,9 +645,17 @@ function endBatch() {
639
645
  let error;
640
646
  while (batchedSub) {
641
647
  let e = batchedSub;
648
+ let next;
649
+ while (e) {
650
+ if (!(e.flags & 1)) {
651
+ e.flags &= ~8;
652
+ }
653
+ e = e.next;
654
+ }
655
+ e = batchedSub;
642
656
  batchedSub = void 0;
643
657
  while (e) {
644
- const next = e.next;
658
+ next = e.next;
645
659
  e.next = void 0;
646
660
  e.flags &= ~8;
647
661
  if (e.flags & 1) {
@@ -664,7 +678,7 @@ function prepareDeps(sub) {
664
678
  link.dep.activeLink = link;
665
679
  }
666
680
  }
667
- function cleanupDeps(sub, fromComputed = false) {
681
+ function cleanupDeps(sub) {
668
682
  let head;
669
683
  let tail = sub.depsTail;
670
684
  let link = tail;
@@ -672,7 +686,7 @@ function cleanupDeps(sub, fromComputed = false) {
672
686
  const prev = link.prevDep;
673
687
  if (link.version === -1) {
674
688
  if (link === tail) tail = prev;
675
- removeSub(link, fromComputed);
689
+ removeSub(link);
676
690
  removeDep(link);
677
691
  } else {
678
692
  head = link;
@@ -727,11 +741,11 @@ function refreshComputed(computed) {
727
741
  } finally {
728
742
  activeSub = prevSub;
729
743
  shouldTrack = prevShouldTrack;
730
- cleanupDeps(computed, true);
744
+ cleanupDeps(computed);
731
745
  computed.flags &= ~2;
732
746
  }
733
747
  }
734
- function removeSub(link, fromComputed = false) {
748
+ function removeSub(link, soft = false) {
735
749
  const { dep, prevSub, nextSub } = link;
736
750
  if (prevSub) {
737
751
  prevSub.nextSub = nextSub;
@@ -747,17 +761,15 @@ function removeSub(link, fromComputed = false) {
747
761
  if (!!(process.env.NODE_ENV !== "production") && dep.subsHead === link) {
748
762
  dep.subsHead = nextSub;
749
763
  }
750
- if (!dep.subs) {
751
- if (dep.computed) {
752
- dep.computed.flags &= ~4;
753
- for (let l = dep.computed.deps; l; l = l.nextDep) {
754
- removeSub(l, true);
755
- }
756
- } else if (dep.map && !fromComputed) {
757
- dep.map.delete(dep.key);
758
- if (!dep.map.size) targetMap.delete(dep.target);
764
+ if (!dep.subs && dep.computed) {
765
+ dep.computed.flags &= ~4;
766
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
767
+ removeSub(l, true);
759
768
  }
760
769
  }
770
+ if (!soft && !--dep.sc && dep.map) {
771
+ dep.map.delete(dep.key);
772
+ }
761
773
  }
762
774
  function removeDep(link) {
763
775
  const { prevDep, nextDep } = link;
@@ -842,6 +854,10 @@ class Dep {
842
854
  this.target = void 0;
843
855
  this.map = void 0;
844
856
  this.key = void 0;
857
+ /**
858
+ * Subscriber counter
859
+ */
860
+ this.sc = 0;
845
861
  if (!!(process.env.NODE_ENV !== "production")) {
846
862
  this.subsHead = void 0;
847
863
  }
@@ -860,9 +876,7 @@ class Dep {
860
876
  activeSub.depsTail.nextDep = link;
861
877
  activeSub.depsTail = link;
862
878
  }
863
- if (activeSub.flags & 4) {
864
- addSub(link);
865
- }
879
+ addSub(link);
866
880
  } else if (link.version === -1) {
867
881
  link.version = this.version;
868
882
  if (link.nextDep) {
@@ -926,22 +940,25 @@ class Dep {
926
940
  }
927
941
  }
928
942
  function addSub(link) {
929
- const computed = link.dep.computed;
930
- if (computed && !link.dep.subs) {
931
- computed.flags |= 4 | 16;
932
- for (let l = computed.deps; l; l = l.nextDep) {
933
- addSub(l);
943
+ link.dep.sc++;
944
+ if (link.sub.flags & 4) {
945
+ const computed = link.dep.computed;
946
+ if (computed && !link.dep.subs) {
947
+ computed.flags |= 4 | 16;
948
+ for (let l = computed.deps; l; l = l.nextDep) {
949
+ addSub(l);
950
+ }
934
951
  }
952
+ const currentTail = link.dep.subs;
953
+ if (currentTail !== link) {
954
+ link.prevSub = currentTail;
955
+ if (currentTail) currentTail.nextSub = link;
956
+ }
957
+ if (!!(process.env.NODE_ENV !== "production") && link.dep.subsHead === void 0) {
958
+ link.dep.subsHead = link;
959
+ }
960
+ link.dep.subs = link;
935
961
  }
936
- const currentTail = link.dep.subs;
937
- if (currentTail !== link) {
938
- link.prevSub = currentTail;
939
- if (currentTail) currentTail.nextSub = link;
940
- }
941
- if (!!(process.env.NODE_ENV !== "production") && link.dep.subsHead === void 0) {
942
- link.dep.subsHead = link;
943
- }
944
- link.dep.subs = link;
945
962
  }
946
963
  const targetMap = /* @__PURE__ */ new WeakMap();
947
964
  const ITERATE_KEY = Symbol(
@@ -1049,8 +1066,8 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
1049
1066
  endBatch();
1050
1067
  }
1051
1068
  function getDepFromReactive(object, key) {
1052
- var _a;
1053
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
1069
+ const depMap = targetMap.get(object);
1070
+ return depMap && depMap.get(key);
1054
1071
  }
1055
1072
 
1056
1073
  function reactiveReadArray(array) {
@@ -1992,6 +2009,10 @@ class ComputedRefImpl {
1992
2009
  * @internal
1993
2010
  */
1994
2011
  this.globalVersion = globalVersion - 1;
2012
+ /**
2013
+ * @internal
2014
+ */
2015
+ this.next = void 0;
1995
2016
  // for backwards compat
1996
2017
  this.effect = this;
1997
2018
  this["__v_isReadonly"] = !setter;
@@ -4248,6 +4269,7 @@ function useId() {
4248
4269
  `useId() is called when there is no active component instance to be associated with.`
4249
4270
  );
4250
4271
  }
4272
+ return "";
4251
4273
  }
4252
4274
  function markAsyncBoundary(instance) {
4253
4275
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
@@ -7182,7 +7204,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7182
7204
  return vm;
7183
7205
  }
7184
7206
  }
7185
- Vue.version = `2.6.14-compat:${"3.5.8"}`;
7207
+ Vue.version = `2.6.14-compat:${"3.5.10"}`;
7186
7208
  Vue.config = singletonApp.config;
7187
7209
  Vue.use = (plugin, ...options) => {
7188
7210
  if (plugin && isFunction(plugin.install)) {
@@ -11580,7 +11602,7 @@ function normalizeVNode(child) {
11580
11602
  // #3666, avoid reference pollution when reusing vnode
11581
11603
  child.slice()
11582
11604
  );
11583
- } else if (typeof child === "object") {
11605
+ } else if (isVNode(child)) {
11584
11606
  return cloneIfMounted(child);
11585
11607
  } else {
11586
11608
  return createVNode(Text, null, String(child));
@@ -12351,7 +12373,7 @@ function isMemoSame(cached, memo) {
12351
12373
  return true;
12352
12374
  }
12353
12375
 
12354
- const version = "3.5.8";
12376
+ const version = "3.5.10";
12355
12377
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12356
12378
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12357
12379
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -13226,6 +13248,11 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
13226
13248
  if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
13227
13249
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
13228
13250
  }
13251
+ } else if (
13252
+ // #11081 force set props for possible async custom element
13253
+ el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13254
+ ) {
13255
+ patchDOMProp(el, camelize(key), nextValue, parentComponent);
13229
13256
  } else {
13230
13257
  if (key === "true-value") {
13231
13258
  el._trueValue = nextValue;
@@ -13266,13 +13293,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
13266
13293
  if (isNativeOn(key) && isString(value)) {
13267
13294
  return false;
13268
13295
  }
13269
- if (key in el) {
13270
- return true;
13271
- }
13272
- if (el._isVueCE && (/[A-Z]/.test(key) || !isString(value))) {
13273
- return true;
13274
- }
13275
- return false;
13296
+ return key in el;
13276
13297
  }
13277
13298
 
13278
13299
  const REMOVAL = {};
@@ -13958,7 +13979,7 @@ const vModelCheckbox = {
13958
13979
  setChecked(el, binding, vnode);
13959
13980
  }
13960
13981
  };
13961
- function setChecked(el, { value, oldValue }, vnode) {
13982
+ function setChecked(el, { value }, vnode) {
13962
13983
  el._modelValue = value;
13963
13984
  let checked;
13964
13985
  if (isArray(value)) {
@@ -14008,19 +14029,19 @@ const vModelSelect = {
14008
14029
  },
14009
14030
  // set value in mounted & updated because <select> relies on its children
14010
14031
  // <option>s.
14011
- mounted(el, { value, modifiers: { number } }) {
14032
+ mounted(el, { value }) {
14012
14033
  setSelected(el, value);
14013
14034
  },
14014
14035
  beforeUpdate(el, _binding, vnode) {
14015
14036
  el[assignKey] = getModelAssigner(vnode);
14016
14037
  },
14017
- updated(el, { value, modifiers: { number } }) {
14038
+ updated(el, { value }) {
14018
14039
  if (!el._assigning) {
14019
14040
  setSelected(el, value);
14020
14041
  }
14021
14042
  }
14022
14043
  };
14023
- function setSelected(el, value, number) {
14044
+ function setSelected(el, value) {
14024
14045
  const isMultiple = el.multiple;
14025
14046
  const isArrayValue = isArray(value);
14026
14047
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -20494,7 +20515,7 @@ function compileToFunction(template, options) {
20494
20515
  return NOOP;
20495
20516
  }
20496
20517
  }
20497
- const key = template;
20518
+ const key = genCacheKey(template, options);
20498
20519
  const cached = compileCache[key];
20499
20520
  if (cached) {
20500
20521
  return cached;
@@ -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
  **/
@@ -109,6 +109,12 @@ var Vue = (function () {
109
109
  const getGlobalThis = () => {
110
110
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
111
111
  };
112
+ function genCacheKey(source, options) {
113
+ return source + JSON.stringify(
114
+ options,
115
+ (_, val) => typeof val === "function" ? val.toString() : val
116
+ );
117
+ }
112
118
 
113
119
  const PatchFlagNames = {
114
120
  [1]: `TEXT`,
@@ -642,9 +648,17 @@ var Vue = (function () {
642
648
  let error;
643
649
  while (batchedSub) {
644
650
  let e = batchedSub;
651
+ let next;
652
+ while (e) {
653
+ if (!(e.flags & 1)) {
654
+ e.flags &= ~8;
655
+ }
656
+ e = e.next;
657
+ }
658
+ e = batchedSub;
645
659
  batchedSub = void 0;
646
660
  while (e) {
647
- const next = e.next;
661
+ next = e.next;
648
662
  e.next = void 0;
649
663
  e.flags &= ~8;
650
664
  if (e.flags & 1) {
@@ -667,7 +681,7 @@ var Vue = (function () {
667
681
  link.dep.activeLink = link;
668
682
  }
669
683
  }
670
- function cleanupDeps(sub, fromComputed = false) {
684
+ function cleanupDeps(sub) {
671
685
  let head;
672
686
  let tail = sub.depsTail;
673
687
  let link = tail;
@@ -675,7 +689,7 @@ var Vue = (function () {
675
689
  const prev = link.prevDep;
676
690
  if (link.version === -1) {
677
691
  if (link === tail) tail = prev;
678
- removeSub(link, fromComputed);
692
+ removeSub(link);
679
693
  removeDep(link);
680
694
  } else {
681
695
  head = link;
@@ -730,11 +744,11 @@ var Vue = (function () {
730
744
  } finally {
731
745
  activeSub = prevSub;
732
746
  shouldTrack = prevShouldTrack;
733
- cleanupDeps(computed, true);
747
+ cleanupDeps(computed);
734
748
  computed.flags &= ~2;
735
749
  }
736
750
  }
737
- function removeSub(link, fromComputed = false) {
751
+ function removeSub(link, soft = false) {
738
752
  const { dep, prevSub, nextSub } = link;
739
753
  if (prevSub) {
740
754
  prevSub.nextSub = nextSub;
@@ -750,17 +764,15 @@ var Vue = (function () {
750
764
  if (dep.subsHead === link) {
751
765
  dep.subsHead = nextSub;
752
766
  }
753
- if (!dep.subs) {
754
- if (dep.computed) {
755
- dep.computed.flags &= ~4;
756
- for (let l = dep.computed.deps; l; l = l.nextDep) {
757
- removeSub(l, true);
758
- }
759
- } else if (dep.map && !fromComputed) {
760
- dep.map.delete(dep.key);
761
- if (!dep.map.size) targetMap.delete(dep.target);
767
+ if (!dep.subs && dep.computed) {
768
+ dep.computed.flags &= ~4;
769
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
770
+ removeSub(l, true);
762
771
  }
763
772
  }
773
+ if (!soft && !--dep.sc && dep.map) {
774
+ dep.map.delete(dep.key);
775
+ }
764
776
  }
765
777
  function removeDep(link) {
766
778
  const { prevDep, nextDep } = link;
@@ -845,6 +857,10 @@ var Vue = (function () {
845
857
  this.target = void 0;
846
858
  this.map = void 0;
847
859
  this.key = void 0;
860
+ /**
861
+ * Subscriber counter
862
+ */
863
+ this.sc = 0;
848
864
  {
849
865
  this.subsHead = void 0;
850
866
  }
@@ -863,9 +879,7 @@ var Vue = (function () {
863
879
  activeSub.depsTail.nextDep = link;
864
880
  activeSub.depsTail = link;
865
881
  }
866
- if (activeSub.flags & 4) {
867
- addSub(link);
868
- }
882
+ addSub(link);
869
883
  } else if (link.version === -1) {
870
884
  link.version = this.version;
871
885
  if (link.nextDep) {
@@ -929,22 +943,25 @@ var Vue = (function () {
929
943
  }
930
944
  }
931
945
  function addSub(link) {
932
- const computed = link.dep.computed;
933
- if (computed && !link.dep.subs) {
934
- computed.flags |= 4 | 16;
935
- for (let l = computed.deps; l; l = l.nextDep) {
936
- addSub(l);
946
+ link.dep.sc++;
947
+ if (link.sub.flags & 4) {
948
+ const computed = link.dep.computed;
949
+ if (computed && !link.dep.subs) {
950
+ computed.flags |= 4 | 16;
951
+ for (let l = computed.deps; l; l = l.nextDep) {
952
+ addSub(l);
953
+ }
937
954
  }
955
+ const currentTail = link.dep.subs;
956
+ if (currentTail !== link) {
957
+ link.prevSub = currentTail;
958
+ if (currentTail) currentTail.nextSub = link;
959
+ }
960
+ if (link.dep.subsHead === void 0) {
961
+ link.dep.subsHead = link;
962
+ }
963
+ link.dep.subs = link;
938
964
  }
939
- const currentTail = link.dep.subs;
940
- if (currentTail !== link) {
941
- link.prevSub = currentTail;
942
- if (currentTail) currentTail.nextSub = link;
943
- }
944
- if (link.dep.subsHead === void 0) {
945
- link.dep.subsHead = link;
946
- }
947
- link.dep.subs = link;
948
965
  }
949
966
  const targetMap = /* @__PURE__ */ new WeakMap();
950
967
  const ITERATE_KEY = Symbol(
@@ -1048,8 +1065,8 @@ var Vue = (function () {
1048
1065
  endBatch();
1049
1066
  }
1050
1067
  function getDepFromReactive(object, key) {
1051
- var _a;
1052
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
1068
+ const depMap = targetMap.get(object);
1069
+ return depMap && depMap.get(key);
1053
1070
  }
1054
1071
 
1055
1072
  function reactiveReadArray(array) {
@@ -1985,6 +2002,10 @@ var Vue = (function () {
1985
2002
  * @internal
1986
2003
  */
1987
2004
  this.globalVersion = globalVersion - 1;
2005
+ /**
2006
+ * @internal
2007
+ */
2008
+ this.next = void 0;
1988
2009
  // for backwards compat
1989
2010
  this.effect = this;
1990
2011
  this["__v_isReadonly"] = !setter;
@@ -4232,6 +4253,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4232
4253
  `useId() is called when there is no active component instance to be associated with.`
4233
4254
  );
4234
4255
  }
4256
+ return "";
4235
4257
  }
4236
4258
  function markAsyncBoundary(instance) {
4237
4259
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
@@ -7144,7 +7166,7 @@ If this is a native custom element, make sure to exclude it from component resol
7144
7166
  return vm;
7145
7167
  }
7146
7168
  }
7147
- Vue.version = `2.6.14-compat:${"3.5.8"}`;
7169
+ Vue.version = `2.6.14-compat:${"3.5.10"}`;
7148
7170
  Vue.config = singletonApp.config;
7149
7171
  Vue.use = (plugin, ...options) => {
7150
7172
  if (plugin && isFunction(plugin.install)) {
@@ -11479,7 +11501,7 @@ Component that was made reactive: `,
11479
11501
  // #3666, avoid reference pollution when reusing vnode
11480
11502
  child.slice()
11481
11503
  );
11482
- } else if (typeof child === "object") {
11504
+ } else if (isVNode(child)) {
11483
11505
  return cloneIfMounted(child);
11484
11506
  } else {
11485
11507
  return createVNode(Text, null, String(child));
@@ -12222,7 +12244,7 @@ Component that was made reactive: `,
12222
12244
  return true;
12223
12245
  }
12224
12246
 
12225
- const version = "3.5.8";
12247
+ const version = "3.5.10";
12226
12248
  const warn = warn$1 ;
12227
12249
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12228
12250
  const devtools = devtools$1 ;
@@ -13078,6 +13100,11 @@ Expected function or array of functions, received type ${typeof value}.`
13078
13100
  if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
13079
13101
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
13080
13102
  }
13103
+ } else if (
13104
+ // #11081 force set props for possible async custom element
13105
+ el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13106
+ ) {
13107
+ patchDOMProp(el, camelize(key), nextValue, parentComponent);
13081
13108
  } else {
13082
13109
  if (key === "true-value") {
13083
13110
  el._trueValue = nextValue;
@@ -13118,13 +13145,7 @@ Expected function or array of functions, received type ${typeof value}.`
13118
13145
  if (isNativeOn(key) && isString(value)) {
13119
13146
  return false;
13120
13147
  }
13121
- if (key in el) {
13122
- return true;
13123
- }
13124
- if (el._isVueCE && (/[A-Z]/.test(key) || !isString(value))) {
13125
- return true;
13126
- }
13127
- return false;
13148
+ return key in el;
13128
13149
  }
13129
13150
 
13130
13151
  const REMOVAL = {};
@@ -13798,7 +13819,7 @@ Expected function or array of functions, received type ${typeof value}.`
13798
13819
  setChecked(el, binding, vnode);
13799
13820
  }
13800
13821
  };
13801
- function setChecked(el, { value, oldValue }, vnode) {
13822
+ function setChecked(el, { value }, vnode) {
13802
13823
  el._modelValue = value;
13803
13824
  let checked;
13804
13825
  if (isArray(value)) {
@@ -13848,19 +13869,19 @@ Expected function or array of functions, received type ${typeof value}.`
13848
13869
  },
13849
13870
  // set value in mounted & updated because <select> relies on its children
13850
13871
  // <option>s.
13851
- mounted(el, { value, modifiers: { number } }) {
13872
+ mounted(el, { value }) {
13852
13873
  setSelected(el, value);
13853
13874
  },
13854
13875
  beforeUpdate(el, _binding, vnode) {
13855
13876
  el[assignKey] = getModelAssigner(vnode);
13856
13877
  },
13857
- updated(el, { value, modifiers: { number } }) {
13878
+ updated(el, { value }) {
13858
13879
  if (!el._assigning) {
13859
13880
  setSelected(el, value);
13860
13881
  }
13861
13882
  }
13862
13883
  };
13863
- function setSelected(el, value, number) {
13884
+ function setSelected(el, value) {
13864
13885
  const isMultiple = el.multiple;
13865
13886
  const isArrayValue = isArray(value);
13866
13887
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -20296,7 +20317,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
20296
20317
  return NOOP;
20297
20318
  }
20298
20319
  }
20299
- const key = template;
20320
+ const key = genCacheKey(template, options);
20300
20321
  const cached = compileCache[key];
20301
20322
  if (cached) {
20302
20323
  return cached;