vue 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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.3
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.3
2
+ * vue 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 v3.5.3
2
+ * vue 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 expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (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({}) ;
@@ -678,7 +679,7 @@ function cleanupDeps(sub) {
678
679
  }
679
680
  function isDirty(sub) {
680
681
  for (let link = sub.deps; link; link = link.nextDep) {
681
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) === false || link.dep.version !== link.version) {
682
+ if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
682
683
  return true;
683
684
  }
684
685
  }
@@ -688,9 +689,6 @@ function isDirty(sub) {
688
689
  return false;
689
690
  }
690
691
  function refreshComputed(computed) {
691
- if (computed.flags & 2) {
692
- return false;
693
- }
694
692
  if (computed.flags & 4 && !(computed.flags & 16)) {
695
693
  return;
696
694
  }
@@ -957,9 +955,23 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
957
955
  globalVersion++;
958
956
  return;
959
957
  }
960
- let deps = [];
958
+ const run = (dep) => {
959
+ if (dep) {
960
+ {
961
+ dep.trigger({
962
+ target,
963
+ type,
964
+ key,
965
+ newValue,
966
+ oldValue,
967
+ oldTarget
968
+ });
969
+ }
970
+ }
971
+ };
972
+ startBatch();
961
973
  if (type === "clear") {
962
- deps = [...depsMap.values()];
974
+ depsMap.forEach(run);
963
975
  } else {
964
976
  const targetIsArray = isArray(target);
965
977
  const isArrayIndex = targetIsArray && isIntegerKey(key);
@@ -967,57 +979,43 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
967
979
  const newLength = Number(newValue);
968
980
  depsMap.forEach((dep, key2) => {
969
981
  if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
970
- deps.push(dep);
982
+ run(dep);
971
983
  }
972
984
  });
973
985
  } else {
974
- const push = (dep) => dep && deps.push(dep);
975
986
  if (key !== void 0) {
976
- push(depsMap.get(key));
987
+ run(depsMap.get(key));
977
988
  }
978
989
  if (isArrayIndex) {
979
- push(depsMap.get(ARRAY_ITERATE_KEY));
990
+ run(depsMap.get(ARRAY_ITERATE_KEY));
980
991
  }
981
992
  switch (type) {
982
993
  case "add":
983
994
  if (!targetIsArray) {
984
- push(depsMap.get(ITERATE_KEY));
995
+ run(depsMap.get(ITERATE_KEY));
985
996
  if (isMap(target)) {
986
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
997
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
987
998
  }
988
999
  } else if (isArrayIndex) {
989
- push(depsMap.get("length"));
1000
+ run(depsMap.get("length"));
990
1001
  }
991
1002
  break;
992
1003
  case "delete":
993
1004
  if (!targetIsArray) {
994
- push(depsMap.get(ITERATE_KEY));
1005
+ run(depsMap.get(ITERATE_KEY));
995
1006
  if (isMap(target)) {
996
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
1007
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
997
1008
  }
998
1009
  }
999
1010
  break;
1000
1011
  case "set":
1001
1012
  if (isMap(target)) {
1002
- push(depsMap.get(ITERATE_KEY));
1013
+ run(depsMap.get(ITERATE_KEY));
1003
1014
  }
1004
1015
  break;
1005
1016
  }
1006
1017
  }
1007
1018
  }
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
1019
  endBatch();
1022
1020
  }
1023
1021
  function getDepFromReactive(object, key) {
@@ -1755,7 +1753,7 @@ function toRaw(observed) {
1755
1753
  return raw ? toRaw(raw) : observed;
1756
1754
  }
1757
1755
  function markRaw(value) {
1758
- if (Object.isExtensible(value)) {
1756
+ if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
1759
1757
  def(value, "__v_skip", true);
1760
1758
  }
1761
1759
  return value;
@@ -1965,8 +1963,8 @@ class ComputedRefImpl {
1965
1963
  * @internal
1966
1964
  */
1967
1965
  notify() {
1966
+ this.flags |= 16;
1968
1967
  if (activeSub !== this) {
1969
- this.flags |= 16;
1970
1968
  this.dep.notify();
1971
1969
  }
1972
1970
  }
@@ -2654,23 +2652,19 @@ function flushJobs(seen) {
2654
2652
  }
2655
2653
  }
2656
2654
  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
- }
2655
+ const count = seen.get(fn) || 0;
2656
+ if (count > RECURSION_LIMIT) {
2657
+ const instance = fn.i;
2658
+ const componentName = instance && getComponentName(instance.type);
2659
+ handleError(
2660
+ `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.`,
2661
+ null,
2662
+ 10
2663
+ );
2664
+ return true;
2673
2665
  }
2666
+ seen.set(fn, count + 1);
2667
+ return false;
2674
2668
  }
2675
2669
 
2676
2670
  let isHmrUpdating = false;
@@ -5024,13 +5018,15 @@ function renderList(source, renderItem, cache, index) {
5024
5018
  const sourceIsArray = isArray(source);
5025
5019
  if (sourceIsArray || isString(source)) {
5026
5020
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5021
+ let needsWrap = false;
5027
5022
  if (sourceIsReactiveArray) {
5023
+ needsWrap = !isShallow(source);
5028
5024
  source = shallowReadArray(source);
5029
5025
  }
5030
5026
  ret = new Array(source.length);
5031
5027
  for (let i = 0, l = source.length; i < l; i++) {
5032
5028
  ret[i] = renderItem(
5033
- sourceIsReactiveArray ? toReactive(source[i]) : source[i],
5029
+ needsWrap ? toReactive(source[i]) : source[i],
5034
5030
  i,
5035
5031
  void 0,
5036
5032
  cached && cached[i]
@@ -10454,7 +10450,7 @@ function isMemoSame(cached, memo) {
10454
10450
  return true;
10455
10451
  }
10456
10452
 
10457
- const version = "3.5.3";
10453
+ const version = "3.5.4";
10458
10454
  const warn = warn$1 ;
10459
10455
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10460
10456
  const devtools = devtools$1 ;
@@ -15015,10 +15011,8 @@ function createRootCodegen(root, context) {
15015
15011
  }
15016
15012
  } else if (children.length > 1) {
15017
15013
  let patchFlag = 64;
15018
- let patchFlagText = PatchFlagNames[64];
15019
15014
  if (children.filter((c) => c.type !== 3).length === 1) {
15020
15015
  patchFlag |= 2048;
15021
- patchFlagText += `, ${PatchFlagNames[2048]}`;
15022
15016
  }
15023
15017
  root.codegenNode = createVNodeCall(
15024
15018
  context,
@@ -15918,10 +15912,8 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
15918
15912
  return vnodeCall;
15919
15913
  } else {
15920
15914
  let patchFlag = 64;
15921
- let patchFlagText = PatchFlagNames[64];
15922
15915
  if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) {
15923
15916
  patchFlag |= 2048;
15924
- patchFlagText += `, ${PatchFlagNames[2048]}`;
15925
15917
  }
15926
15918
  return createVNodeCall(
15927
15919
  context,
@@ -17705,10 +17697,7 @@ const isNonKeyModifier = /* @__PURE__ */ makeMap(
17705
17697
  `stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
17706
17698
  );
17707
17699
  const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right");
17708
- const isKeyboardEvent = /* @__PURE__ */ makeMap(
17709
- `onkeyup,onkeydown,onkeypress`,
17710
- true
17711
- );
17700
+ const isKeyboardEvent = /* @__PURE__ */ makeMap(`onkeyup,onkeydown,onkeypress`);
17712
17701
  const resolveModifiers = (key, modifiers, context, loc) => {
17713
17702
  const keyModifiers = [];
17714
17703
  const nonKeyModifiers = [];
@@ -17720,7 +17709,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
17720
17709
  } else {
17721
17710
  if (maybeKeyModifier(modifier)) {
17722
17711
  if (isStaticExp(key)) {
17723
- if (isKeyboardEvent(key.content)) {
17712
+ if (isKeyboardEvent(key.content.toLowerCase())) {
17724
17713
  keyModifiers.push(modifier);
17725
17714
  } else {
17726
17715
  nonKeyModifiers.push(modifier);
@@ -17773,7 +17762,7 @@ const transformOn = (dir, node, context) => {
17773
17762
  ]);
17774
17763
  }
17775
17764
  if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
17776
- (!isStaticExp(key) || isKeyboardEvent(key.content))) {
17765
+ (!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) {
17777
17766
  handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [
17778
17767
  handlerExp,
17779
17768
  JSON.stringify(keyModifiers)