@vue/compat 3.5.5 → 3.5.6

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.5
2
+ * @vue/compat v3.5.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -465,7 +465,7 @@ class ReactiveEffect {
465
465
  /**
466
466
  * @internal
467
467
  */
468
- this.nextEffect = void 0;
468
+ this.next = void 0;
469
469
  /**
470
470
  * @internal
471
471
  */
@@ -495,9 +495,7 @@ class ReactiveEffect {
495
495
  return;
496
496
  }
497
497
  if (!(this.flags & 8)) {
498
- this.flags |= 8;
499
- this.nextEffect = batchedEffect;
500
- batchedEffect = this;
498
+ batch(this);
501
499
  }
502
500
  }
503
501
  run() {
@@ -558,7 +556,12 @@ class ReactiveEffect {
558
556
  }
559
557
  }
560
558
  let batchDepth = 0;
561
- let batchedEffect;
559
+ let batchedSub;
560
+ function batch(sub) {
561
+ sub.flags |= 8;
562
+ sub.next = batchedSub;
563
+ batchedSub = sub;
564
+ }
562
565
  function startBatch() {
563
566
  batchDepth++;
564
567
  }
@@ -567,15 +570,16 @@ function endBatch() {
567
570
  return;
568
571
  }
569
572
  let error;
570
- while (batchedEffect) {
571
- let e = batchedEffect;
572
- batchedEffect = void 0;
573
+ while (batchedSub) {
574
+ let e = batchedSub;
575
+ batchedSub = void 0;
573
576
  while (e) {
574
- const next = e.nextEffect;
575
- e.nextEffect = void 0;
577
+ const next = e.next;
578
+ e.next = void 0;
576
579
  e.flags &= ~8;
577
580
  if (e.flags & 1) {
578
581
  try {
582
+ ;
579
583
  e.trigger();
580
584
  } catch (err) {
581
585
  if (!error) error = err;
@@ -615,7 +619,7 @@ function cleanupDeps(sub) {
615
619
  }
616
620
  function isDirty(sub) {
617
621
  for (let link = sub.deps; link; link = link.nextDep) {
618
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
622
+ if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
619
623
  return true;
620
624
  }
621
625
  }
@@ -635,7 +639,7 @@ function refreshComputed(computed) {
635
639
  computed.globalVersion = globalVersion;
636
640
  const dep = computed.dep;
637
641
  computed.flags |= 2;
638
- if (dep.version > 0 && !computed.isSSR && !isDirty(computed)) {
642
+ if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
639
643
  computed.flags &= ~2;
640
644
  return;
641
645
  }
@@ -817,7 +821,7 @@ class Dep {
817
821
  try {
818
822
  if (!!(process.env.NODE_ENV !== "production")) {
819
823
  for (let head = this.subsHead; head; head = head.nextSub) {
820
- if (!!(process.env.NODE_ENV !== "production") && head.sub.onTrigger && !(head.sub.flags & 8)) {
824
+ if (head.sub.onTrigger && !(head.sub.flags & 8)) {
821
825
  head.sub.onTrigger(
822
826
  extend(
823
827
  {
@@ -830,7 +834,10 @@ class Dep {
830
834
  }
831
835
  }
832
836
  for (let link = this.subs; link; link = link.prevSub) {
833
- link.sub.notify();
837
+ if (link.sub.notify()) {
838
+ ;
839
+ link.sub.dep.notify();
840
+ }
834
841
  }
835
842
  } finally {
836
843
  endBatch();
@@ -1909,8 +1916,10 @@ class ComputedRefImpl {
1909
1916
  */
1910
1917
  notify() {
1911
1918
  this.flags |= 16;
1912
- if (activeSub !== this) {
1913
- this.dep.notify();
1919
+ if (!(this.flags & 8) && // avoid infinite self recursion
1920
+ activeSub !== this) {
1921
+ batch(this);
1922
+ return true;
1914
1923
  } else if (!!(process.env.NODE_ENV !== "production")) ;
1915
1924
  }
1916
1925
  get value() {
@@ -2058,20 +2067,12 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2058
2067
  remove(scope.effects, effect);
2059
2068
  }
2060
2069
  };
2061
- if (once) {
2062
- if (cb) {
2063
- const _cb = cb;
2064
- cb = (...args) => {
2065
- _cb(...args);
2066
- watchHandle();
2067
- };
2068
- } else {
2069
- const _getter = getter;
2070
- getter = () => {
2071
- _getter();
2072
- watchHandle();
2073
- };
2074
- }
2070
+ if (once && cb) {
2071
+ const _cb = cb;
2072
+ cb = (...args) => {
2073
+ _cb(...args);
2074
+ watchHandle();
2075
+ };
2075
2076
  }
2076
2077
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2077
2078
  const job = (immediateFirstRun) => {
@@ -7075,7 +7076,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7075
7076
  return vm;
7076
7077
  }
7077
7078
  }
7078
- Vue.version = `2.6.14-compat:${"3.5.5"}`;
7079
+ Vue.version = `2.6.14-compat:${"3.5.6"}`;
7079
7080
  Vue.config = singletonApp.config;
7080
7081
  Vue.use = (plugin, ...options) => {
7081
7082
  if (plugin && isFunction(plugin.install)) {
@@ -9933,11 +9934,12 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
9933
9934
  } else if (!cb || immediate) {
9934
9935
  baseWatchOptions.once = true;
9935
9936
  } else {
9936
- return {
9937
- stop: NOOP,
9938
- resume: NOOP,
9939
- pause: NOOP
9937
+ const watchStopHandle = () => {
9940
9938
  };
9939
+ watchStopHandle.stop = NOOP;
9940
+ watchStopHandle.resume = NOOP;
9941
+ watchStopHandle.pause = NOOP;
9942
+ return watchStopHandle;
9941
9943
  }
9942
9944
  }
9943
9945
  const instance = currentInstance;
@@ -12243,7 +12245,7 @@ function isMemoSame(cached, memo) {
12243
12245
  return true;
12244
12246
  }
12245
12247
 
12246
- const version = "3.5.5";
12248
+ const version = "3.5.6";
12247
12249
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12248
12250
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12249
12251
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.5
2
+ * @vue/compat v3.5.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -468,7 +468,7 @@ var Vue = (function () {
468
468
  /**
469
469
  * @internal
470
470
  */
471
- this.nextEffect = void 0;
471
+ this.next = void 0;
472
472
  /**
473
473
  * @internal
474
474
  */
@@ -498,9 +498,7 @@ var Vue = (function () {
498
498
  return;
499
499
  }
500
500
  if (!(this.flags & 8)) {
501
- this.flags |= 8;
502
- this.nextEffect = batchedEffect;
503
- batchedEffect = this;
501
+ batch(this);
504
502
  }
505
503
  }
506
504
  run() {
@@ -561,7 +559,12 @@ var Vue = (function () {
561
559
  }
562
560
  }
563
561
  let batchDepth = 0;
564
- let batchedEffect;
562
+ let batchedSub;
563
+ function batch(sub) {
564
+ sub.flags |= 8;
565
+ sub.next = batchedSub;
566
+ batchedSub = sub;
567
+ }
565
568
  function startBatch() {
566
569
  batchDepth++;
567
570
  }
@@ -570,15 +573,16 @@ var Vue = (function () {
570
573
  return;
571
574
  }
572
575
  let error;
573
- while (batchedEffect) {
574
- let e = batchedEffect;
575
- batchedEffect = void 0;
576
+ while (batchedSub) {
577
+ let e = batchedSub;
578
+ batchedSub = void 0;
576
579
  while (e) {
577
- const next = e.nextEffect;
578
- e.nextEffect = void 0;
580
+ const next = e.next;
581
+ e.next = void 0;
579
582
  e.flags &= ~8;
580
583
  if (e.flags & 1) {
581
584
  try {
585
+ ;
582
586
  e.trigger();
583
587
  } catch (err) {
584
588
  if (!error) error = err;
@@ -618,7 +622,7 @@ var Vue = (function () {
618
622
  }
619
623
  function isDirty(sub) {
620
624
  for (let link = sub.deps; link; link = link.nextDep) {
621
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
625
+ if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
622
626
  return true;
623
627
  }
624
628
  }
@@ -638,7 +642,7 @@ var Vue = (function () {
638
642
  computed.globalVersion = globalVersion;
639
643
  const dep = computed.dep;
640
644
  computed.flags |= 2;
641
- if (dep.version > 0 && !computed.isSSR && !isDirty(computed)) {
645
+ if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
642
646
  computed.flags &= ~2;
643
647
  return;
644
648
  }
@@ -833,7 +837,10 @@ var Vue = (function () {
833
837
  }
834
838
  }
835
839
  for (let link = this.subs; link; link = link.prevSub) {
836
- link.sub.notify();
840
+ if (link.sub.notify()) {
841
+ ;
842
+ link.sub.dep.notify();
843
+ }
837
844
  }
838
845
  } finally {
839
846
  endBatch();
@@ -1902,8 +1909,10 @@ var Vue = (function () {
1902
1909
  */
1903
1910
  notify() {
1904
1911
  this.flags |= 16;
1905
- if (activeSub !== this) {
1906
- this.dep.notify();
1912
+ if (!(this.flags & 8) && // avoid infinite self recursion
1913
+ activeSub !== this) {
1914
+ batch(this);
1915
+ return true;
1907
1916
  }
1908
1917
  }
1909
1918
  get value() {
@@ -2051,20 +2060,12 @@ var Vue = (function () {
2051
2060
  remove(scope.effects, effect);
2052
2061
  }
2053
2062
  };
2054
- if (once) {
2055
- if (cb) {
2056
- const _cb = cb;
2057
- cb = (...args) => {
2058
- _cb(...args);
2059
- watchHandle();
2060
- };
2061
- } else {
2062
- const _getter = getter;
2063
- getter = () => {
2064
- _getter();
2065
- watchHandle();
2066
- };
2067
- }
2063
+ if (once && cb) {
2064
+ const _cb = cb;
2065
+ cb = (...args) => {
2066
+ _cb(...args);
2067
+ watchHandle();
2068
+ };
2068
2069
  }
2069
2070
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2070
2071
  const job = (immediateFirstRun) => {
@@ -7037,7 +7038,7 @@ If this is a native custom element, make sure to exclude it from component resol
7037
7038
  return vm;
7038
7039
  }
7039
7040
  }
7040
- Vue.version = `2.6.14-compat:${"3.5.5"}`;
7041
+ Vue.version = `2.6.14-compat:${"3.5.6"}`;
7041
7042
  Vue.config = singletonApp.config;
7042
7043
  Vue.use = (plugin, ...options) => {
7043
7044
  if (plugin && isFunction(plugin.install)) {
@@ -12115,7 +12116,7 @@ Component that was made reactive: `,
12115
12116
  return true;
12116
12117
  }
12117
12118
 
12118
- const version = "3.5.5";
12119
+ const version = "3.5.6";
12119
12120
  const warn = warn$1 ;
12120
12121
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12121
12122
  const devtools = devtools$1 ;