@vue/runtime-dom 3.5.2 → 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.2
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
  }
@@ -890,9 +891,23 @@ var VueRuntimeDOM = (function (exports) {
890
891
  globalVersion++;
891
892
  return;
892
893
  }
893
- 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();
894
909
  if (type === "clear") {
895
- deps = [...depsMap.values()];
910
+ depsMap.forEach(run);
896
911
  } else {
897
912
  const targetIsArray = isArray(target);
898
913
  const isArrayIndex = targetIsArray && isIntegerKey(key);
@@ -900,57 +915,43 @@ var VueRuntimeDOM = (function (exports) {
900
915
  const newLength = Number(newValue);
901
916
  depsMap.forEach((dep, key2) => {
902
917
  if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
903
- deps.push(dep);
918
+ run(dep);
904
919
  }
905
920
  });
906
921
  } else {
907
- const push = (dep) => dep && deps.push(dep);
908
922
  if (key !== void 0) {
909
- push(depsMap.get(key));
923
+ run(depsMap.get(key));
910
924
  }
911
925
  if (isArrayIndex) {
912
- push(depsMap.get(ARRAY_ITERATE_KEY));
926
+ run(depsMap.get(ARRAY_ITERATE_KEY));
913
927
  }
914
928
  switch (type) {
915
929
  case "add":
916
930
  if (!targetIsArray) {
917
- push(depsMap.get(ITERATE_KEY));
931
+ run(depsMap.get(ITERATE_KEY));
918
932
  if (isMap(target)) {
919
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
933
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
920
934
  }
921
935
  } else if (isArrayIndex) {
922
- push(depsMap.get("length"));
936
+ run(depsMap.get("length"));
923
937
  }
924
938
  break;
925
939
  case "delete":
926
940
  if (!targetIsArray) {
927
- push(depsMap.get(ITERATE_KEY));
941
+ run(depsMap.get(ITERATE_KEY));
928
942
  if (isMap(target)) {
929
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
943
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
930
944
  }
931
945
  }
932
946
  break;
933
947
  case "set":
934
948
  if (isMap(target)) {
935
- push(depsMap.get(ITERATE_KEY));
949
+ run(depsMap.get(ITERATE_KEY));
936
950
  }
937
951
  break;
938
952
  }
939
953
  }
940
954
  }
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
955
  endBatch();
955
956
  }
956
957
  function getDepFromReactive(object, key) {
@@ -1688,7 +1689,7 @@ var VueRuntimeDOM = (function (exports) {
1688
1689
  return raw ? toRaw(raw) : observed;
1689
1690
  }
1690
1691
  function markRaw(value) {
1691
- if (Object.isExtensible(value)) {
1692
+ if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
1692
1693
  def(value, "__v_skip", true);
1693
1694
  }
1694
1695
  return value;
@@ -2587,23 +2588,19 @@ var VueRuntimeDOM = (function (exports) {
2587
2588
  }
2588
2589
  }
2589
2590
  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
- }
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;
2606
2601
  }
2602
+ seen.set(fn, count + 1);
2603
+ return false;
2607
2604
  }
2608
2605
 
2609
2606
  let isHmrUpdating = false;
@@ -3555,6 +3552,7 @@ var VueRuntimeDOM = (function (exports) {
3555
3552
  }
3556
3553
  function setTransitionHooks(vnode, hooks) {
3557
3554
  if (vnode.shapeFlag & 6 && vnode.component) {
3555
+ vnode.transition = hooks;
3558
3556
  setTransitionHooks(vnode.component.subTree, hooks);
3559
3557
  } else if (vnode.shapeFlag & 128) {
3560
3558
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
@@ -3599,7 +3597,7 @@ var VueRuntimeDOM = (function (exports) {
3599
3597
  function useId() {
3600
3598
  const i = getCurrentInstance();
3601
3599
  if (i) {
3602
- return (i.appContext.config.idPrefix || "v") + ":" + i.ids[0] + i.ids[1]++;
3600
+ return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
3603
3601
  } else {
3604
3602
  warn$1(
3605
3603
  `useId() is called when there is no active component instance to be associated with.`
@@ -4950,13 +4948,15 @@ If this is a native custom element, make sure to exclude it from component resol
4950
4948
  const sourceIsArray = isArray(source);
4951
4949
  if (sourceIsArray || isString(source)) {
4952
4950
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
4951
+ let needsWrap = false;
4953
4952
  if (sourceIsReactiveArray) {
4953
+ needsWrap = !isShallow(source);
4954
4954
  source = shallowReadArray(source);
4955
4955
  }
4956
4956
  ret = new Array(source.length);
4957
4957
  for (let i = 0, l = source.length; i < l; i++) {
4958
4958
  ret[i] = renderItem(
4959
- sourceIsReactiveArray ? toReactive(source[i]) : source[i],
4959
+ needsWrap ? toReactive(source[i]) : source[i],
4960
4960
  i,
4961
4961
  void 0,
4962
4962
  cached && cached[i]
@@ -7306,7 +7306,7 @@ If you want to remount the same app, move your app creation logic into a factory
7306
7306
  endMeasure(instance, `hydrate`);
7307
7307
  }
7308
7308
  };
7309
- if (isAsyncWrapperVNode) {
7309
+ if (isAsyncWrapperVNode && type.__asyncHydrate) {
7310
7310
  type.__asyncHydrate(
7311
7311
  el,
7312
7312
  instance,
@@ -8455,8 +8455,7 @@ If you want to remount the same app, move your app creation logic into a factory
8455
8455
  data,
8456
8456
  setupState,
8457
8457
  ctx,
8458
- inheritAttrs,
8459
- isMounted
8458
+ inheritAttrs
8460
8459
  } = instance;
8461
8460
  const prev = setCurrentRenderingInstance(instance);
8462
8461
  let result;
@@ -8576,7 +8575,7 @@ If you want to remount the same app, move your app creation logic into a factory
8576
8575
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8577
8576
  );
8578
8577
  }
8579
- root.transition = isMounted ? vnode.component.subTree.transition : vnode.transition;
8578
+ setTransitionHooks(root, vnode.transition);
8580
8579
  }
8581
8580
  if (setRoot) {
8582
8581
  setRoot(root);
@@ -10342,7 +10341,7 @@ Component that was made reactive: `,
10342
10341
  return true;
10343
10342
  }
10344
10343
 
10345
- const version = "3.5.2";
10344
+ const version = "3.5.4";
10346
10345
  const warn = warn$1 ;
10347
10346
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10348
10347
  const devtools = devtools$1 ;