@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
  }
@@ -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();
@@ -1899,8 +1906,10 @@ class ComputedRefImpl {
1899
1906
  */
1900
1907
  notify() {
1901
1908
  this.flags |= 16;
1902
- if (activeSub !== this) {
1903
- this.dep.notify();
1909
+ if (!(this.flags & 8) && // avoid infinite self recursion
1910
+ activeSub !== this) {
1911
+ batch(this);
1912
+ return true;
1904
1913
  }
1905
1914
  }
1906
1915
  get value() {
@@ -2048,20 +2057,12 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2048
2057
  remove(scope.effects, effect);
2049
2058
  }
2050
2059
  };
2051
- if (once) {
2052
- if (cb) {
2053
- const _cb = cb;
2054
- cb = (...args) => {
2055
- _cb(...args);
2056
- watchHandle();
2057
- };
2058
- } else {
2059
- const _getter = getter;
2060
- getter = () => {
2061
- _getter();
2062
- watchHandle();
2063
- };
2064
- }
2060
+ if (once && cb) {
2061
+ const _cb = cb;
2062
+ cb = (...args) => {
2063
+ _cb(...args);
2064
+ watchHandle();
2065
+ };
2065
2066
  }
2066
2067
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2067
2068
  const job = (immediateFirstRun) => {
@@ -7043,7 +7044,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7043
7044
  return vm;
7044
7045
  }
7045
7046
  }
7046
- Vue.version = `2.6.14-compat:${"3.5.5"}`;
7047
+ Vue.version = `2.6.14-compat:${"3.5.6"}`;
7047
7048
  Vue.config = singletonApp.config;
7048
7049
  Vue.use = (plugin, ...options) => {
7049
7050
  if (plugin && isFunction(plugin.install)) {
@@ -9861,11 +9862,12 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
9861
9862
  } else if (!cb || immediate) {
9862
9863
  baseWatchOptions.once = true;
9863
9864
  } else {
9864
- return {
9865
- stop: NOOP,
9866
- resume: NOOP,
9867
- pause: NOOP
9865
+ const watchStopHandle = () => {
9868
9866
  };
9867
+ watchStopHandle.stop = NOOP;
9868
+ watchStopHandle.resume = NOOP;
9869
+ watchStopHandle.pause = NOOP;
9870
+ return watchStopHandle;
9869
9871
  }
9870
9872
  }
9871
9873
  const instance = currentInstance;
@@ -12157,7 +12159,7 @@ function isMemoSame(cached, memo) {
12157
12159
  return true;
12158
12160
  }
12159
12161
 
12160
- const version = "3.5.5";
12162
+ const version = "3.5.6";
12161
12163
  const warn = warn$1 ;
12162
12164
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12163
12165
  const devtools = devtools$1 ;