@vue/runtime-core 3.2.42 → 3.2.44

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.
@@ -1792,10 +1792,11 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1792
1792
  callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
1793
1793
  newValue,
1794
1794
  // pass undefined as the old value when it's changed for the first time
1795
- oldValue === INITIAL_WATCHER_VALUE ||
1796
- (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
1795
+ oldValue === INITIAL_WATCHER_VALUE
1797
1796
  ? undefined
1798
- : oldValue,
1797
+ : (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
1798
+ ? []
1799
+ : oldValue,
1799
1800
  onCleanup
1800
1801
  ]);
1801
1802
  oldValue = newValue;
@@ -7581,7 +7582,7 @@ const useSSRContext = () => {
7581
7582
  const ctx = inject(ssrContextKey);
7582
7583
  if (!ctx) {
7583
7584
  warn(`Server rendering context not provided. Make sure to only call ` +
7584
- `useSSRContext() conditionally in the server build.`);
7585
+ `useSSRContext() conditionally in the server build.`);
7585
7586
  }
7586
7587
  return ctx;
7587
7588
  }
@@ -7808,7 +7809,7 @@ function isMemoSame(cached, memo) {
7808
7809
  }
7809
7810
 
7810
7811
  // Core API ------------------------------------------------------------------
7811
- const version = "3.2.42";
7812
+ const version = "3.2.44";
7812
7813
  const _ssrUtils = {
7813
7814
  createComponentInstance,
7814
7815
  setupComponent,
@@ -5,112 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var reactivity = require('@vue/reactivity');
6
6
  var shared = require('@vue/shared');
7
7
 
8
- const stack = [];
9
8
  function warn(msg, ...args) {
10
- // avoid props formatting or warn handler tracking deps that might be mutated
11
- // during patch, leading to infinite recursion.
12
- reactivity.pauseTracking();
13
- const instance = stack.length ? stack[stack.length - 1].component : null;
14
- const appWarnHandler = instance && instance.appContext.config.warnHandler;
15
- const trace = getComponentTrace();
16
- if (appWarnHandler) {
17
- callWithErrorHandling(appWarnHandler, instance, 11 /* ErrorCodes.APP_WARN_HANDLER */, [
18
- msg + args.join(''),
19
- instance && instance.proxy,
20
- trace
21
- .map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`)
22
- .join('\n'),
23
- trace
24
- ]);
25
- }
26
- else {
27
- const warnArgs = [`[Vue warn]: ${msg}`, ...args];
28
- /* istanbul ignore if */
29
- if (trace.length &&
30
- // avoid spamming console during tests
31
- !false) {
32
- warnArgs.push(`\n`, ...formatTrace(trace));
33
- }
34
- console.warn(...warnArgs);
35
- }
36
- reactivity.resetTracking();
37
- }
38
- function getComponentTrace() {
39
- let currentVNode = stack[stack.length - 1];
40
- if (!currentVNode) {
41
- return [];
42
- }
43
- // we can't just use the stack because it will be incomplete during updates
44
- // that did not start from the root. Re-construct the parent chain using
45
- // instance parent pointers.
46
- const normalizedStack = [];
47
- while (currentVNode) {
48
- const last = normalizedStack[0];
49
- if (last && last.vnode === currentVNode) {
50
- last.recurseCount++;
51
- }
52
- else {
53
- normalizedStack.push({
54
- vnode: currentVNode,
55
- recurseCount: 0
56
- });
57
- }
58
- const parentInstance = currentVNode.component && currentVNode.component.parent;
59
- currentVNode = parentInstance && parentInstance.vnode;
60
- }
61
- return normalizedStack;
62
- }
63
- /* istanbul ignore next */
64
- function formatTrace(trace) {
65
- const logs = [];
66
- trace.forEach((entry, i) => {
67
- logs.push(...(i === 0 ? [] : [`\n`]), ...formatTraceEntry(entry));
68
- });
69
- return logs;
70
- }
71
- function formatTraceEntry({ vnode, recurseCount }) {
72
- const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
73
- const isRoot = vnode.component ? vnode.component.parent == null : false;
74
- const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;
75
- const close = `>` + postfix;
76
- return vnode.props
77
- ? [open, ...formatProps(vnode.props), close]
78
- : [open + close];
79
- }
80
- /* istanbul ignore next */
81
- function formatProps(props) {
82
- const res = [];
83
- const keys = Object.keys(props);
84
- keys.slice(0, 3).forEach(key => {
85
- res.push(...formatProp(key, props[key]));
86
- });
87
- if (keys.length > 3) {
88
- res.push(` ...`);
89
- }
90
- return res;
91
- }
92
- /* istanbul ignore next */
93
- function formatProp(key, value, raw) {
94
- if (shared.isString(value)) {
95
- value = JSON.stringify(value);
96
- return raw ? value : [`${key}=${value}`];
97
- }
98
- else if (typeof value === 'number' ||
99
- typeof value === 'boolean' ||
100
- value == null) {
101
- return raw ? value : [`${key}=${value}`];
102
- }
103
- else if (reactivity.isRef(value)) {
104
- value = formatProp(key, reactivity.toRaw(value.value), true);
105
- return raw ? value : [`${key}=Ref<`, value, `>`];
106
- }
107
- else if (shared.isFunction(value)) {
108
- return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
109
- }
110
- else {
111
- value = reactivity.toRaw(value);
112
- return raw ? value : [`${key}=`, value];
113
- }
9
+ return;
114
10
  }
115
11
 
116
12
  function callWithErrorHandling(fn, instance, type, args) {
@@ -1316,10 +1212,11 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1316
1212
  callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
1317
1213
  newValue,
1318
1214
  // pass undefined as the old value when it's changed for the first time
1319
- oldValue === INITIAL_WATCHER_VALUE ||
1320
- (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
1215
+ oldValue === INITIAL_WATCHER_VALUE
1321
1216
  ? undefined
1322
- : oldValue,
1217
+ : (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
1218
+ ? []
1219
+ : oldValue,
1323
1220
  onCleanup
1324
1221
  ]);
1325
1222
  oldValue = newValue;
@@ -5980,37 +5877,11 @@ function getExposeProxy(instance) {
5980
5877
  })));
5981
5878
  }
5982
5879
  }
5983
- const classifyRE = /(?:^|[-_])(\w)/g;
5984
- const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
5985
5880
  function getComponentName(Component, includeInferred = true) {
5986
5881
  return shared.isFunction(Component)
5987
5882
  ? Component.displayName || Component.name
5988
5883
  : Component.name || (includeInferred && Component.__name);
5989
5884
  }
5990
- /* istanbul ignore next */
5991
- function formatComponentName(instance, Component, isRoot = false) {
5992
- let name = getComponentName(Component);
5993
- if (!name && Component.__file) {
5994
- const match = Component.__file.match(/([^/\\]+)\.\w+$/);
5995
- if (match) {
5996
- name = match[1];
5997
- }
5998
- }
5999
- if (!name && instance && instance.parent) {
6000
- // try to infer the name based on reverse resolution
6001
- const inferFromRegistry = (registry) => {
6002
- for (const key in registry) {
6003
- if (registry[key] === Component) {
6004
- return key;
6005
- }
6006
- }
6007
- };
6008
- name =
6009
- inferFromRegistry(instance.components ||
6010
- instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
6011
- }
6012
- return name ? classify(name) : isRoot ? `App` : `Anonymous`;
6013
- }
6014
5885
  function isClassComponent(value) {
6015
5886
  return shared.isFunction(value) && '__vccOpts' in value;
6016
5887
  }
@@ -6179,10 +6050,6 @@ const ssrContextKey = Symbol(``);
6179
6050
  const useSSRContext = () => {
6180
6051
  {
6181
6052
  const ctx = inject(ssrContextKey);
6182
- if (!ctx) {
6183
- warn(`Server rendering context not provided. Make sure to only call ` +
6184
- `useSSRContext() conditionally in the server build.`);
6185
- }
6186
6053
  return ctx;
6187
6054
  }
6188
6055
  };
@@ -6222,7 +6089,7 @@ function isMemoSame(cached, memo) {
6222
6089
  }
6223
6090
 
6224
6091
  // Core API ------------------------------------------------------------------
6225
- const version = "3.2.42";
6092
+ const version = "3.2.44";
6226
6093
  const _ssrUtils = {
6227
6094
  createComponentInstance,
6228
6095
  setupComponent,
@@ -11,6 +11,8 @@ function popWarningContext() {
11
11
  stack.pop();
12
12
  }
13
13
  function warn(msg, ...args) {
14
+ if (!(process.env.NODE_ENV !== 'production'))
15
+ return;
14
16
  // avoid props formatting or warn handler tracking deps that might be mutated
15
17
  // during patch, leading to infinite recursion.
16
18
  pauseTracking();
@@ -1798,10 +1800,11 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
1798
1800
  callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
1799
1801
  newValue,
1800
1802
  // pass undefined as the old value when it's changed for the first time
1801
- oldValue === INITIAL_WATCHER_VALUE ||
1802
- (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
1803
+ oldValue === INITIAL_WATCHER_VALUE
1803
1804
  ? undefined
1804
- : oldValue,
1805
+ : (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
1806
+ ? []
1807
+ : oldValue,
1805
1808
  onCleanup
1806
1809
  ]);
1807
1810
  oldValue = newValue;
@@ -7666,8 +7669,9 @@ const useSSRContext = () => {
7666
7669
  {
7667
7670
  const ctx = inject(ssrContextKey);
7668
7671
  if (!ctx) {
7669
- warn(`Server rendering context not provided. Make sure to only call ` +
7670
- `useSSRContext() conditionally in the server build.`);
7672
+ (process.env.NODE_ENV !== 'production') &&
7673
+ warn(`Server rendering context not provided. Make sure to only call ` +
7674
+ `useSSRContext() conditionally in the server build.`);
7671
7675
  }
7672
7676
  return ctx;
7673
7677
  }
@@ -7894,7 +7898,7 @@ function isMemoSame(cached, memo) {
7894
7898
  }
7895
7899
 
7896
7900
  // Core API ------------------------------------------------------------------
7897
- const version = "3.2.42";
7901
+ const version = "3.2.44";
7898
7902
  const _ssrUtils = {
7899
7903
  createComponentInstance,
7900
7904
  setupComponent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.2.42",
3
+ "version": "3.2.44",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
34
34
  "dependencies": {
35
- "@vue/shared": "3.2.42",
36
- "@vue/reactivity": "3.2.42"
35
+ "@vue/shared": "3.2.44",
36
+ "@vue/reactivity": "3.2.44"
37
37
  }
38
38
  }