@vue/runtime-dom 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,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.3
2
+ * @vue/runtime-dom v3.5.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.3
2
+ * @vue/runtime-dom v3.5.4
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,13 +1,14 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.3
2
+ * @vue/runtime-dom 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;
@@ -4957,13 +4951,15 @@ function renderList(source, renderItem, cache, index) {
4957
4951
  const sourceIsArray = isArray(source);
4958
4952
  if (sourceIsArray || isString(source)) {
4959
4953
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
4954
+ let needsWrap = false;
4960
4955
  if (sourceIsReactiveArray) {
4956
+ needsWrap = !isShallow(source);
4961
4957
  source = shallowReadArray(source);
4962
4958
  }
4963
4959
  ret = new Array(source.length);
4964
4960
  for (let i = 0, l = source.length; i < l; i++) {
4965
4961
  ret[i] = renderItem(
4966
- sourceIsReactiveArray ? toReactive(source[i]) : source[i],
4962
+ needsWrap ? toReactive(source[i]) : source[i],
4967
4963
  i,
4968
4964
  void 0,
4969
4965
  cached && cached[i]
@@ -10387,7 +10383,7 @@ function isMemoSame(cached, memo) {
10387
10383
  return true;
10388
10384
  }
10389
10385
 
10390
- const version = "3.5.3";
10386
+ const version = "3.5.4";
10391
10387
  const warn = warn$1 ;
10392
10388
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10393
10389
  const devtools = devtools$1 ;