@vue/runtime-core 3.2.42 → 3.2.43

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.
@@ -1794,7 +1794,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1794
1794
  // pass undefined as the old value when it's changed for the first time
1795
1795
  oldValue === INITIAL_WATCHER_VALUE ||
1796
1796
  (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
1797
- ? undefined
1797
+ ? []
1798
1798
  : oldValue,
1799
1799
  onCleanup
1800
1800
  ]);
@@ -7581,7 +7581,7 @@ const useSSRContext = () => {
7581
7581
  const ctx = inject(ssrContextKey);
7582
7582
  if (!ctx) {
7583
7583
  warn(`Server rendering context not provided. Make sure to only call ` +
7584
- `useSSRContext() conditionally in the server build.`);
7584
+ `useSSRContext() conditionally in the server build.`);
7585
7585
  }
7586
7586
  return ctx;
7587
7587
  }
@@ -7808,7 +7808,7 @@ function isMemoSame(cached, memo) {
7808
7808
  }
7809
7809
 
7810
7810
  // Core API ------------------------------------------------------------------
7811
- const version = "3.2.42";
7811
+ const version = "3.2.43";
7812
7812
  const _ssrUtils = {
7813
7813
  createComponentInstance,
7814
7814
  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) {
@@ -1318,7 +1214,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1318
1214
  // pass undefined as the old value when it's changed for the first time
1319
1215
  oldValue === INITIAL_WATCHER_VALUE ||
1320
1216
  (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
1321
- ? undefined
1217
+ ? []
1322
1218
  : oldValue,
1323
1219
  onCleanup
1324
1220
  ]);
@@ -5980,37 +5876,11 @@ function getExposeProxy(instance) {
5980
5876
  })));
5981
5877
  }
5982
5878
  }
5983
- const classifyRE = /(?:^|[-_])(\w)/g;
5984
- const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
5985
5879
  function getComponentName(Component, includeInferred = true) {
5986
5880
  return shared.isFunction(Component)
5987
5881
  ? Component.displayName || Component.name
5988
5882
  : Component.name || (includeInferred && Component.__name);
5989
5883
  }
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
5884
  function isClassComponent(value) {
6015
5885
  return shared.isFunction(value) && '__vccOpts' in value;
6016
5886
  }
@@ -6179,10 +6049,6 @@ const ssrContextKey = Symbol(``);
6179
6049
  const useSSRContext = () => {
6180
6050
  {
6181
6051
  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
6052
  return ctx;
6187
6053
  }
6188
6054
  };
@@ -6222,7 +6088,7 @@ function isMemoSame(cached, memo) {
6222
6088
  }
6223
6089
 
6224
6090
  // Core API ------------------------------------------------------------------
6225
- const version = "3.2.42";
6091
+ const version = "3.2.43";
6226
6092
  const _ssrUtils = {
6227
6093
  createComponentInstance,
6228
6094
  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();
@@ -1800,7 +1802,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
1800
1802
  // pass undefined as the old value when it's changed for the first time
1801
1803
  oldValue === INITIAL_WATCHER_VALUE ||
1802
1804
  (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
1803
- ? undefined
1805
+ ? []
1804
1806
  : oldValue,
1805
1807
  onCleanup
1806
1808
  ]);
@@ -7666,8 +7668,9 @@ const useSSRContext = () => {
7666
7668
  {
7667
7669
  const ctx = inject(ssrContextKey);
7668
7670
  if (!ctx) {
7669
- warn(`Server rendering context not provided. Make sure to only call ` +
7670
- `useSSRContext() conditionally in the server build.`);
7671
+ (process.env.NODE_ENV !== 'production') &&
7672
+ warn(`Server rendering context not provided. Make sure to only call ` +
7673
+ `useSSRContext() conditionally in the server build.`);
7671
7674
  }
7672
7675
  return ctx;
7673
7676
  }
@@ -7894,7 +7897,7 @@ function isMemoSame(cached, memo) {
7894
7897
  }
7895
7898
 
7896
7899
  // Core API ------------------------------------------------------------------
7897
- const version = "3.2.42";
7900
+ const version = "3.2.43";
7898
7901
  const _ssrUtils = {
7899
7902
  createComponentInstance,
7900
7903
  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.43",
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.43",
36
+ "@vue/reactivity": "3.2.43"
37
37
  }
38
38
  }