@vue/compat 3.5.3 → 3.5.4

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,13 +1,14 @@
1
1
  /**
2
- * @vue/compat v3.5.3
2
+ * @vue/compat v3.5.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
6
  /*! #__NO_SIDE_EFFECTS__ */
7
7
  // @__NO_SIDE_EFFECTS__
8
- function makeMap(str, expectsLowerCase) {
9
- const set = new Set(str.split(","));
10
- return (val) => set.has(val);
8
+ function makeMap(str) {
9
+ const map = /* @__PURE__ */ Object.create(null);
10
+ for (const key of str.split(",")) map[key] = 1;
11
+ return (val) => val in map;
11
12
  }
12
13
 
13
14
  const EMPTY_OBJ = Object.freeze({}) ;
@@ -611,7 +612,7 @@ function cleanupDeps(sub) {
611
612
  }
612
613
  function isDirty(sub) {
613
614
  for (let link = sub.deps; link; link = link.nextDep) {
614
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) === false || link.dep.version !== link.version) {
615
+ if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
615
616
  return true;
616
617
  }
617
618
  }
@@ -621,9 +622,6 @@ function isDirty(sub) {
621
622
  return false;
622
623
  }
623
624
  function refreshComputed(computed) {
624
- if (computed.flags & 2) {
625
- return false;
626
- }
627
625
  if (computed.flags & 4 && !(computed.flags & 16)) {
628
626
  return;
629
627
  }
@@ -890,9 +888,23 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
890
888
  globalVersion++;
891
889
  return;
892
890
  }
893
- let deps = [];
891
+ const run = (dep) => {
892
+ if (dep) {
893
+ {
894
+ dep.trigger({
895
+ target,
896
+ type,
897
+ key,
898
+ newValue,
899
+ oldValue,
900
+ oldTarget
901
+ });
902
+ }
903
+ }
904
+ };
905
+ startBatch();
894
906
  if (type === "clear") {
895
- deps = [...depsMap.values()];
907
+ depsMap.forEach(run);
896
908
  } else {
897
909
  const targetIsArray = isArray(target);
898
910
  const isArrayIndex = targetIsArray && isIntegerKey(key);
@@ -900,57 +912,43 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
900
912
  const newLength = Number(newValue);
901
913
  depsMap.forEach((dep, key2) => {
902
914
  if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
903
- deps.push(dep);
915
+ run(dep);
904
916
  }
905
917
  });
906
918
  } else {
907
- const push = (dep) => dep && deps.push(dep);
908
919
  if (key !== void 0) {
909
- push(depsMap.get(key));
920
+ run(depsMap.get(key));
910
921
  }
911
922
  if (isArrayIndex) {
912
- push(depsMap.get(ARRAY_ITERATE_KEY));
923
+ run(depsMap.get(ARRAY_ITERATE_KEY));
913
924
  }
914
925
  switch (type) {
915
926
  case "add":
916
927
  if (!targetIsArray) {
917
- push(depsMap.get(ITERATE_KEY));
928
+ run(depsMap.get(ITERATE_KEY));
918
929
  if (isMap(target)) {
919
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
930
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
920
931
  }
921
932
  } else if (isArrayIndex) {
922
- push(depsMap.get("length"));
933
+ run(depsMap.get("length"));
923
934
  }
924
935
  break;
925
936
  case "delete":
926
937
  if (!targetIsArray) {
927
- push(depsMap.get(ITERATE_KEY));
938
+ run(depsMap.get(ITERATE_KEY));
928
939
  if (isMap(target)) {
929
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
940
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
930
941
  }
931
942
  }
932
943
  break;
933
944
  case "set":
934
945
  if (isMap(target)) {
935
- push(depsMap.get(ITERATE_KEY));
946
+ run(depsMap.get(ITERATE_KEY));
936
947
  }
937
948
  break;
938
949
  }
939
950
  }
940
951
  }
941
- startBatch();
942
- for (const dep of deps) {
943
- {
944
- dep.trigger({
945
- target,
946
- type,
947
- key,
948
- newValue,
949
- oldValue,
950
- oldTarget
951
- });
952
- }
953
- }
954
952
  endBatch();
955
953
  }
956
954
  function getDepFromReactive(object, key) {
@@ -1688,7 +1686,7 @@ function toRaw(observed) {
1688
1686
  return raw ? toRaw(raw) : observed;
1689
1687
  }
1690
1688
  function markRaw(value) {
1691
- if (Object.isExtensible(value)) {
1689
+ if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
1692
1690
  def(value, "__v_skip", true);
1693
1691
  }
1694
1692
  return value;
@@ -1898,8 +1896,8 @@ class ComputedRefImpl {
1898
1896
  * @internal
1899
1897
  */
1900
1898
  notify() {
1899
+ this.flags |= 16;
1901
1900
  if (activeSub !== this) {
1902
- this.flags |= 16;
1903
1901
  this.dep.notify();
1904
1902
  }
1905
1903
  }
@@ -2587,23 +2585,19 @@ function flushJobs(seen) {
2587
2585
  }
2588
2586
  }
2589
2587
  function checkRecursiveUpdates(seen, fn) {
2590
- if (!seen.has(fn)) {
2591
- seen.set(fn, 1);
2592
- } else {
2593
- const count = seen.get(fn);
2594
- if (count > RECURSION_LIMIT) {
2595
- const instance = fn.i;
2596
- const componentName = instance && getComponentName(instance.type);
2597
- handleError(
2598
- `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
2599
- null,
2600
- 10
2601
- );
2602
- return true;
2603
- } else {
2604
- seen.set(fn, count + 1);
2605
- }
2588
+ const count = seen.get(fn) || 0;
2589
+ if (count > RECURSION_LIMIT) {
2590
+ const instance = fn.i;
2591
+ const componentName = instance && getComponentName(instance.type);
2592
+ handleError(
2593
+ `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
2594
+ null,
2595
+ 10
2596
+ );
2597
+ return true;
2606
2598
  }
2599
+ seen.set(fn, count + 1);
2600
+ return false;
2607
2601
  }
2608
2602
 
2609
2603
  let isHmrUpdating = false;
@@ -5779,13 +5773,15 @@ function renderList(source, renderItem, cache, index) {
5779
5773
  const sourceIsArray = isArray(source);
5780
5774
  if (sourceIsArray || isString(source)) {
5781
5775
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5776
+ let needsWrap = false;
5782
5777
  if (sourceIsReactiveArray) {
5778
+ needsWrap = !isShallow(source);
5783
5779
  source = shallowReadArray(source);
5784
5780
  }
5785
5781
  ret = new Array(source.length);
5786
5782
  for (let i = 0, l = source.length; i < l; i++) {
5787
5783
  ret[i] = renderItem(
5788
- sourceIsReactiveArray ? toReactive(source[i]) : source[i],
5784
+ needsWrap ? toReactive(source[i]) : source[i],
5789
5785
  i,
5790
5786
  void 0,
5791
5787
  cached && cached[i]
@@ -7036,7 +7032,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7036
7032
  return vm;
7037
7033
  }
7038
7034
  }
7039
- Vue.version = `2.6.14-compat:${"3.5.3"}`;
7035
+ Vue.version = `2.6.14-compat:${"3.5.4"}`;
7040
7036
  Vue.config = singletonApp.config;
7041
7037
  Vue.use = (plugin, ...options) => {
7042
7038
  if (plugin && isFunction(plugin.install)) {
@@ -12149,7 +12145,7 @@ function isMemoSame(cached, memo) {
12149
12145
  return true;
12150
12146
  }
12151
12147
 
12152
- const version = "3.5.3";
12148
+ const version = "3.5.4";
12153
12149
  const warn = warn$1 ;
12154
12150
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12155
12151
  const devtools = devtools$1 ;