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.
@@ -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
  **/
@@ -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;
@@ -3631,6 +3646,7 @@ function useId() {
3631
3646
  `useId() is called when there is no active component instance to be associated with.`
3632
3647
  );
3633
3648
  }
3649
+ return "";
3634
3650
  }
3635
3651
  function markAsyncBoundary(instance) {
3636
3652
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
@@ -9691,7 +9707,7 @@ function normalizeVNode(child) {
9691
9707
  // #3666, avoid reference pollution when reusing vnode
9692
9708
  child.slice()
9693
9709
  );
9694
- } else if (typeof child === "object") {
9710
+ } else if (isVNode(child)) {
9695
9711
  return cloneIfMounted(child);
9696
9712
  } else {
9697
9713
  return createVNode(Text, null, String(child));
@@ -10436,7 +10452,7 @@ function isMemoSame(cached, memo) {
10436
10452
  return true;
10437
10453
  }
10438
10454
 
10439
- const version = "3.5.8";
10455
+ const version = "3.5.10";
10440
10456
  const warn = warn$1 ;
10441
10457
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10442
10458
  const devtools = devtools$1 ;
@@ -11223,6 +11239,11 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
11223
11239
  if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
11224
11240
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
11225
11241
  }
11242
+ } else if (
11243
+ // #11081 force set props for possible async custom element
11244
+ el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
11245
+ ) {
11246
+ patchDOMProp(el, camelize(key), nextValue);
11226
11247
  } else {
11227
11248
  if (key === "true-value") {
11228
11249
  el._trueValue = nextValue;
@@ -11263,13 +11284,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
11263
11284
  if (isNativeOn(key) && isString(value)) {
11264
11285
  return false;
11265
11286
  }
11266
- if (key in el) {
11267
- return true;
11268
- }
11269
- if (el._isVueCE && (/[A-Z]/.test(key) || !isString(value))) {
11270
- return true;
11271
- }
11272
- return false;
11287
+ return key in el;
11273
11288
  }
11274
11289
 
11275
11290
  const REMOVAL = {};
@@ -11946,7 +11961,7 @@ const vModelCheckbox = {
11946
11961
  setChecked(el, binding, vnode);
11947
11962
  }
11948
11963
  };
11949
- function setChecked(el, { value, oldValue }, vnode) {
11964
+ function setChecked(el, { value }, vnode) {
11950
11965
  el._modelValue = value;
11951
11966
  let checked;
11952
11967
  if (isArray(value)) {
@@ -11996,19 +12011,19 @@ const vModelSelect = {
11996
12011
  },
11997
12012
  // set value in mounted & updated because <select> relies on its children
11998
12013
  // <option>s.
11999
- mounted(el, { value, modifiers: { number } }) {
12014
+ mounted(el, { value }) {
12000
12015
  setSelected(el, value);
12001
12016
  },
12002
12017
  beforeUpdate(el, _binding, vnode) {
12003
12018
  el[assignKey] = getModelAssigner(vnode);
12004
12019
  },
12005
- updated(el, { value, modifiers: { number } }) {
12020
+ updated(el, { value }) {
12006
12021
  if (!el._assigning) {
12007
12022
  setSelected(el, value);
12008
12023
  }
12009
12024
  }
12010
12025
  };
12011
- function setSelected(el, value, number) {
12026
+ function setSelected(el, value) {
12012
12027
  const isMultiple = el.multiple;
12013
12028
  const isArrayValue = isArray(value);
12014
12029
  if (isMultiple && !isArrayValue && !isSet(value)) {