@vue/compat 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,13 +1,14 @@
1
1
  /**
2
- * @vue/compat v3.5.2
2
+ * @vue/compat 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 = !!(process.env.NODE_ENV !== "production") ? 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
  }
@@ -889,9 +890,25 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
889
890
  globalVersion++;
890
891
  return;
891
892
  }
892
- let deps = [];
893
+ const run = (dep) => {
894
+ if (dep) {
895
+ if (!!(process.env.NODE_ENV !== "production")) {
896
+ dep.trigger({
897
+ target,
898
+ type,
899
+ key,
900
+ newValue,
901
+ oldValue,
902
+ oldTarget
903
+ });
904
+ } else {
905
+ dep.trigger();
906
+ }
907
+ }
908
+ };
909
+ startBatch();
893
910
  if (type === "clear") {
894
- deps = [...depsMap.values()];
911
+ depsMap.forEach(run);
895
912
  } else {
896
913
  const targetIsArray = isArray(target);
897
914
  const isArrayIndex = targetIsArray && isIntegerKey(key);
@@ -899,59 +916,43 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
899
916
  const newLength = Number(newValue);
900
917
  depsMap.forEach((dep, key2) => {
901
918
  if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
902
- deps.push(dep);
919
+ run(dep);
903
920
  }
904
921
  });
905
922
  } else {
906
- const push = (dep) => dep && deps.push(dep);
907
923
  if (key !== void 0) {
908
- push(depsMap.get(key));
924
+ run(depsMap.get(key));
909
925
  }
910
926
  if (isArrayIndex) {
911
- push(depsMap.get(ARRAY_ITERATE_KEY));
927
+ run(depsMap.get(ARRAY_ITERATE_KEY));
912
928
  }
913
929
  switch (type) {
914
930
  case "add":
915
931
  if (!targetIsArray) {
916
- push(depsMap.get(ITERATE_KEY));
932
+ run(depsMap.get(ITERATE_KEY));
917
933
  if (isMap(target)) {
918
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
934
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
919
935
  }
920
936
  } else if (isArrayIndex) {
921
- push(depsMap.get("length"));
937
+ run(depsMap.get("length"));
922
938
  }
923
939
  break;
924
940
  case "delete":
925
941
  if (!targetIsArray) {
926
- push(depsMap.get(ITERATE_KEY));
942
+ run(depsMap.get(ITERATE_KEY));
927
943
  if (isMap(target)) {
928
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
944
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
929
945
  }
930
946
  }
931
947
  break;
932
948
  case "set":
933
949
  if (isMap(target)) {
934
- push(depsMap.get(ITERATE_KEY));
950
+ run(depsMap.get(ITERATE_KEY));
935
951
  }
936
952
  break;
937
953
  }
938
954
  }
939
955
  }
940
- startBatch();
941
- for (const dep of deps) {
942
- if (!!(process.env.NODE_ENV !== "production")) {
943
- dep.trigger({
944
- target,
945
- type,
946
- key,
947
- newValue,
948
- oldValue,
949
- oldTarget
950
- });
951
- } else {
952
- dep.trigger();
953
- }
954
- }
955
956
  endBatch();
956
957
  }
957
958
  function getDepFromReactive(object, key) {
@@ -1689,7 +1690,7 @@ function toRaw(observed) {
1689
1690
  return raw ? toRaw(raw) : observed;
1690
1691
  }
1691
1692
  function markRaw(value) {
1692
- if (Object.isExtensible(value)) {
1693
+ if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
1693
1694
  def(value, "__v_skip", true);
1694
1695
  }
1695
1696
  return value;
@@ -2599,23 +2600,19 @@ function flushJobs(seen) {
2599
2600
  }
2600
2601
  }
2601
2602
  function checkRecursiveUpdates(seen, fn) {
2602
- if (!seen.has(fn)) {
2603
- seen.set(fn, 1);
2604
- } else {
2605
- const count = seen.get(fn);
2606
- if (count > RECURSION_LIMIT) {
2607
- const instance = fn.i;
2608
- const componentName = instance && getComponentName(instance.type);
2609
- handleError(
2610
- `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.`,
2611
- null,
2612
- 10
2613
- );
2614
- return true;
2615
- } else {
2616
- seen.set(fn, count + 1);
2617
- }
2603
+ const count = seen.get(fn) || 0;
2604
+ if (count > RECURSION_LIMIT) {
2605
+ const instance = fn.i;
2606
+ const componentName = instance && getComponentName(instance.type);
2607
+ handleError(
2608
+ `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.`,
2609
+ null,
2610
+ 10
2611
+ );
2612
+ return true;
2618
2613
  }
2614
+ seen.set(fn, count + 1);
2615
+ return false;
2619
2616
  }
2620
2617
 
2621
2618
  let isHmrUpdating = false;
@@ -4102,6 +4099,7 @@ function getInnerChild$1(vnode) {
4102
4099
  }
4103
4100
  function setTransitionHooks(vnode, hooks) {
4104
4101
  if (vnode.shapeFlag & 6 && vnode.component) {
4102
+ vnode.transition = hooks;
4105
4103
  setTransitionHooks(vnode.component.subTree, hooks);
4106
4104
  } else if (vnode.shapeFlag & 128) {
4107
4105
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
@@ -4146,7 +4144,7 @@ function defineComponent(options, extraOptions) {
4146
4144
  function useId() {
4147
4145
  const i = getCurrentInstance();
4148
4146
  if (i) {
4149
- return (i.appContext.config.idPrefix || "v") + ":" + i.ids[0] + i.ids[1]++;
4147
+ return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
4150
4148
  } else if (!!(process.env.NODE_ENV !== "production")) {
4151
4149
  warn$1(
4152
4150
  `useId() is called when there is no active component instance to be associated with.`
@@ -5805,13 +5803,15 @@ function renderList(source, renderItem, cache, index) {
5805
5803
  const sourceIsArray = isArray(source);
5806
5804
  if (sourceIsArray || isString(source)) {
5807
5805
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5806
+ let needsWrap = false;
5808
5807
  if (sourceIsReactiveArray) {
5808
+ needsWrap = !isShallow(source);
5809
5809
  source = shallowReadArray(source);
5810
5810
  }
5811
5811
  ret = new Array(source.length);
5812
5812
  for (let i = 0, l = source.length; i < l; i++) {
5813
5813
  ret[i] = renderItem(
5814
- sourceIsReactiveArray ? toReactive(source[i]) : source[i],
5814
+ needsWrap ? toReactive(source[i]) : source[i],
5815
5815
  i,
5816
5816
  void 0,
5817
5817
  cached && cached[i]
@@ -7064,7 +7064,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7064
7064
  return vm;
7065
7065
  }
7066
7066
  }
7067
- Vue.version = `2.6.14-compat:${"3.5.2"}`;
7067
+ Vue.version = `2.6.14-compat:${"3.5.4"}`;
7068
7068
  Vue.config = singletonApp.config;
7069
7069
  Vue.use = (plugin, ...options) => {
7070
7070
  if (plugin && isFunction(plugin.install)) {
@@ -9009,7 +9009,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9009
9009
  endMeasure(instance, `hydrate`);
9010
9010
  }
9011
9011
  };
9012
- if (isAsyncWrapperVNode) {
9012
+ if (isAsyncWrapperVNode && type.__asyncHydrate) {
9013
9013
  type.__asyncHydrate(
9014
9014
  el,
9015
9015
  instance,
@@ -10217,8 +10217,7 @@ function renderComponentRoot(instance) {
10217
10217
  data,
10218
10218
  setupState,
10219
10219
  ctx,
10220
- inheritAttrs,
10221
- isMounted
10220
+ inheritAttrs
10222
10221
  } = instance;
10223
10222
  const prev = setCurrentRenderingInstance(instance);
10224
10223
  let result;
@@ -10359,7 +10358,7 @@ function renderComponentRoot(instance) {
10359
10358
  `Component inside <Transition> renders non-element root node that cannot be animated.`
10360
10359
  );
10361
10360
  }
10362
- root.transition = isMounted ? vnode.component.subTree.transition : vnode.transition;
10361
+ setTransitionHooks(root, vnode.transition);
10363
10362
  }
10364
10363
  if (!!(process.env.NODE_ENV !== "production") && setRoot) {
10365
10364
  setRoot(root);
@@ -12232,7 +12231,7 @@ function isMemoSame(cached, memo) {
12232
12231
  return true;
12233
12232
  }
12234
12233
 
12235
- const version = "3.5.2";
12234
+ const version = "3.5.4";
12236
12235
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12237
12236
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12238
12237
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -12245,7 +12244,9 @@ const _ssrUtils = {
12245
12244
  isVNode: isVNode,
12246
12245
  normalizeVNode,
12247
12246
  getComponentPublicInstance,
12248
- ensureValidVNode
12247
+ ensureValidVNode,
12248
+ pushWarningContext,
12249
+ popWarningContext
12249
12250
  };
12250
12251
  const ssrUtils = _ssrUtils ;
12251
12252
  const resolveFilter = resolveFilter$1 ;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.2
2
+ * @vue/compat 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 () {
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 Vue = (function () {
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 Vue = (function () {
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 Vue = (function () {
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 Vue = (function () {
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 Vue = (function () {
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;
@@ -4086,6 +4083,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4086
4083
  }
4087
4084
  function setTransitionHooks(vnode, hooks) {
4088
4085
  if (vnode.shapeFlag & 6 && vnode.component) {
4086
+ vnode.transition = hooks;
4089
4087
  setTransitionHooks(vnode.component.subTree, hooks);
4090
4088
  } else if (vnode.shapeFlag & 128) {
4091
4089
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
@@ -4130,7 +4128,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4130
4128
  function useId() {
4131
4129
  const i = getCurrentInstance();
4132
4130
  if (i) {
4133
- return (i.appContext.config.idPrefix || "v") + ":" + i.ids[0] + i.ids[1]++;
4131
+ return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
4134
4132
  } else {
4135
4133
  warn$1(
4136
4134
  `useId() is called when there is no active component instance to be associated with.`
@@ -5772,13 +5770,15 @@ If this is a native custom element, make sure to exclude it from component resol
5772
5770
  const sourceIsArray = isArray(source);
5773
5771
  if (sourceIsArray || isString(source)) {
5774
5772
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5773
+ let needsWrap = false;
5775
5774
  if (sourceIsReactiveArray) {
5775
+ needsWrap = !isShallow(source);
5776
5776
  source = shallowReadArray(source);
5777
5777
  }
5778
5778
  ret = new Array(source.length);
5779
5779
  for (let i = 0, l = source.length; i < l; i++) {
5780
5780
  ret[i] = renderItem(
5781
- sourceIsReactiveArray ? toReactive(source[i]) : source[i],
5781
+ needsWrap ? toReactive(source[i]) : source[i],
5782
5782
  i,
5783
5783
  void 0,
5784
5784
  cached && cached[i]
@@ -7026,7 +7026,7 @@ If this is a native custom element, make sure to exclude it from component resol
7026
7026
  return vm;
7027
7027
  }
7028
7028
  }
7029
- Vue.version = `2.6.14-compat:${"3.5.2"}`;
7029
+ Vue.version = `2.6.14-compat:${"3.5.4"}`;
7030
7030
  Vue.config = singletonApp.config;
7031
7031
  Vue.use = (plugin, ...options) => {
7032
7032
  if (plugin && isFunction(plugin.install)) {
@@ -8931,7 +8931,7 @@ If you want to remount the same app, move your app creation logic into a factory
8931
8931
  endMeasure(instance, `hydrate`);
8932
8932
  }
8933
8933
  };
8934
- if (isAsyncWrapperVNode) {
8934
+ if (isAsyncWrapperVNode && type.__asyncHydrate) {
8935
8935
  type.__asyncHydrate(
8936
8936
  el,
8937
8937
  instance,
@@ -10117,8 +10117,7 @@ If you want to remount the same app, move your app creation logic into a factory
10117
10117
  data,
10118
10118
  setupState,
10119
10119
  ctx,
10120
- inheritAttrs,
10121
- isMounted
10120
+ inheritAttrs
10122
10121
  } = instance;
10123
10122
  const prev = setCurrentRenderingInstance(instance);
10124
10123
  let result;
@@ -10259,7 +10258,7 @@ If you want to remount the same app, move your app creation logic into a factory
10259
10258
  `Component inside <Transition> renders non-element root node that cannot be animated.`
10260
10259
  );
10261
10260
  }
10262
- root.transition = isMounted ? vnode.component.subTree.transition : vnode.transition;
10261
+ setTransitionHooks(root, vnode.transition);
10263
10262
  }
10264
10263
  if (setRoot) {
10265
10264
  setRoot(root);
@@ -12104,7 +12103,7 @@ Component that was made reactive: `,
12104
12103
  return true;
12105
12104
  }
12106
12105
 
12107
- const version = "3.5.2";
12106
+ const version = "3.5.4";
12108
12107
  const warn = warn$1 ;
12109
12108
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12110
12109
  const devtools = devtools$1 ;