@vue/runtime-core 3.2.41 → 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.
@@ -681,7 +681,7 @@ function emit$1(instance, event, ...rawArgs) {
681
681
  const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`;
682
682
  const { number, trim } = props[modifiersKey] || shared.EMPTY_OBJ;
683
683
  if (trim) {
684
- args = rawArgs.map(a => a.trim());
684
+ args = rawArgs.map(a => (shared.isString(a) ? a.trim() : a));
685
685
  }
686
686
  if (number) {
687
687
  args = rawArgs.map(shared.toNumber);
@@ -1746,7 +1746,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1746
1746
  };
1747
1747
  };
1748
1748
  // in SSR there is no need to setup an actual effect, and it should be noop
1749
- // unless it's eager
1749
+ // unless it's eager or sync flush
1750
+ let ssrCleanup;
1750
1751
  if (isInSSRComponentSetup) {
1751
1752
  // we will also not call the invalidate callback (+ runner is not set up)
1752
1753
  onCleanup = shared.NOOP;
@@ -1760,9 +1761,17 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1760
1761
  onCleanup
1761
1762
  ]);
1762
1763
  }
1763
- return shared.NOOP;
1764
+ if (flush === 'sync') {
1765
+ const ctx = useSSRContext();
1766
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
1767
+ }
1768
+ else {
1769
+ return shared.NOOP;
1770
+ }
1764
1771
  }
1765
- let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
1772
+ let oldValue = isMultiSource
1773
+ ? new Array(source.length).fill(INITIAL_WATCHER_VALUE)
1774
+ : INITIAL_WATCHER_VALUE;
1766
1775
  const job = () => {
1767
1776
  if (!effect.active) {
1768
1777
  return;
@@ -1783,7 +1792,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1783
1792
  callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
1784
1793
  newValue,
1785
1794
  // pass undefined as the old value when it's changed for the first time
1786
- oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
1795
+ oldValue === INITIAL_WATCHER_VALUE ||
1796
+ (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
1797
+ ? []
1798
+ : oldValue,
1787
1799
  onCleanup
1788
1800
  ]);
1789
1801
  oldValue = newValue;
@@ -1831,12 +1843,15 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1831
1843
  else {
1832
1844
  effect.run();
1833
1845
  }
1834
- return () => {
1846
+ const unwatch = () => {
1835
1847
  effect.stop();
1836
1848
  if (instance && instance.scope) {
1837
1849
  shared.remove(instance.scope.effects, effect);
1838
1850
  }
1839
1851
  };
1852
+ if (ssrCleanup)
1853
+ ssrCleanup.push(unwatch);
1854
+ return unwatch;
1840
1855
  }
1841
1856
  // this.$watch
1842
1857
  function instanceWatch(source, value, options) {
@@ -2018,7 +2033,11 @@ const BaseTransitionImpl = {
2018
2033
  // return placeholder node and queue update when leave finishes
2019
2034
  leavingHooks.afterLeave = () => {
2020
2035
  state.isLeaving = false;
2021
- instance.update();
2036
+ // #6835
2037
+ // it also needs to be updated when active is undefined
2038
+ if (instance.update.active !== false) {
2039
+ instance.update();
2040
+ }
2022
2041
  };
2023
2042
  return emptyPlaceholder(child);
2024
2043
  }
@@ -2544,7 +2563,8 @@ const KeepAliveImpl = {
2544
2563
  : comp);
2545
2564
  const { include, exclude, max } = props;
2546
2565
  if ((include && (!name || !matches(include, name))) ||
2547
- (exclude && name && matches(exclude, name))) {
2566
+ (exclude && name && matches(exclude, name)) ||
2567
+ (hmrDirtyComponents.has(comp))) {
2548
2568
  current = vnode;
2549
2569
  return rawVNode;
2550
2570
  }
@@ -2756,23 +2776,25 @@ function withDirectives(vnode, directives) {
2756
2776
  const bindings = vnode.dirs || (vnode.dirs = []);
2757
2777
  for (let i = 0; i < directives.length; i++) {
2758
2778
  let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i];
2759
- if (shared.isFunction(dir)) {
2760
- dir = {
2761
- mounted: dir,
2762
- updated: dir
2763
- };
2764
- }
2765
- if (dir.deep) {
2766
- traverse(value);
2779
+ if (dir) {
2780
+ if (shared.isFunction(dir)) {
2781
+ dir = {
2782
+ mounted: dir,
2783
+ updated: dir
2784
+ };
2785
+ }
2786
+ if (dir.deep) {
2787
+ traverse(value);
2788
+ }
2789
+ bindings.push({
2790
+ dir,
2791
+ instance,
2792
+ value,
2793
+ oldValue: void 0,
2794
+ arg,
2795
+ modifiers
2796
+ });
2767
2797
  }
2768
- bindings.push({
2769
- dir,
2770
- instance,
2771
- value,
2772
- oldValue: void 0,
2773
- arg,
2774
- modifiers
2775
- });
2776
2798
  }
2777
2799
  return vnode;
2778
2800
  }
@@ -3985,7 +4007,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
3985
4007
  if (validatePropName(normalizedKey)) {
3986
4008
  const opt = raw[key];
3987
4009
  const prop = (normalized[normalizedKey] =
3988
- shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : opt);
4010
+ shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : { ...opt });
3989
4011
  if (prop) {
3990
4012
  const booleanIndex = getTypeIndex(Boolean, prop.type);
3991
4013
  const stringIndex = getTypeIndex(String, prop.type);
@@ -7326,6 +7348,9 @@ function getExposeProxy(instance) {
7326
7348
  else if (key in publicPropertiesMap) {
7327
7349
  return publicPropertiesMap[key](instance);
7328
7350
  }
7351
+ },
7352
+ has(target, key) {
7353
+ return key in target || key in publicPropertiesMap;
7329
7354
  }
7330
7355
  })));
7331
7356
  }
@@ -7556,7 +7581,7 @@ const useSSRContext = () => {
7556
7581
  const ctx = inject(ssrContextKey);
7557
7582
  if (!ctx) {
7558
7583
  warn(`Server rendering context not provided. Make sure to only call ` +
7559
- `useSSRContext() conditionally in the server build.`);
7584
+ `useSSRContext() conditionally in the server build.`);
7560
7585
  }
7561
7586
  return ctx;
7562
7587
  }
@@ -7783,7 +7808,7 @@ function isMemoSame(cached, memo) {
7783
7808
  }
7784
7809
 
7785
7810
  // Core API ------------------------------------------------------------------
7786
- const version = "3.2.41";
7811
+ const version = "3.2.43";
7787
7812
  const _ssrUtils = {
7788
7813
  createComponentInstance,
7789
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) {
@@ -378,7 +274,7 @@ function emit(instance, event, ...rawArgs) {
378
274
  const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`;
379
275
  const { number, trim } = props[modifiersKey] || shared.EMPTY_OBJ;
380
276
  if (trim) {
381
- args = rawArgs.map(a => a.trim());
277
+ args = rawArgs.map(a => (shared.isString(a) ? a.trim() : a));
382
278
  }
383
279
  if (number) {
384
280
  args = rawArgs.map(shared.toNumber);
@@ -1270,7 +1166,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1270
1166
  };
1271
1167
  };
1272
1168
  // in SSR there is no need to setup an actual effect, and it should be noop
1273
- // unless it's eager
1169
+ // unless it's eager or sync flush
1170
+ let ssrCleanup;
1274
1171
  if (isInSSRComponentSetup) {
1275
1172
  // we will also not call the invalidate callback (+ runner is not set up)
1276
1173
  onCleanup = shared.NOOP;
@@ -1284,9 +1181,17 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1284
1181
  onCleanup
1285
1182
  ]);
1286
1183
  }
1287
- return shared.NOOP;
1184
+ if (flush === 'sync') {
1185
+ const ctx = useSSRContext();
1186
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
1187
+ }
1188
+ else {
1189
+ return shared.NOOP;
1190
+ }
1288
1191
  }
1289
- let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
1192
+ let oldValue = isMultiSource
1193
+ ? new Array(source.length).fill(INITIAL_WATCHER_VALUE)
1194
+ : INITIAL_WATCHER_VALUE;
1290
1195
  const job = () => {
1291
1196
  if (!effect.active) {
1292
1197
  return;
@@ -1307,7 +1212,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1307
1212
  callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
1308
1213
  newValue,
1309
1214
  // pass undefined as the old value when it's changed for the first time
1310
- oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
1215
+ oldValue === INITIAL_WATCHER_VALUE ||
1216
+ (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
1217
+ ? []
1218
+ : oldValue,
1311
1219
  onCleanup
1312
1220
  ]);
1313
1221
  oldValue = newValue;
@@ -1351,12 +1259,15 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1351
1259
  else {
1352
1260
  effect.run();
1353
1261
  }
1354
- return () => {
1262
+ const unwatch = () => {
1355
1263
  effect.stop();
1356
1264
  if (instance && instance.scope) {
1357
1265
  shared.remove(instance.scope.effects, effect);
1358
1266
  }
1359
1267
  };
1268
+ if (ssrCleanup)
1269
+ ssrCleanup.push(unwatch);
1270
+ return unwatch;
1360
1271
  }
1361
1272
  // this.$watch
1362
1273
  function instanceWatch(source, value, options) {
@@ -1524,7 +1435,11 @@ const BaseTransitionImpl = {
1524
1435
  // return placeholder node and queue update when leave finishes
1525
1436
  leavingHooks.afterLeave = () => {
1526
1437
  state.isLeaving = false;
1527
- instance.update();
1438
+ // #6835
1439
+ // it also needs to be updated when active is undefined
1440
+ if (instance.update.active !== false) {
1441
+ instance.update();
1442
+ }
1528
1443
  };
1529
1444
  return emptyPlaceholder(child);
1530
1445
  }
@@ -2029,7 +1944,8 @@ const KeepAliveImpl = {
2029
1944
  : comp);
2030
1945
  const { include, exclude, max } = props;
2031
1946
  if ((include && (!name || !matches(include, name))) ||
2032
- (exclude && name && matches(exclude, name))) {
1947
+ (exclude && name && matches(exclude, name)) ||
1948
+ (false )) {
2033
1949
  current = vnode;
2034
1950
  return rawVNode;
2035
1951
  }
@@ -2226,23 +2142,25 @@ function withDirectives(vnode, directives) {
2226
2142
  const bindings = vnode.dirs || (vnode.dirs = []);
2227
2143
  for (let i = 0; i < directives.length; i++) {
2228
2144
  let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i];
2229
- if (shared.isFunction(dir)) {
2230
- dir = {
2231
- mounted: dir,
2232
- updated: dir
2233
- };
2234
- }
2235
- if (dir.deep) {
2236
- traverse(value);
2145
+ if (dir) {
2146
+ if (shared.isFunction(dir)) {
2147
+ dir = {
2148
+ mounted: dir,
2149
+ updated: dir
2150
+ };
2151
+ }
2152
+ if (dir.deep) {
2153
+ traverse(value);
2154
+ }
2155
+ bindings.push({
2156
+ dir,
2157
+ instance,
2158
+ value,
2159
+ oldValue: void 0,
2160
+ arg,
2161
+ modifiers
2162
+ });
2237
2163
  }
2238
- bindings.push({
2239
- dir,
2240
- instance,
2241
- value,
2242
- oldValue: void 0,
2243
- arg,
2244
- modifiers
2245
- });
2246
2164
  }
2247
2165
  return vnode;
2248
2166
  }
@@ -3218,7 +3136,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
3218
3136
  if (validatePropName(normalizedKey)) {
3219
3137
  const opt = raw[key];
3220
3138
  const prop = (normalized[normalizedKey] =
3221
- shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : opt);
3139
+ shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : { ...opt });
3222
3140
  if (prop) {
3223
3141
  const booleanIndex = getTypeIndex(Boolean, prop.type);
3224
3142
  const stringIndex = getTypeIndex(String, prop.type);
@@ -5951,41 +5869,18 @@ function getExposeProxy(instance) {
5951
5869
  else if (key in publicPropertiesMap) {
5952
5870
  return publicPropertiesMap[key](instance);
5953
5871
  }
5872
+ },
5873
+ has(target, key) {
5874
+ return key in target || key in publicPropertiesMap;
5954
5875
  }
5955
5876
  })));
5956
5877
  }
5957
5878
  }
5958
- const classifyRE = /(?:^|[-_])(\w)/g;
5959
- const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
5960
5879
  function getComponentName(Component, includeInferred = true) {
5961
5880
  return shared.isFunction(Component)
5962
5881
  ? Component.displayName || Component.name
5963
5882
  : Component.name || (includeInferred && Component.__name);
5964
5883
  }
5965
- /* istanbul ignore next */
5966
- function formatComponentName(instance, Component, isRoot = false) {
5967
- let name = getComponentName(Component);
5968
- if (!name && Component.__file) {
5969
- const match = Component.__file.match(/([^/\\]+)\.\w+$/);
5970
- if (match) {
5971
- name = match[1];
5972
- }
5973
- }
5974
- if (!name && instance && instance.parent) {
5975
- // try to infer the name based on reverse resolution
5976
- const inferFromRegistry = (registry) => {
5977
- for (const key in registry) {
5978
- if (registry[key] === Component) {
5979
- return key;
5980
- }
5981
- }
5982
- };
5983
- name =
5984
- inferFromRegistry(instance.components ||
5985
- instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
5986
- }
5987
- return name ? classify(name) : isRoot ? `App` : `Anonymous`;
5988
- }
5989
5884
  function isClassComponent(value) {
5990
5885
  return shared.isFunction(value) && '__vccOpts' in value;
5991
5886
  }
@@ -6154,10 +6049,6 @@ const ssrContextKey = Symbol(``);
6154
6049
  const useSSRContext = () => {
6155
6050
  {
6156
6051
  const ctx = inject(ssrContextKey);
6157
- if (!ctx) {
6158
- warn(`Server rendering context not provided. Make sure to only call ` +
6159
- `useSSRContext() conditionally in the server build.`);
6160
- }
6161
6052
  return ctx;
6162
6053
  }
6163
6054
  };
@@ -6197,7 +6088,7 @@ function isMemoSame(cached, memo) {
6197
6088
  }
6198
6089
 
6199
6090
  // Core API ------------------------------------------------------------------
6200
- const version = "3.2.41";
6091
+ const version = "3.2.43";
6201
6092
  const _ssrUtils = {
6202
6093
  createComponentInstance,
6203
6094
  setupComponent,
@@ -29,6 +29,7 @@ import { normalizeProps } from '@vue/shared';
29
29
  import { normalizeStyle } from '@vue/shared';
30
30
  import { onScopeDispose } from '@vue/reactivity';
31
31
  import { proxyRefs } from '@vue/reactivity';
32
+ import { Raw } from '@vue/reactivity';
32
33
  import { reactive } from '@vue/reactivity';
33
34
  import { ReactiveEffect } from '@vue/reactivity';
34
35
  import { ReactiveEffectOptions } from '@vue/reactivity';
@@ -101,7 +102,7 @@ export declare interface AppConfig {
101
102
  readonly isNativeTag?: (tag: string) => boolean;
102
103
  performance: boolean;
103
104
  optionMergeStrategies: Record<string, OptionMergeFunction>;
104
- globalProperties: Record<string, any>;
105
+ globalProperties: ComponentCustomProperties & Record<string, any>;
105
106
  errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
106
107
  warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
107
108
  /**
@@ -324,7 +325,7 @@ export declare interface ComponentCustomProperties {
324
325
  export declare interface ComponentCustomProps {
325
326
  }
326
327
 
327
- declare type ComponentInjectOptions = string[] | ObjectInjectOptions;
328
+ export declare type ComponentInjectOptions = string[] | ObjectInjectOptions;
328
329
 
329
330
  /**
330
331
  * We expose a subset of properties on the internal instance as they are
@@ -444,7 +445,7 @@ export declare type ComponentObjectPropsOptions<P = Data> = {
444
445
 
445
446
  export declare type ComponentOptions<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = any, M extends MethodOptions = any, Mixin extends ComponentOptionsMixin = any, Extends extends ComponentOptionsMixin = any, E extends EmitsOptions = any> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E> & ThisType<CreateComponentPublicInstance<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>>>;
446
447
 
447
- export declare interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string, Defaults = {}> extends LegacyOptions<Props, D, C, M, Mixin, Extends>, ComponentInternalOptions, ComponentCustomOptions {
448
+ export declare interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string> extends LegacyOptions<Props, D, C, M, Mixin, Extends, I, II>, ComponentInternalOptions, ComponentCustomOptions {
448
449
  setup?: (this: void, props: Readonly<LooseRequired<Props & UnionToIntersection<ExtractOptionProp<Mixin>> & UnionToIntersection<ExtractOptionProp<Extends>>>>, ctx: SetupContext<E>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
449
450
  name?: string;
450
451
  template?: string | object;
@@ -469,19 +470,19 @@ export declare interface ComponentOptionsBase<Props, RawBindings, D, C extends C
469
470
 
470
471
  export declare type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>;
471
472
 
472
- export declare type ComponentOptionsWithArrayProps<PropNames extends string = string, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, Props = Readonly<{
473
+ export declare type ComponentOptionsWithArrayProps<PropNames extends string = string, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, Props = Readonly<{
473
474
  [key in PropNames]?: any;
474
- }> & EmitsToProps<E>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}> & {
475
+ }> & EmitsToProps<E>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II> & {
475
476
  props: PropNames[];
476
- } & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E>>;
477
+ } & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, {}, false, I>>;
477
478
 
478
- export declare type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsOptions, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, Props = Readonly<ExtractPropTypes<PropsOptions>> & EmitsToProps<E>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults> & {
479
+ export declare type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsOptions, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, Props = Readonly<ExtractPropTypes<PropsOptions>> & EmitsToProps<E>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II> & {
479
480
  props: PropsOptions & ThisType<void>;
480
- } & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false>>;
481
+ } & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false, I>>;
481
482
 
482
- export declare type ComponentOptionsWithoutProps<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, PE = Props & EmitsToProps<E>> = ComponentOptionsBase<PE, RawBindings, D, C, M, Mixin, Extends, E, EE, {}> & {
483
+ export declare type ComponentOptionsWithoutProps<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, PE = Props & EmitsToProps<E>> = ComponentOptionsBase<PE, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II> & {
483
484
  props?: undefined;
484
- } & ThisType<CreateComponentPublicInstance<PE, RawBindings, D, C, M, Mixin, Extends, E>>;
485
+ } & ThisType<CreateComponentPublicInstance<PE, RawBindings, D, C, M, Mixin, Extends, E, PE, {}, false, I>>;
485
486
 
486
487
  export declare type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
487
488
 
@@ -490,7 +491,7 @@ export declare type ComponentProvideOptions = ObjectProvideOptions | Function;
490
491
  export declare type ComponentPublicInstance<P = {}, // props type extracted from props option
491
492
  B = {}, // raw bindings returned from setup()
492
493
  D = {}, // return from data()
493
- C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>> = {
494
+ C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}> = {
494
495
  $: ComponentInternalInstance;
495
496
  $data: D;
496
497
  $props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps;
@@ -504,8 +505,8 @@ C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOpt
504
505
  $options: Options & MergedComponentOptionsOverride;
505
506
  $forceUpdate: () => void;
506
507
  $nextTick: typeof nextTick;
507
- $watch(source: string | Function, cb: Function, options?: WatchOptions): WatchStopHandle;
508
- } & P & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties;
508
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R]) => any : (...args: any) => any, options?: WatchOptions): WatchStopHandle;
509
+ } & P & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>;
509
510
 
510
511
  declare type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props, RawBindings, D, C, M> = ComponentPublicInstance<any>, Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = {
511
512
  __isFragment?: never;
@@ -567,7 +568,7 @@ declare function createCompatVue(createApp: CreateAppFunction<Element>, createSi
567
568
 
568
569
  declare function createComponentInstance(vnode: VNode, parent: ComponentInternalInstance | null, suspense: SuspenseBoundary | null): ComponentInternalInstance;
569
570
 
570
- export declare type CreateComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults>>;
571
+ export declare type CreateComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults>, I>;
571
572
 
572
573
  /**
573
574
  * @private
@@ -662,13 +663,13 @@ export declare type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D
662
663
 
663
664
  export declare function defineComponent<Props, RawBindings = object>(setup: (props: Readonly<Props>, ctx: SetupContext) => RawBindings | RenderFunction): DefineComponent<Props, RawBindings>;
664
665
 
665
- export declare function defineComponent<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>;
666
+ export declare function defineComponent<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>;
666
667
 
667
- export declare function defineComponent<PropNames extends string, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<Readonly<{
668
+ export declare function defineComponent<PropNames extends string, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II>): DefineComponent<Readonly<{
668
669
  [key in PropNames]?: any;
669
670
  }>, RawBindings, D, C, M, Mixin, Extends, E, EE>;
670
671
 
671
- export declare function defineComponent<PropsOptions extends Readonly<ComponentPropsOptions>, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>;
672
+ export declare function defineComponent<PropsOptions extends Readonly<ComponentPropsOptions>, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>;
672
673
 
673
674
  /**
674
675
  * Vue `<script setup>` compiler macro for declaring a component's emitted
@@ -814,7 +815,7 @@ declare interface DevtoolsHook {
814
815
 
815
816
  export declare type Directive<T = any, V = any> = ObjectDirective<T, V> | FunctionDirective<T, V>;
816
817
 
817
- export declare type DirectiveArguments = Array<[Directive] | [Directive, any] | [Directive, any, string] | [Directive, any, string, DirectiveModifiers]>;
818
+ export declare type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string, DirectiveModifiers]>;
818
819
 
819
820
  export declare interface DirectiveBinding<V = any> {
820
821
  instance: ComponentPublicInstance | null;
@@ -954,7 +955,7 @@ export declare function h<P>(type: ConcreteComponent | string, children?: RawChi
954
955
 
955
956
  export declare function h<P>(type: ConcreteComponent<P> | string, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren): VNode;
956
957
 
957
- export declare function h(type: Component, props: null, children?: RawChildren | RawSlots): VNode;
958
+ export declare function h<P>(type: Component<P>, props?: (RawProps & P) | null, children?: RawChildren | RawSlots): VNode;
958
959
 
959
960
  export declare function h<P>(type: ComponentOptions<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
960
961
 
@@ -1015,6 +1016,12 @@ export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T
1015
1016
  export declare interface InjectionKey<T> extends Symbol {
1016
1017
  }
1017
1018
 
1019
+ declare type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? {
1020
+ [K in T[number]]?: unknown;
1021
+ } : T extends ObjectInjectOptions ? {
1022
+ [K in keyof T]?: unknown;
1023
+ } : never;
1024
+
1018
1025
  /* Excluded from this release type: InternalRenderFunction */
1019
1026
 
1020
1027
  declare type InternalSlots = {
@@ -1083,7 +1090,7 @@ export declare type LegacyConfig = {
1083
1090
  productionTip?: boolean;
1084
1091
  };
1085
1092
 
1086
- declare interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin> {
1093
+ declare interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, I extends ComponentInjectOptions, II extends string> {
1087
1094
  compatConfig?: CompatConfig;
1088
1095
  [key: string]: any;
1089
1096
  data?: (this: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
@@ -1091,7 +1098,7 @@ declare interface LegacyOptions<Props, D, C extends ComputedOptions, M extends M
1091
1098
  methods?: M;
1092
1099
  watch?: ComponentWatchOptions;
1093
1100
  provide?: ComponentProvideOptions;
1094
- inject?: ComponentInjectOptions;
1101
+ inject?: I | II[];
1095
1102
  filters?: Record<string, Function>;
1096
1103
  mixins?: Mixin[];
1097
1104
  extends?: Extends;
@@ -1380,7 +1387,7 @@ declare interface PropOptions<T = any, D = T> {
1380
1387
  }
1381
1388
 
1382
1389
  declare type PropsWithDefaults<Base, Defaults> = Base & {
1383
- [K in keyof Defaults]: K extends keyof Base ? NotUndefined<Base[K]> : never;
1390
+ [K in keyof Defaults]: K extends keyof Base ? Defaults[K] extends undefined ? Base[K] : NotUndefined<Base[K]> : never;
1384
1391
  };
1385
1392
 
1386
1393
  export declare type PropType<T> = PropConstructor<T> | PropConstructor<T>[];
@@ -1399,6 +1406,8 @@ export declare function pushScopeId(id: string | null): void;
1399
1406
 
1400
1407
  export declare function queuePostFlushCb(cb: SchedulerJobs): void;
1401
1408
 
1409
+ export { Raw }
1410
+
1402
1411
  declare type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
1403
1412
 
1404
1413
  declare type RawProps = VNodeProps & {
@@ -1907,7 +1916,7 @@ export declare type VNodeProps = {
1907
1916
 
1908
1917
  export declare type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
1909
1918
 
1910
- export declare type VNodeTypes = string | VNode | Component | typeof Text_2 | typeof Static | typeof Comment_2 | typeof Fragment | typeof TeleportImpl | typeof SuspenseImpl;
1919
+ export declare type VNodeTypes = string | VNode | Component | typeof Text_2 | typeof Static | typeof Comment_2 | typeof Fragment | typeof Teleport | typeof TeleportImpl | typeof Suspense | typeof SuspenseImpl;
1911
1920
 
1912
1921
  declare type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
1913
1922
 
@@ -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();
@@ -686,7 +688,7 @@ function emit$1(instance, event, ...rawArgs) {
686
688
  const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`;
687
689
  const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
688
690
  if (trim) {
689
- args = rawArgs.map(a => a.trim());
691
+ args = rawArgs.map(a => (isString(a) ? a.trim() : a));
690
692
  }
691
693
  if (number) {
692
694
  args = rawArgs.map(toNumber);
@@ -1752,7 +1754,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
1752
1754
  };
1753
1755
  };
1754
1756
  // in SSR there is no need to setup an actual effect, and it should be noop
1755
- // unless it's eager
1757
+ // unless it's eager or sync flush
1758
+ let ssrCleanup;
1756
1759
  if (isInSSRComponentSetup) {
1757
1760
  // we will also not call the invalidate callback (+ runner is not set up)
1758
1761
  onCleanup = NOOP;
@@ -1766,9 +1769,17 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
1766
1769
  onCleanup
1767
1770
  ]);
1768
1771
  }
1769
- return NOOP;
1772
+ if (flush === 'sync') {
1773
+ const ctx = useSSRContext();
1774
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
1775
+ }
1776
+ else {
1777
+ return NOOP;
1778
+ }
1770
1779
  }
1771
- let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
1780
+ let oldValue = isMultiSource
1781
+ ? new Array(source.length).fill(INITIAL_WATCHER_VALUE)
1782
+ : INITIAL_WATCHER_VALUE;
1772
1783
  const job = () => {
1773
1784
  if (!effect.active) {
1774
1785
  return;
@@ -1789,7 +1800,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
1789
1800
  callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
1790
1801
  newValue,
1791
1802
  // pass undefined as the old value when it's changed for the first time
1792
- oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
1803
+ oldValue === INITIAL_WATCHER_VALUE ||
1804
+ (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
1805
+ ? []
1806
+ : oldValue,
1793
1807
  onCleanup
1794
1808
  ]);
1795
1809
  oldValue = newValue;
@@ -1837,12 +1851,15 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
1837
1851
  else {
1838
1852
  effect.run();
1839
1853
  }
1840
- return () => {
1854
+ const unwatch = () => {
1841
1855
  effect.stop();
1842
1856
  if (instance && instance.scope) {
1843
1857
  remove(instance.scope.effects, effect);
1844
1858
  }
1845
1859
  };
1860
+ if (ssrCleanup)
1861
+ ssrCleanup.push(unwatch);
1862
+ return unwatch;
1846
1863
  }
1847
1864
  // this.$watch
1848
1865
  function instanceWatch(source, value, options) {
@@ -2027,7 +2044,11 @@ const BaseTransitionImpl = {
2027
2044
  // return placeholder node and queue update when leave finishes
2028
2045
  leavingHooks.afterLeave = () => {
2029
2046
  state.isLeaving = false;
2030
- instance.update();
2047
+ // #6835
2048
+ // it also needs to be updated when active is undefined
2049
+ if (instance.update.active !== false) {
2050
+ instance.update();
2051
+ }
2031
2052
  };
2032
2053
  return emptyPlaceholder(child);
2033
2054
  }
@@ -2553,7 +2574,8 @@ const KeepAliveImpl = {
2553
2574
  : comp);
2554
2575
  const { include, exclude, max } = props;
2555
2576
  if ((include && (!name || !matches(include, name))) ||
2556
- (exclude && name && matches(exclude, name))) {
2577
+ (exclude && name && matches(exclude, name)) ||
2578
+ ((process.env.NODE_ENV !== 'production') && hmrDirtyComponents.has(comp))) {
2557
2579
  current = vnode;
2558
2580
  return rawVNode;
2559
2581
  }
@@ -2765,23 +2787,25 @@ function withDirectives(vnode, directives) {
2765
2787
  const bindings = vnode.dirs || (vnode.dirs = []);
2766
2788
  for (let i = 0; i < directives.length; i++) {
2767
2789
  let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
2768
- if (isFunction(dir)) {
2769
- dir = {
2770
- mounted: dir,
2771
- updated: dir
2772
- };
2773
- }
2774
- if (dir.deep) {
2775
- traverse(value);
2790
+ if (dir) {
2791
+ if (isFunction(dir)) {
2792
+ dir = {
2793
+ mounted: dir,
2794
+ updated: dir
2795
+ };
2796
+ }
2797
+ if (dir.deep) {
2798
+ traverse(value);
2799
+ }
2800
+ bindings.push({
2801
+ dir,
2802
+ instance,
2803
+ value,
2804
+ oldValue: void 0,
2805
+ arg,
2806
+ modifiers
2807
+ });
2776
2808
  }
2777
- bindings.push({
2778
- dir,
2779
- instance,
2780
- value,
2781
- oldValue: void 0,
2782
- arg,
2783
- modifiers
2784
- });
2785
2809
  }
2786
2810
  return vnode;
2787
2811
  }
@@ -4003,7 +4027,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
4003
4027
  if (validatePropName(normalizedKey)) {
4004
4028
  const opt = raw[key];
4005
4029
  const prop = (normalized[normalizedKey] =
4006
- isArray(opt) || isFunction(opt) ? { type: opt } : opt);
4030
+ isArray(opt) || isFunction(opt) ? { type: opt } : Object.assign({}, opt));
4007
4031
  if (prop) {
4008
4032
  const booleanIndex = getTypeIndex(Boolean, prop.type);
4009
4033
  const stringIndex = getTypeIndex(String, prop.type);
@@ -7412,6 +7436,9 @@ function getExposeProxy(instance) {
7412
7436
  else if (key in publicPropertiesMap) {
7413
7437
  return publicPropertiesMap[key](instance);
7414
7438
  }
7439
+ },
7440
+ has(target, key) {
7441
+ return key in target || key in publicPropertiesMap;
7415
7442
  }
7416
7443
  })));
7417
7444
  }
@@ -7641,8 +7668,9 @@ const useSSRContext = () => {
7641
7668
  {
7642
7669
  const ctx = inject(ssrContextKey);
7643
7670
  if (!ctx) {
7644
- warn(`Server rendering context not provided. Make sure to only call ` +
7645
- `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.`);
7646
7674
  }
7647
7675
  return ctx;
7648
7676
  }
@@ -7869,7 +7897,7 @@ function isMemoSame(cached, memo) {
7869
7897
  }
7870
7898
 
7871
7899
  // Core API ------------------------------------------------------------------
7872
- const version = "3.2.41";
7900
+ const version = "3.2.43";
7873
7901
  const _ssrUtils = {
7874
7902
  createComponentInstance,
7875
7903
  setupComponent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.2.41",
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.41",
36
- "@vue/reactivity": "3.2.41"
35
+ "@vue/shared": "3.2.43",
36
+ "@vue/reactivity": "3.2.43"
37
37
  }
38
38
  }