@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
  **/
@@ -8,9 +8,10 @@ var VueRuntimeDOM = (function (exports) {
8
8
 
9
9
  /*! #__NO_SIDE_EFFECTS__ */
10
10
  // @__NO_SIDE_EFFECTS__
11
- function makeMap(str, expectsLowerCase) {
12
- const set = new Set(str.split(","));
13
- return (val) => set.has(val);
11
+ function makeMap(str) {
12
+ const map = /* @__PURE__ */ Object.create(null);
13
+ for (const key of str.split(",")) map[key] = 1;
14
+ return (val) => val in map;
14
15
  }
15
16
 
16
17
  const EMPTY_OBJ = Object.freeze({}) ;
@@ -614,7 +615,7 @@ var VueRuntimeDOM = (function (exports) {
614
615
  }
615
616
  function isDirty(sub) {
616
617
  for (let link = sub.deps; link; link = link.nextDep) {
617
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) === false || link.dep.version !== link.version) {
618
+ if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
618
619
  return true;
619
620
  }
620
621
  }
@@ -624,9 +625,6 @@ var VueRuntimeDOM = (function (exports) {
624
625
  return false;
625
626
  }
626
627
  function refreshComputed(computed) {
627
- if (computed.flags & 2) {
628
- return false;
629
- }
630
628
  if (computed.flags & 4 && !(computed.flags & 16)) {
631
629
  return;
632
630
  }
@@ -893,9 +891,23 @@ var VueRuntimeDOM = (function (exports) {
893
891
  globalVersion++;
894
892
  return;
895
893
  }
896
- let deps = [];
894
+ const run = (dep) => {
895
+ if (dep) {
896
+ {
897
+ dep.trigger({
898
+ target,
899
+ type,
900
+ key,
901
+ newValue,
902
+ oldValue,
903
+ oldTarget
904
+ });
905
+ }
906
+ }
907
+ };
908
+ startBatch();
897
909
  if (type === "clear") {
898
- deps = [...depsMap.values()];
910
+ depsMap.forEach(run);
899
911
  } else {
900
912
  const targetIsArray = isArray(target);
901
913
  const isArrayIndex = targetIsArray && isIntegerKey(key);
@@ -903,57 +915,43 @@ var VueRuntimeDOM = (function (exports) {
903
915
  const newLength = Number(newValue);
904
916
  depsMap.forEach((dep, key2) => {
905
917
  if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
906
- deps.push(dep);
918
+ run(dep);
907
919
  }
908
920
  });
909
921
  } else {
910
- const push = (dep) => dep && deps.push(dep);
911
922
  if (key !== void 0) {
912
- push(depsMap.get(key));
923
+ run(depsMap.get(key));
913
924
  }
914
925
  if (isArrayIndex) {
915
- push(depsMap.get(ARRAY_ITERATE_KEY));
926
+ run(depsMap.get(ARRAY_ITERATE_KEY));
916
927
  }
917
928
  switch (type) {
918
929
  case "add":
919
930
  if (!targetIsArray) {
920
- push(depsMap.get(ITERATE_KEY));
931
+ run(depsMap.get(ITERATE_KEY));
921
932
  if (isMap(target)) {
922
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
933
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
923
934
  }
924
935
  } else if (isArrayIndex) {
925
- push(depsMap.get("length"));
936
+ run(depsMap.get("length"));
926
937
  }
927
938
  break;
928
939
  case "delete":
929
940
  if (!targetIsArray) {
930
- push(depsMap.get(ITERATE_KEY));
941
+ run(depsMap.get(ITERATE_KEY));
931
942
  if (isMap(target)) {
932
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
943
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
933
944
  }
934
945
  }
935
946
  break;
936
947
  case "set":
937
948
  if (isMap(target)) {
938
- push(depsMap.get(ITERATE_KEY));
949
+ run(depsMap.get(ITERATE_KEY));
939
950
  }
940
951
  break;
941
952
  }
942
953
  }
943
954
  }
944
- startBatch();
945
- for (const dep of deps) {
946
- {
947
- dep.trigger({
948
- target,
949
- type,
950
- key,
951
- newValue,
952
- oldValue,
953
- oldTarget
954
- });
955
- }
956
- }
957
955
  endBatch();
958
956
  }
959
957
  function getDepFromReactive(object, key) {
@@ -1691,7 +1689,7 @@ var VueRuntimeDOM = (function (exports) {
1691
1689
  return raw ? toRaw(raw) : observed;
1692
1690
  }
1693
1691
  function markRaw(value) {
1694
- if (Object.isExtensible(value)) {
1692
+ if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
1695
1693
  def(value, "__v_skip", true);
1696
1694
  }
1697
1695
  return value;
@@ -1901,8 +1899,8 @@ var VueRuntimeDOM = (function (exports) {
1901
1899
  * @internal
1902
1900
  */
1903
1901
  notify() {
1902
+ this.flags |= 16;
1904
1903
  if (activeSub !== this) {
1905
- this.flags |= 16;
1906
1904
  this.dep.notify();
1907
1905
  }
1908
1906
  }
@@ -2590,23 +2588,19 @@ var VueRuntimeDOM = (function (exports) {
2590
2588
  }
2591
2589
  }
2592
2590
  function checkRecursiveUpdates(seen, fn) {
2593
- if (!seen.has(fn)) {
2594
- seen.set(fn, 1);
2595
- } else {
2596
- const count = seen.get(fn);
2597
- if (count > RECURSION_LIMIT) {
2598
- const instance = fn.i;
2599
- const componentName = instance && getComponentName(instance.type);
2600
- handleError(
2601
- `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.`,
2602
- null,
2603
- 10
2604
- );
2605
- return true;
2606
- } else {
2607
- seen.set(fn, count + 1);
2608
- }
2591
+ const count = seen.get(fn) || 0;
2592
+ if (count > RECURSION_LIMIT) {
2593
+ const instance = fn.i;
2594
+ const componentName = instance && getComponentName(instance.type);
2595
+ handleError(
2596
+ `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.`,
2597
+ null,
2598
+ 10
2599
+ );
2600
+ return true;
2609
2601
  }
2602
+ seen.set(fn, count + 1);
2603
+ return false;
2610
2604
  }
2611
2605
 
2612
2606
  let isHmrUpdating = false;
@@ -4954,13 +4948,15 @@ If this is a native custom element, make sure to exclude it from component resol
4954
4948
  const sourceIsArray = isArray(source);
4955
4949
  if (sourceIsArray || isString(source)) {
4956
4950
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
4951
+ let needsWrap = false;
4957
4952
  if (sourceIsReactiveArray) {
4953
+ needsWrap = !isShallow(source);
4958
4954
  source = shallowReadArray(source);
4959
4955
  }
4960
4956
  ret = new Array(source.length);
4961
4957
  for (let i = 0, l = source.length; i < l; i++) {
4962
4958
  ret[i] = renderItem(
4963
- sourceIsReactiveArray ? toReactive(source[i]) : source[i],
4959
+ needsWrap ? toReactive(source[i]) : source[i],
4964
4960
  i,
4965
4961
  void 0,
4966
4962
  cached && cached[i]
@@ -10345,7 +10341,7 @@ Component that was made reactive: `,
10345
10341
  return true;
10346
10342
  }
10347
10343
 
10348
- const version = "3.5.3";
10344
+ const version = "3.5.4";
10349
10345
  const warn = warn$1 ;
10350
10346
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10351
10347
  const devtools = devtools$1 ;