vue 3.5.7 → 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 v3.5.7
2
+ * vue v3.5.9
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -7,7 +7,7 @@ import * as runtimeDom from '@vue/runtime-dom';
7
7
  import { initCustomFormatter, registerRuntimeCompiler, warn } from '@vue/runtime-dom';
8
8
  export * from '@vue/runtime-dom';
9
9
  import { compile } from '@vue/compiler-dom';
10
- import { isString, NOOP, extend, generateCodeFrame, EMPTY_OBJ } from '@vue/shared';
10
+ import { isString, NOOP, genCacheKey, extend, generateCodeFrame } from '@vue/shared';
11
11
 
12
12
  function initDev() {
13
13
  {
@@ -18,15 +18,7 @@ function initDev() {
18
18
  if (!!(process.env.NODE_ENV !== "production")) {
19
19
  initDev();
20
20
  }
21
- const compileCache = /* @__PURE__ */ new WeakMap();
22
- function getCache(options) {
23
- let c = compileCache.get(options != null ? options : EMPTY_OBJ);
24
- if (!c) {
25
- c = /* @__PURE__ */ Object.create(null);
26
- compileCache.set(options != null ? options : EMPTY_OBJ, c);
27
- }
28
- return c;
29
- }
21
+ const compileCache = /* @__PURE__ */ Object.create(null);
30
22
  function compileToFunction(template, options) {
31
23
  if (!isString(template)) {
32
24
  if (template.nodeType) {
@@ -36,9 +28,8 @@ function compileToFunction(template, options) {
36
28
  return NOOP;
37
29
  }
38
30
  }
39
- const key = template;
40
- const cache = getCache(options);
41
- const cached = cache[key];
31
+ const key = genCacheKey(template, options);
32
+ const cached = compileCache[key];
42
33
  if (cached) {
43
34
  return cached;
44
35
  }
@@ -73,7 +64,7 @@ ${codeFrame}` : message);
73
64
  }
74
65
  const render = new Function("Vue", code)(runtimeDom);
75
66
  render._rc = true;
76
- return cache[key] = render;
67
+ return compileCache[key] = render;
77
68
  }
78
69
  registerRuntimeCompiler(compileToFunction);
79
70
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.7
2
+ * vue v3.5.9
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -109,6 +109,12 @@ var Vue = (function (exports) {
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,11 +648,14 @@ var Vue = (function (exports) {
642
648
  let error;
643
649
  while (batchedSub) {
644
650
  let e = batchedSub;
645
- batchedSub = void 0;
651
+ let next;
646
652
  while (e) {
647
- const next = e.next;
648
- e.next = void 0;
649
653
  e.flags &= ~8;
654
+ e = e.next;
655
+ }
656
+ e = batchedSub;
657
+ batchedSub = void 0;
658
+ while (e) {
650
659
  if (e.flags & 1) {
651
660
  try {
652
661
  ;
@@ -655,6 +664,8 @@ var Vue = (function (exports) {
655
664
  if (!error) error = err;
656
665
  }
657
666
  }
667
+ next = e.next;
668
+ e.next = void 0;
658
669
  e = next;
659
670
  }
660
671
  }
@@ -734,7 +745,7 @@ var Vue = (function (exports) {
734
745
  computed.flags &= ~2;
735
746
  }
736
747
  }
737
- function removeSub(link, fromComputed = false) {
748
+ function removeSub(link, soft = false) {
738
749
  const { dep, prevSub, nextSub } = link;
739
750
  if (prevSub) {
740
751
  prevSub.nextSub = nextSub;
@@ -750,17 +761,15 @@ var Vue = (function (exports) {
750
761
  if (dep.subsHead === link) {
751
762
  dep.subsHead = nextSub;
752
763
  }
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);
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);
762
768
  }
763
769
  }
770
+ if (!soft && !--dep.sc && dep.map) {
771
+ dep.map.delete(dep.key);
772
+ }
764
773
  }
765
774
  function removeDep(link) {
766
775
  const { prevDep, nextDep } = link;
@@ -845,6 +854,10 @@ var Vue = (function (exports) {
845
854
  this.target = void 0;
846
855
  this.map = void 0;
847
856
  this.key = void 0;
857
+ /**
858
+ * Subscriber counter
859
+ */
860
+ this.sc = 0;
848
861
  {
849
862
  this.subsHead = void 0;
850
863
  }
@@ -863,9 +876,7 @@ var Vue = (function (exports) {
863
876
  activeSub.depsTail.nextDep = link;
864
877
  activeSub.depsTail = link;
865
878
  }
866
- if (activeSub.flags & 4) {
867
- addSub(link);
868
- }
879
+ addSub(link);
869
880
  } else if (link.version === -1) {
870
881
  link.version = this.version;
871
882
  if (link.nextDep) {
@@ -929,22 +940,25 @@ var Vue = (function (exports) {
929
940
  }
930
941
  }
931
942
  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);
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
+ }
937
951
  }
952
+ const currentTail = link.dep.subs;
953
+ if (currentTail !== link) {
954
+ link.prevSub = currentTail;
955
+ if (currentTail) currentTail.nextSub = link;
956
+ }
957
+ if (link.dep.subsHead === void 0) {
958
+ link.dep.subsHead = link;
959
+ }
960
+ link.dep.subs = link;
938
961
  }
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
962
  }
949
963
  const targetMap = /* @__PURE__ */ new WeakMap();
950
964
  const ITERATE_KEY = Symbol(
@@ -1048,8 +1062,8 @@ var Vue = (function (exports) {
1048
1062
  endBatch();
1049
1063
  }
1050
1064
  function getDepFromReactive(object, key) {
1051
- var _a;
1052
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
1065
+ const depMap = targetMap.get(object);
1066
+ return depMap && depMap.get(key);
1053
1067
  }
1054
1068
 
1055
1069
  function reactiveReadArray(array) {
@@ -3701,6 +3715,7 @@ var Vue = (function (exports) {
3701
3715
  `useId() is called when there is no active component instance to be associated with.`
3702
3716
  );
3703
3717
  }
3718
+ return "";
3704
3719
  }
3705
3720
  function markAsyncBoundary(instance) {
3706
3721
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
@@ -9729,7 +9744,7 @@ Component that was made reactive: `,
9729
9744
  // #3666, avoid reference pollution when reusing vnode
9730
9745
  child.slice()
9731
9746
  );
9732
- } else if (typeof child === "object") {
9747
+ } else if (isVNode(child)) {
9733
9748
  return cloneIfMounted(child);
9734
9749
  } else {
9735
9750
  return createVNode(Text, null, String(child));
@@ -10460,7 +10475,7 @@ Component that was made reactive: `,
10460
10475
  return true;
10461
10476
  }
10462
10477
 
10463
- const version = "3.5.7";
10478
+ const version = "3.5.9";
10464
10479
  const warn = warn$1 ;
10465
10480
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10466
10481
  const devtools = devtools$1 ;
@@ -11939,7 +11954,7 @@ Expected function or array of functions, received type ${typeof value}.`
11939
11954
  setChecked(el, binding, vnode);
11940
11955
  }
11941
11956
  };
11942
- function setChecked(el, { value, oldValue }, vnode) {
11957
+ function setChecked(el, { value }, vnode) {
11943
11958
  el._modelValue = value;
11944
11959
  let checked;
11945
11960
  if (isArray(value)) {
@@ -11989,19 +12004,19 @@ Expected function or array of functions, received type ${typeof value}.`
11989
12004
  },
11990
12005
  // set value in mounted & updated because <select> relies on its children
11991
12006
  // <option>s.
11992
- mounted(el, { value, modifiers: { number } }) {
12007
+ mounted(el, { value }) {
11993
12008
  setSelected(el, value);
11994
12009
  },
11995
12010
  beforeUpdate(el, _binding, vnode) {
11996
12011
  el[assignKey] = getModelAssigner(vnode);
11997
12012
  },
11998
- updated(el, { value, modifiers: { number } }) {
12013
+ updated(el, { value }) {
11999
12014
  if (!el._assigning) {
12000
12015
  setSelected(el, value);
12001
12016
  }
12002
12017
  }
12003
12018
  };
12004
- function setSelected(el, value, number) {
12019
+ function setSelected(el, value) {
12005
12020
  const isMultiple = el.multiple;
12006
12021
  const isArrayValue = isArray(value);
12007
12022
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -17829,15 +17844,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17829
17844
  {
17830
17845
  initDev();
17831
17846
  }
17832
- const compileCache = /* @__PURE__ */ new WeakMap();
17833
- function getCache(options) {
17834
- let c = compileCache.get(options != null ? options : EMPTY_OBJ);
17835
- if (!c) {
17836
- c = /* @__PURE__ */ Object.create(null);
17837
- compileCache.set(options != null ? options : EMPTY_OBJ, c);
17838
- }
17839
- return c;
17840
- }
17847
+ const compileCache = /* @__PURE__ */ Object.create(null);
17841
17848
  function compileToFunction(template, options) {
17842
17849
  if (!isString(template)) {
17843
17850
  if (template.nodeType) {
@@ -17847,9 +17854,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17847
17854
  return NOOP;
17848
17855
  }
17849
17856
  }
17850
- const key = template;
17851
- const cache = getCache(options);
17852
- const cached = cache[key];
17857
+ const key = genCacheKey(template, options);
17858
+ const cached = compileCache[key];
17853
17859
  if (cached) {
17854
17860
  return cached;
17855
17861
  }
@@ -17884,7 +17890,7 @@ ${codeFrame}` : message);
17884
17890
  }
17885
17891
  const render = new Function(code)() ;
17886
17892
  render._rc = true;
17887
- return cache[key] = render;
17893
+ return compileCache[key] = render;
17888
17894
  }
17889
17895
  registerRuntimeCompiler(compileToFunction);
17890
17896