vue 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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.8
2
+ * vue v3.5.10
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -24,15 +24,7 @@ function _interopNamespaceDefault(e) {
24
24
 
25
25
  var runtimeDom__namespace = /*#__PURE__*/_interopNamespaceDefault(runtimeDom);
26
26
 
27
- const compileCache = /* @__PURE__ */ new WeakMap();
28
- function getCache(options) {
29
- let c = compileCache.get(options != null ? options : shared.EMPTY_OBJ);
30
- if (!c) {
31
- c = /* @__PURE__ */ Object.create(null);
32
- compileCache.set(options != null ? options : shared.EMPTY_OBJ, c);
33
- }
34
- return c;
35
- }
27
+ const compileCache = /* @__PURE__ */ Object.create(null);
36
28
  function compileToFunction(template, options) {
37
29
  if (!shared.isString(template)) {
38
30
  if (template.nodeType) {
@@ -42,9 +34,8 @@ function compileToFunction(template, options) {
42
34
  return shared.NOOP;
43
35
  }
44
36
  }
45
- const key = template;
46
- const cache = getCache(options);
47
- const cached = cache[key];
37
+ const key = shared.genCacheKey(template, options);
38
+ const cached = compileCache[key];
48
39
  if (cached) {
49
40
  return cached;
50
41
  }
@@ -79,7 +70,7 @@ ${codeFrame}` : message);
79
70
  }
80
71
  const render = new Function("Vue", code)(runtimeDom__namespace);
81
72
  render._rc = true;
82
- return cache[key] = render;
73
+ return compileCache[key] = render;
83
74
  }
84
75
  runtimeDom.registerRuntimeCompiler(compileToFunction);
85
76
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.8
2
+ * vue v3.5.10
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -24,15 +24,7 @@ function _interopNamespaceDefault(e) {
24
24
 
25
25
  var runtimeDom__namespace = /*#__PURE__*/_interopNamespaceDefault(runtimeDom);
26
26
 
27
- const compileCache = /* @__PURE__ */ new WeakMap();
28
- function getCache(options) {
29
- let c = compileCache.get(options != null ? options : shared.EMPTY_OBJ);
30
- if (!c) {
31
- c = /* @__PURE__ */ Object.create(null);
32
- compileCache.set(options != null ? options : shared.EMPTY_OBJ, c);
33
- }
34
- return c;
35
- }
27
+ const compileCache = /* @__PURE__ */ Object.create(null);
36
28
  function compileToFunction(template, options) {
37
29
  if (!shared.isString(template)) {
38
30
  if (template.nodeType) {
@@ -41,9 +33,8 @@ function compileToFunction(template, options) {
41
33
  return shared.NOOP;
42
34
  }
43
35
  }
44
- const key = template;
45
- const cache = getCache(options);
46
- const cached = cache[key];
36
+ const key = shared.genCacheKey(template, options);
37
+ const cached = compileCache[key];
47
38
  if (cached) {
48
39
  return cached;
49
40
  }
@@ -65,7 +56,7 @@ function compileToFunction(template, options) {
65
56
  const { code } = compilerDom.compile(template, opts);
66
57
  const render = new Function("Vue", code)(runtimeDom__namespace);
67
58
  render._rc = true;
68
- return cache[key] = render;
59
+ return compileCache[key] = render;
69
60
  }
70
61
  runtimeDom.registerRuntimeCompiler(compileToFunction);
71
62
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.8
2
+ * vue 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 (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
  {
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 (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 (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(
@@ -1045,8 +1062,8 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
1045
1062
  endBatch();
1046
1063
  }
1047
1064
  function getDepFromReactive(object, key) {
1048
- var _a;
1049
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
1065
+ const depMap = targetMap.get(object);
1066
+ return depMap && depMap.get(key);
1050
1067
  }
1051
1068
 
1052
1069
  function reactiveReadArray(array) {
@@ -1982,6 +1999,10 @@ class ComputedRefImpl {
1982
1999
  * @internal
1983
2000
  */
1984
2001
  this.globalVersion = globalVersion - 1;
2002
+ /**
2003
+ * @internal
2004
+ */
2005
+ this.next = void 0;
1985
2006
  // for backwards compat
1986
2007
  this.effect = this;
1987
2008
  this["__v_isReadonly"] = !setter;
@@ -3698,6 +3719,7 @@ function useId() {
3698
3719
  `useId() is called when there is no active component instance to be associated with.`
3699
3720
  );
3700
3721
  }
3722
+ return "";
3701
3723
  }
3702
3724
  function markAsyncBoundary(instance) {
3703
3725
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
@@ -9758,7 +9780,7 @@ function normalizeVNode(child) {
9758
9780
  // #3666, avoid reference pollution when reusing vnode
9759
9781
  child.slice()
9760
9782
  );
9761
- } else if (typeof child === "object") {
9783
+ } else if (isVNode(child)) {
9762
9784
  return cloneIfMounted(child);
9763
9785
  } else {
9764
9786
  return createVNode(Text, null, String(child));
@@ -10503,7 +10525,7 @@ function isMemoSame(cached, memo) {
10503
10525
  return true;
10504
10526
  }
10505
10527
 
10506
- const version = "3.5.8";
10528
+ const version = "3.5.10";
10507
10529
  const warn = warn$1 ;
10508
10530
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10509
10531
  const devtools = devtools$1 ;
@@ -11290,6 +11312,11 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
11290
11312
  if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
11291
11313
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
11292
11314
  }
11315
+ } else if (
11316
+ // #11081 force set props for possible async custom element
11317
+ el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
11318
+ ) {
11319
+ patchDOMProp(el, camelize(key), nextValue);
11293
11320
  } else {
11294
11321
  if (key === "true-value") {
11295
11322
  el._trueValue = nextValue;
@@ -11330,13 +11357,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
11330
11357
  if (isNativeOn(key) && isString(value)) {
11331
11358
  return false;
11332
11359
  }
11333
- if (key in el) {
11334
- return true;
11335
- }
11336
- if (el._isVueCE && (/[A-Z]/.test(key) || !isString(value))) {
11337
- return true;
11338
- }
11339
- return false;
11360
+ return key in el;
11340
11361
  }
11341
11362
 
11342
11363
  const REMOVAL = {};
@@ -12013,7 +12034,7 @@ const vModelCheckbox = {
12013
12034
  setChecked(el, binding, vnode);
12014
12035
  }
12015
12036
  };
12016
- function setChecked(el, { value, oldValue }, vnode) {
12037
+ function setChecked(el, { value }, vnode) {
12017
12038
  el._modelValue = value;
12018
12039
  let checked;
12019
12040
  if (isArray(value)) {
@@ -12063,19 +12084,19 @@ const vModelSelect = {
12063
12084
  },
12064
12085
  // set value in mounted & updated because <select> relies on its children
12065
12086
  // <option>s.
12066
- mounted(el, { value, modifiers: { number } }) {
12087
+ mounted(el, { value }) {
12067
12088
  setSelected(el, value);
12068
12089
  },
12069
12090
  beforeUpdate(el, _binding, vnode) {
12070
12091
  el[assignKey] = getModelAssigner(vnode);
12071
12092
  },
12072
- updated(el, { value, modifiers: { number } }) {
12093
+ updated(el, { value }) {
12073
12094
  if (!el._assigning) {
12074
12095
  setSelected(el, value);
12075
12096
  }
12076
12097
  }
12077
12098
  };
12078
- function setSelected(el, value, number) {
12099
+ function setSelected(el, value) {
12079
12100
  const isMultiple = el.multiple;
12080
12101
  const isArrayValue = isArray(value);
12081
12102
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -18116,15 +18137,7 @@ function compile(src, options = {}) {
18116
18137
  {
18117
18138
  initDev();
18118
18139
  }
18119
- const compileCache = /* @__PURE__ */ new WeakMap();
18120
- function getCache(options) {
18121
- let c = compileCache.get(options != null ? options : EMPTY_OBJ);
18122
- if (!c) {
18123
- c = /* @__PURE__ */ Object.create(null);
18124
- compileCache.set(options != null ? options : EMPTY_OBJ, c);
18125
- }
18126
- return c;
18127
- }
18140
+ const compileCache = /* @__PURE__ */ Object.create(null);
18128
18141
  function compileToFunction(template, options) {
18129
18142
  if (!isString(template)) {
18130
18143
  if (template.nodeType) {
@@ -18134,9 +18147,8 @@ function compileToFunction(template, options) {
18134
18147
  return NOOP;
18135
18148
  }
18136
18149
  }
18137
- const key = template;
18138
- const cache = getCache(options);
18139
- const cached = cache[key];
18150
+ const key = genCacheKey(template, options);
18151
+ const cached = compileCache[key];
18140
18152
  if (cached) {
18141
18153
  return cached;
18142
18154
  }
@@ -18171,7 +18183,7 @@ ${codeFrame}` : message);
18171
18183
  }
18172
18184
  const render = new Function("Vue", code)(runtimeDom);
18173
18185
  render._rc = true;
18174
- return cache[key] = render;
18186
+ return compileCache[key] = render;
18175
18187
  }
18176
18188
  registerRuntimeCompiler(compileToFunction);
18177
18189