@vue/runtime-dom 3.5.8 → 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/runtime-dom v3.5.8
2
+ * @vue/runtime-dom v3.5.9
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -575,11 +575,14 @@ var VueRuntimeDOM = (function (exports) {
575
575
  let error;
576
576
  while (batchedSub) {
577
577
  let e = batchedSub;
578
- batchedSub = void 0;
578
+ let next;
579
579
  while (e) {
580
- const next = e.next;
581
- e.next = void 0;
582
580
  e.flags &= ~8;
581
+ e = e.next;
582
+ }
583
+ e = batchedSub;
584
+ batchedSub = void 0;
585
+ while (e) {
583
586
  if (e.flags & 1) {
584
587
  try {
585
588
  ;
@@ -588,6 +591,8 @@ var VueRuntimeDOM = (function (exports) {
588
591
  if (!error) error = err;
589
592
  }
590
593
  }
594
+ next = e.next;
595
+ e.next = void 0;
591
596
  e = next;
592
597
  }
593
598
  }
@@ -600,7 +605,7 @@ var VueRuntimeDOM = (function (exports) {
600
605
  link.dep.activeLink = link;
601
606
  }
602
607
  }
603
- function cleanupDeps(sub, fromComputed = false) {
608
+ function cleanupDeps(sub) {
604
609
  let head;
605
610
  let tail = sub.depsTail;
606
611
  let link = tail;
@@ -608,7 +613,7 @@ var VueRuntimeDOM = (function (exports) {
608
613
  const prev = link.prevDep;
609
614
  if (link.version === -1) {
610
615
  if (link === tail) tail = prev;
611
- removeSub(link, fromComputed);
616
+ removeSub(link);
612
617
  removeDep(link);
613
618
  } else {
614
619
  head = link;
@@ -663,11 +668,11 @@ var VueRuntimeDOM = (function (exports) {
663
668
  } finally {
664
669
  activeSub = prevSub;
665
670
  shouldTrack = prevShouldTrack;
666
- cleanupDeps(computed, true);
671
+ cleanupDeps(computed);
667
672
  computed.flags &= ~2;
668
673
  }
669
674
  }
670
- function removeSub(link, fromComputed = false) {
675
+ function removeSub(link, soft = false) {
671
676
  const { dep, prevSub, nextSub } = link;
672
677
  if (prevSub) {
673
678
  prevSub.nextSub = nextSub;
@@ -683,17 +688,15 @@ var VueRuntimeDOM = (function (exports) {
683
688
  if (dep.subsHead === link) {
684
689
  dep.subsHead = nextSub;
685
690
  }
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);
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);
695
695
  }
696
696
  }
697
+ if (!soft && !--dep.sc && dep.map) {
698
+ dep.map.delete(dep.key);
699
+ }
697
700
  }
698
701
  function removeDep(link) {
699
702
  const { prevDep, nextDep } = link;
@@ -778,6 +781,10 @@ var VueRuntimeDOM = (function (exports) {
778
781
  this.target = void 0;
779
782
  this.map = void 0;
780
783
  this.key = void 0;
784
+ /**
785
+ * Subscriber counter
786
+ */
787
+ this.sc = 0;
781
788
  {
782
789
  this.subsHead = void 0;
783
790
  }
@@ -796,9 +803,7 @@ var VueRuntimeDOM = (function (exports) {
796
803
  activeSub.depsTail.nextDep = link;
797
804
  activeSub.depsTail = link;
798
805
  }
799
- if (activeSub.flags & 4) {
800
- addSub(link);
801
- }
806
+ addSub(link);
802
807
  } else if (link.version === -1) {
803
808
  link.version = this.version;
804
809
  if (link.nextDep) {
@@ -862,22 +867,25 @@ var VueRuntimeDOM = (function (exports) {
862
867
  }
863
868
  }
864
869
  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);
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
+ }
870
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;
871
888
  }
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
889
  }
882
890
  const targetMap = /* @__PURE__ */ new WeakMap();
883
891
  const ITERATE_KEY = Symbol(
@@ -981,8 +989,8 @@ var VueRuntimeDOM = (function (exports) {
981
989
  endBatch();
982
990
  }
983
991
  function getDepFromReactive(object, key) {
984
- var _a;
985
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
992
+ const depMap = targetMap.get(object);
993
+ return depMap && depMap.get(key);
986
994
  }
987
995
 
988
996
  function reactiveReadArray(array) {
@@ -3634,6 +3642,7 @@ var VueRuntimeDOM = (function (exports) {
3634
3642
  `useId() is called when there is no active component instance to be associated with.`
3635
3643
  );
3636
3644
  }
3645
+ return "";
3637
3646
  }
3638
3647
  function markAsyncBoundary(instance) {
3639
3648
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
@@ -9662,7 +9671,7 @@ Component that was made reactive: `,
9662
9671
  // #3666, avoid reference pollution when reusing vnode
9663
9672
  child.slice()
9664
9673
  );
9665
- } else if (typeof child === "object") {
9674
+ } else if (isVNode(child)) {
9666
9675
  return cloneIfMounted(child);
9667
9676
  } else {
9668
9677
  return createVNode(Text, null, String(child));
@@ -10393,7 +10402,7 @@ Component that was made reactive: `,
10393
10402
  return true;
10394
10403
  }
10395
10404
 
10396
- const version = "3.5.8";
10405
+ const version = "3.5.9";
10397
10406
  const warn = warn$1 ;
10398
10407
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10399
10408
  const devtools = devtools$1 ;
@@ -11872,7 +11881,7 @@ Expected function or array of functions, received type ${typeof value}.`
11872
11881
  setChecked(el, binding, vnode);
11873
11882
  }
11874
11883
  };
11875
- function setChecked(el, { value, oldValue }, vnode) {
11884
+ function setChecked(el, { value }, vnode) {
11876
11885
  el._modelValue = value;
11877
11886
  let checked;
11878
11887
  if (isArray(value)) {
@@ -11922,19 +11931,19 @@ Expected function or array of functions, received type ${typeof value}.`
11922
11931
  },
11923
11932
  // set value in mounted & updated because <select> relies on its children
11924
11933
  // <option>s.
11925
- mounted(el, { value, modifiers: { number } }) {
11934
+ mounted(el, { value }) {
11926
11935
  setSelected(el, value);
11927
11936
  },
11928
11937
  beforeUpdate(el, _binding, vnode) {
11929
11938
  el[assignKey] = getModelAssigner(vnode);
11930
11939
  },
11931
- updated(el, { value, modifiers: { number } }) {
11940
+ updated(el, { value }) {
11932
11941
  if (!el._assigning) {
11933
11942
  setSelected(el, value);
11934
11943
  }
11935
11944
  }
11936
11945
  };
11937
- function setSelected(el, value, number) {
11946
+ function setSelected(el, value) {
11938
11947
  const isMultiple = el.multiple;
11939
11948
  const isArrayValue = isArray(value);
11940
11949
  if (isMultiple && !isArrayValue && !isSet(value)) {