vue 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 v3.5.2
2
+ * vue 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 v3.5.2
2
+ * vue 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 Vue = (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 expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (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({}) ;
@@ -681,7 +682,7 @@ var Vue = (function (exports) {
681
682
  }
682
683
  function isDirty(sub) {
683
684
  for (let link = sub.deps; link; link = link.nextDep) {
684
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) === false || link.dep.version !== link.version) {
685
+ if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
685
686
  return true;
686
687
  }
687
688
  }
@@ -957,9 +958,23 @@ var Vue = (function (exports) {
957
958
  globalVersion++;
958
959
  return;
959
960
  }
960
- let deps = [];
961
+ const run = (dep) => {
962
+ if (dep) {
963
+ {
964
+ dep.trigger({
965
+ target,
966
+ type,
967
+ key,
968
+ newValue,
969
+ oldValue,
970
+ oldTarget
971
+ });
972
+ }
973
+ }
974
+ };
975
+ startBatch();
961
976
  if (type === "clear") {
962
- deps = [...depsMap.values()];
977
+ depsMap.forEach(run);
963
978
  } else {
964
979
  const targetIsArray = isArray(target);
965
980
  const isArrayIndex = targetIsArray && isIntegerKey(key);
@@ -967,57 +982,43 @@ var Vue = (function (exports) {
967
982
  const newLength = Number(newValue);
968
983
  depsMap.forEach((dep, key2) => {
969
984
  if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
970
- deps.push(dep);
985
+ run(dep);
971
986
  }
972
987
  });
973
988
  } else {
974
- const push = (dep) => dep && deps.push(dep);
975
989
  if (key !== void 0) {
976
- push(depsMap.get(key));
990
+ run(depsMap.get(key));
977
991
  }
978
992
  if (isArrayIndex) {
979
- push(depsMap.get(ARRAY_ITERATE_KEY));
993
+ run(depsMap.get(ARRAY_ITERATE_KEY));
980
994
  }
981
995
  switch (type) {
982
996
  case "add":
983
997
  if (!targetIsArray) {
984
- push(depsMap.get(ITERATE_KEY));
998
+ run(depsMap.get(ITERATE_KEY));
985
999
  if (isMap(target)) {
986
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
1000
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
987
1001
  }
988
1002
  } else if (isArrayIndex) {
989
- push(depsMap.get("length"));
1003
+ run(depsMap.get("length"));
990
1004
  }
991
1005
  break;
992
1006
  case "delete":
993
1007
  if (!targetIsArray) {
994
- push(depsMap.get(ITERATE_KEY));
1008
+ run(depsMap.get(ITERATE_KEY));
995
1009
  if (isMap(target)) {
996
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
1010
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
997
1011
  }
998
1012
  }
999
1013
  break;
1000
1014
  case "set":
1001
1015
  if (isMap(target)) {
1002
- push(depsMap.get(ITERATE_KEY));
1016
+ run(depsMap.get(ITERATE_KEY));
1003
1017
  }
1004
1018
  break;
1005
1019
  }
1006
1020
  }
1007
1021
  }
1008
- startBatch();
1009
- for (const dep of deps) {
1010
- {
1011
- dep.trigger({
1012
- target,
1013
- type,
1014
- key,
1015
- newValue,
1016
- oldValue,
1017
- oldTarget
1018
- });
1019
- }
1020
- }
1021
1022
  endBatch();
1022
1023
  }
1023
1024
  function getDepFromReactive(object, key) {
@@ -1755,7 +1756,7 @@ var Vue = (function (exports) {
1755
1756
  return raw ? toRaw(raw) : observed;
1756
1757
  }
1757
1758
  function markRaw(value) {
1758
- if (Object.isExtensible(value)) {
1759
+ if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
1759
1760
  def(value, "__v_skip", true);
1760
1761
  }
1761
1762
  return value;
@@ -2654,23 +2655,19 @@ var Vue = (function (exports) {
2654
2655
  }
2655
2656
  }
2656
2657
  function checkRecursiveUpdates(seen, fn) {
2657
- if (!seen.has(fn)) {
2658
- seen.set(fn, 1);
2659
- } else {
2660
- const count = seen.get(fn);
2661
- if (count > RECURSION_LIMIT) {
2662
- const instance = fn.i;
2663
- const componentName = instance && getComponentName(instance.type);
2664
- handleError(
2665
- `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.`,
2666
- null,
2667
- 10
2668
- );
2669
- return true;
2670
- } else {
2671
- seen.set(fn, count + 1);
2672
- }
2658
+ const count = seen.get(fn) || 0;
2659
+ if (count > RECURSION_LIMIT) {
2660
+ const instance = fn.i;
2661
+ const componentName = instance && getComponentName(instance.type);
2662
+ handleError(
2663
+ `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.`,
2664
+ null,
2665
+ 10
2666
+ );
2667
+ return true;
2673
2668
  }
2669
+ seen.set(fn, count + 1);
2670
+ return false;
2674
2671
  }
2675
2672
 
2676
2673
  let isHmrUpdating = false;
@@ -3622,6 +3619,7 @@ var Vue = (function (exports) {
3622
3619
  }
3623
3620
  function setTransitionHooks(vnode, hooks) {
3624
3621
  if (vnode.shapeFlag & 6 && vnode.component) {
3622
+ vnode.transition = hooks;
3625
3623
  setTransitionHooks(vnode.component.subTree, hooks);
3626
3624
  } else if (vnode.shapeFlag & 128) {
3627
3625
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
@@ -3666,7 +3664,7 @@ var Vue = (function (exports) {
3666
3664
  function useId() {
3667
3665
  const i = getCurrentInstance();
3668
3666
  if (i) {
3669
- return (i.appContext.config.idPrefix || "v") + ":" + i.ids[0] + i.ids[1]++;
3667
+ return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
3670
3668
  } else {
3671
3669
  warn$1(
3672
3670
  `useId() is called when there is no active component instance to be associated with.`
@@ -5017,13 +5015,15 @@ If this is a native custom element, make sure to exclude it from component resol
5017
5015
  const sourceIsArray = isArray(source);
5018
5016
  if (sourceIsArray || isString(source)) {
5019
5017
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5018
+ let needsWrap = false;
5020
5019
  if (sourceIsReactiveArray) {
5020
+ needsWrap = !isShallow(source);
5021
5021
  source = shallowReadArray(source);
5022
5022
  }
5023
5023
  ret = new Array(source.length);
5024
5024
  for (let i = 0, l = source.length; i < l; i++) {
5025
5025
  ret[i] = renderItem(
5026
- sourceIsReactiveArray ? toReactive(source[i]) : source[i],
5026
+ needsWrap ? toReactive(source[i]) : source[i],
5027
5027
  i,
5028
5028
  void 0,
5029
5029
  cached && cached[i]
@@ -7373,7 +7373,7 @@ If you want to remount the same app, move your app creation logic into a factory
7373
7373
  endMeasure(instance, `hydrate`);
7374
7374
  }
7375
7375
  };
7376
- if (isAsyncWrapperVNode) {
7376
+ if (isAsyncWrapperVNode && type.__asyncHydrate) {
7377
7377
  type.__asyncHydrate(
7378
7378
  el,
7379
7379
  instance,
@@ -8522,8 +8522,7 @@ If you want to remount the same app, move your app creation logic into a factory
8522
8522
  data,
8523
8523
  setupState,
8524
8524
  ctx,
8525
- inheritAttrs,
8526
- isMounted
8525
+ inheritAttrs
8527
8526
  } = instance;
8528
8527
  const prev = setCurrentRenderingInstance(instance);
8529
8528
  let result;
@@ -8643,7 +8642,7 @@ If you want to remount the same app, move your app creation logic into a factory
8643
8642
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8644
8643
  );
8645
8644
  }
8646
- root.transition = isMounted ? vnode.component.subTree.transition : vnode.transition;
8645
+ setTransitionHooks(root, vnode.transition);
8647
8646
  }
8648
8647
  if (setRoot) {
8649
8648
  setRoot(root);
@@ -10409,7 +10408,7 @@ Component that was made reactive: `,
10409
10408
  return true;
10410
10409
  }
10411
10410
 
10412
- const version = "3.5.2";
10411
+ const version = "3.5.4";
10413
10412
  const warn = warn$1 ;
10414
10413
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10415
10414
  const devtools = devtools$1 ;
@@ -14726,10 +14725,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14726
14725
  }
14727
14726
  } else if (children.length > 1) {
14728
14727
  let patchFlag = 64;
14729
- let patchFlagText = PatchFlagNames[64];
14730
14728
  if (children.filter((c) => c.type !== 3).length === 1) {
14731
14729
  patchFlag |= 2048;
14732
- patchFlagText += `, ${PatchFlagNames[2048]}`;
14733
14730
  }
14734
14731
  root.codegenNode = createVNodeCall(
14735
14732
  context,
@@ -15629,10 +15626,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15629
15626
  return vnodeCall;
15630
15627
  } else {
15631
15628
  let patchFlag = 64;
15632
- let patchFlagText = PatchFlagNames[64];
15633
15629
  if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) {
15634
15630
  patchFlag |= 2048;
15635
- patchFlagText += `, ${PatchFlagNames[2048]}`;
15636
15631
  }
15637
15632
  return createVNodeCall(
15638
15633
  context,
@@ -17416,10 +17411,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17416
17411
  `stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
17417
17412
  );
17418
17413
  const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right");
17419
- const isKeyboardEvent = /* @__PURE__ */ makeMap(
17420
- `onkeyup,onkeydown,onkeypress`,
17421
- true
17422
- );
17414
+ const isKeyboardEvent = /* @__PURE__ */ makeMap(`onkeyup,onkeydown,onkeypress`);
17423
17415
  const resolveModifiers = (key, modifiers, context, loc) => {
17424
17416
  const keyModifiers = [];
17425
17417
  const nonKeyModifiers = [];
@@ -17431,7 +17423,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17431
17423
  } else {
17432
17424
  if (maybeKeyModifier(modifier)) {
17433
17425
  if (isStaticExp(key)) {
17434
- if (isKeyboardEvent(key.content)) {
17426
+ if (isKeyboardEvent(key.content.toLowerCase())) {
17435
17427
  keyModifiers.push(modifier);
17436
17428
  } else {
17437
17429
  nonKeyModifiers.push(modifier);
@@ -17484,7 +17476,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17484
17476
  ]);
17485
17477
  }
17486
17478
  if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
17487
- (!isStaticExp(key) || isKeyboardEvent(key.content))) {
17479
+ (!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) {
17488
17480
  handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [
17489
17481
  handlerExp,
17490
17482
  JSON.stringify(keyModifiers)