@vue/runtime-core 3.4.35 → 3.4.37

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/README.md CHANGED
@@ -13,7 +13,7 @@ const { render, createApp } = createRenderer({
13
13
  patchProp,
14
14
  insert,
15
15
  remove,
16
- createElement
16
+ createElement,
17
17
  // ...
18
18
  })
19
19
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.4.35
2
+ * @vue/runtime-core v3.4.37
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1357,7 +1357,7 @@ const KeepAliveImpl = {
1357
1357
  }
1358
1358
  function pruneCacheEntry(key) {
1359
1359
  const cached = cache.get(key);
1360
- if (!current || !isSameVNodeType(cached, current)) {
1360
+ if (cached && (!current || !isSameVNodeType(cached, current))) {
1361
1361
  unmount(cached);
1362
1362
  } else if (current) {
1363
1363
  resetShapeFlag(current);
@@ -1419,6 +1419,10 @@ const KeepAliveImpl = {
1419
1419
  return rawVNode;
1420
1420
  }
1421
1421
  let vnode = getInnerChild(rawVNode);
1422
+ if (vnode.type === Comment) {
1423
+ current = null;
1424
+ return vnode;
1425
+ }
1422
1426
  const comp = vnode.type;
1423
1427
  const name = getComponentName(
1424
1428
  isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
@@ -2711,7 +2715,7 @@ function provide(key, value) {
2711
2715
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
2712
2716
  const instance = currentInstance || currentRenderingInstance;
2713
2717
  if (instance || currentApp) {
2714
- const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
2718
+ const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
2715
2719
  if (provides && key in provides) {
2716
2720
  return provides[key];
2717
2721
  } else if (arguments.length > 1) {
@@ -3905,6 +3909,7 @@ Server rendered element contains more child nodes than client vdom.`
3905
3909
  }
3906
3910
  if (props) {
3907
3911
  {
3912
+ const isCustomElement = el.tagName.includes("-");
3908
3913
  for (const key in props) {
3909
3914
  if (// #11189 skip if this node has directives that have created hooks
3910
3915
  // as it could have mutated the DOM in any possible way
@@ -3912,7 +3917,7 @@ Server rendered element contains more child nodes than client vdom.`
3912
3917
  logMismatchError();
3913
3918
  }
3914
3919
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
3915
- key[0] === ".") {
3920
+ key[0] === "." || isCustomElement) {
3916
3921
  patchProp(el, key, null, props[key], void 0, parentComponent);
3917
3922
  }
3918
3923
  }
@@ -5610,13 +5615,13 @@ function baseCreateRenderer(options, createHydrationFns) {
5610
5615
  namespace
5611
5616
  );
5612
5617
  }
5618
+ container._vnode = vnode;
5613
5619
  if (!isFlushing) {
5614
5620
  isFlushing = true;
5615
5621
  flushPreFlushCbs();
5616
5622
  flushPostFlushCbs();
5617
5623
  isFlushing = false;
5618
5624
  }
5619
- container._vnode = vnode;
5620
5625
  };
5621
5626
  const internals = {
5622
5627
  p: patch,
@@ -6044,7 +6049,8 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
6044
6049
  return options.get ? options.get(localValue) : localValue;
6045
6050
  },
6046
6051
  set(value) {
6047
- if (!shared.hasChanged(value, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
6052
+ const emittedValue = options.set ? options.set(value) : value;
6053
+ if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
6048
6054
  return;
6049
6055
  }
6050
6056
  const rawProps = i.vnode.props;
@@ -6053,7 +6059,6 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
6053
6059
  localValue = value;
6054
6060
  trigger();
6055
6061
  }
6056
- const emittedValue = options.set ? options.set(value) : value;
6057
6062
  i.emit(`update:${name}`, emittedValue);
6058
6063
  if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) {
6059
6064
  trigger();
@@ -6091,9 +6096,9 @@ function emit(instance, event, ...rawArgs) {
6091
6096
  } = instance;
6092
6097
  if (emitsOptions) {
6093
6098
  if (!(event in emitsOptions) && true) {
6094
- if (!propsOptions || !(shared.toHandlerKey(event) in propsOptions)) {
6099
+ if (!propsOptions || !(shared.toHandlerKey(shared.camelize(event)) in propsOptions)) {
6095
6100
  warn$1(
6096
- `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${shared.toHandlerKey(event)}" prop.`
6101
+ `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${shared.toHandlerKey(shared.camelize(event))}" prop.`
6097
6102
  );
6098
6103
  }
6099
6104
  } else {
@@ -8133,7 +8138,7 @@ function isMemoSame(cached, memo) {
8133
8138
  return true;
8134
8139
  }
8135
8140
 
8136
- const version = "3.4.35";
8141
+ const version = "3.4.37";
8137
8142
  const warn = warn$1 ;
8138
8143
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8139
8144
  const devtools = devtools$1 ;
@@ -8145,7 +8150,8 @@ const _ssrUtils = {
8145
8150
  setCurrentRenderingInstance,
8146
8151
  isVNode: isVNode,
8147
8152
  normalizeVNode,
8148
- getComponentPublicInstance
8153
+ getComponentPublicInstance,
8154
+ ensureValidVNode
8149
8155
  };
8150
8156
  const ssrUtils = _ssrUtils ;
8151
8157
  const resolveFilter = null;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.4.35
2
+ * @vue/runtime-core v3.4.37
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -928,7 +928,7 @@ const KeepAliveImpl = {
928
928
  }
929
929
  function pruneCacheEntry(key) {
930
930
  const cached = cache.get(key);
931
- if (!current || !isSameVNodeType(cached, current)) {
931
+ if (cached && (!current || !isSameVNodeType(cached, current))) {
932
932
  unmount(cached);
933
933
  } else if (current) {
934
934
  resetShapeFlag(current);
@@ -987,6 +987,10 @@ const KeepAliveImpl = {
987
987
  return rawVNode;
988
988
  }
989
989
  let vnode = getInnerChild(rawVNode);
990
+ if (vnode.type === Comment) {
991
+ current = null;
992
+ return vnode;
993
+ }
990
994
  const comp = vnode.type;
991
995
  const name = getComponentName(
992
996
  isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
@@ -1968,7 +1972,7 @@ function provide(key, value) {
1968
1972
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
1969
1973
  const instance = currentInstance || currentRenderingInstance;
1970
1974
  if (instance || currentApp) {
1971
- const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
1975
+ const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
1972
1976
  if (provides && key in provides) {
1973
1977
  return provides[key];
1974
1978
  } else if (arguments.length > 1) {
@@ -2939,9 +2943,10 @@ function createHydrationFunctions(rendererInternals) {
2939
2943
  }
2940
2944
  if (props) {
2941
2945
  if (forcePatch || !optimized || patchFlag & (16 | 32)) {
2946
+ const isCustomElement = el.tagName.includes("-");
2942
2947
  for (const key in props) {
2943
2948
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
2944
- key[0] === ".") {
2949
+ key[0] === "." || isCustomElement) {
2945
2950
  patchProp(el, key, null, props[key], void 0, parentComponent);
2946
2951
  }
2947
2952
  }
@@ -4343,13 +4348,13 @@ function baseCreateRenderer(options, createHydrationFns) {
4343
4348
  namespace
4344
4349
  );
4345
4350
  }
4351
+ container._vnode = vnode;
4346
4352
  if (!isFlushing) {
4347
4353
  isFlushing = true;
4348
4354
  flushPreFlushCbs();
4349
4355
  flushPostFlushCbs();
4350
4356
  isFlushing = false;
4351
4357
  }
4352
- container._vnode = vnode;
4353
4358
  };
4354
4359
  const internals = {
4355
4360
  p: patch,
@@ -4720,7 +4725,8 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
4720
4725
  return options.get ? options.get(localValue) : localValue;
4721
4726
  },
4722
4727
  set(value) {
4723
- if (!shared.hasChanged(value, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
4728
+ const emittedValue = options.set ? options.set(value) : value;
4729
+ if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
4724
4730
  return;
4725
4731
  }
4726
4732
  const rawProps = i.vnode.props;
@@ -4729,7 +4735,6 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
4729
4735
  localValue = value;
4730
4736
  trigger();
4731
4737
  }
4732
- const emittedValue = options.set ? options.set(value) : value;
4733
4738
  i.emit(`update:${name}`, emittedValue);
4734
4739
  if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) {
4735
4740
  trigger();
@@ -6305,7 +6310,7 @@ function isMemoSame(cached, memo) {
6305
6310
  return true;
6306
6311
  }
6307
6312
 
6308
- const version = "3.4.35";
6313
+ const version = "3.4.37";
6309
6314
  const warn$1 = shared.NOOP;
6310
6315
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6311
6316
  const devtools = void 0;
@@ -6317,7 +6322,8 @@ const _ssrUtils = {
6317
6322
  setCurrentRenderingInstance,
6318
6323
  isVNode: isVNode,
6319
6324
  normalizeVNode,
6320
- getComponentPublicInstance
6325
+ getComponentPublicInstance,
6326
+ ensureValidVNode
6321
6327
  };
6322
6328
  const ssrUtils = _ssrUtils ;
6323
6329
  const resolveFilter = null;
@@ -507,7 +507,7 @@ export interface ObjectDirective<T = any, V = any> {
507
507
  export type FunctionDirective<T = any, V = any> = DirectiveHook<T, any, V>;
508
508
  export type Directive<T = any, V = any> = ObjectDirective<T, V> | FunctionDirective<T, V>;
509
509
  type DirectiveModifiers = Record<string, boolean>;
510
- export type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string, DirectiveModifiers]>;
510
+ export type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string | undefined, DirectiveModifiers]>;
511
511
  /**
512
512
  * Adds directives to a VNode.
513
513
  */
@@ -1146,7 +1146,7 @@ export declare function registerRuntimeCompiler(_compile: any): void;
1146
1146
  export declare const isRuntimeOnly: () => boolean;
1147
1147
 
1148
1148
  export type WatchEffect = (onCleanup: OnCleanup) => void;
1149
- export type WatchSource<T = any> = Ref<T, any> | ComputedRef<T> | (() => T);
1149
+ export type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
1150
1150
  export type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
1151
1151
  type MaybeUndefined<T, I> = I extends true ? T | undefined : T;
1152
1152
  type MapSources<T, Immediate> = {
@@ -1356,7 +1356,7 @@ type InferDefaults<T> = {
1356
1356
  type NativeType = null | number | string | boolean | symbol | Function;
1357
1357
  type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
1358
1358
  type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Readonly<MappedOmit<T, keyof Defaults>> & {
1359
- readonly [K in keyof Defaults]-?: K extends keyof T ? Defaults[K] extends undefined ? T[K] : NotUndefined<T[K]> : never;
1359
+ readonly [K in keyof Defaults]-?: K extends keyof T ? Defaults[K] extends undefined ? IfAny<Defaults[K], NotUndefined<T[K]>, T[K]> : NotUndefined<T[K]> : never;
1360
1360
  } & {
1361
1361
  readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean;
1362
1362
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.4.35
2
+ * @vue/runtime-core v3.4.37
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1359,7 +1359,7 @@ const KeepAliveImpl = {
1359
1359
  }
1360
1360
  function pruneCacheEntry(key) {
1361
1361
  const cached = cache.get(key);
1362
- if (!current || !isSameVNodeType(cached, current)) {
1362
+ if (cached && (!current || !isSameVNodeType(cached, current))) {
1363
1363
  unmount(cached);
1364
1364
  } else if (current) {
1365
1365
  resetShapeFlag(current);
@@ -1421,6 +1421,10 @@ const KeepAliveImpl = {
1421
1421
  return rawVNode;
1422
1422
  }
1423
1423
  let vnode = getInnerChild(rawVNode);
1424
+ if (vnode.type === Comment) {
1425
+ current = null;
1426
+ return vnode;
1427
+ }
1424
1428
  const comp = vnode.type;
1425
1429
  const name = getComponentName(
1426
1430
  isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
@@ -2717,7 +2721,7 @@ function provide(key, value) {
2717
2721
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
2718
2722
  const instance = currentInstance || currentRenderingInstance;
2719
2723
  if (instance || currentApp) {
2720
- const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
2724
+ const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
2721
2725
  if (provides && key in provides) {
2722
2726
  return provides[key];
2723
2727
  } else if (arguments.length > 1) {
@@ -3911,6 +3915,7 @@ Server rendered element contains more child nodes than client vdom.`
3911
3915
  }
3912
3916
  if (props) {
3913
3917
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {
3918
+ const isCustomElement = el.tagName.includes("-");
3914
3919
  for (const key in props) {
3915
3920
  if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks
3916
3921
  // as it could have mutated the DOM in any possible way
@@ -3918,7 +3923,7 @@ Server rendered element contains more child nodes than client vdom.`
3918
3923
  logMismatchError();
3919
3924
  }
3920
3925
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
3921
- key[0] === ".") {
3926
+ key[0] === "." || isCustomElement) {
3922
3927
  patchProp(el, key, null, props[key], void 0, parentComponent);
3923
3928
  }
3924
3929
  }
@@ -5665,13 +5670,13 @@ function baseCreateRenderer(options, createHydrationFns) {
5665
5670
  namespace
5666
5671
  );
5667
5672
  }
5673
+ container._vnode = vnode;
5668
5674
  if (!isFlushing) {
5669
5675
  isFlushing = true;
5670
5676
  flushPreFlushCbs();
5671
5677
  flushPostFlushCbs();
5672
5678
  isFlushing = false;
5673
5679
  }
5674
- container._vnode = vnode;
5675
5680
  };
5676
5681
  const internals = {
5677
5682
  p: patch,
@@ -6099,7 +6104,8 @@ function useModel(props, name, options = EMPTY_OBJ) {
6099
6104
  return options.get ? options.get(localValue) : localValue;
6100
6105
  },
6101
6106
  set(value) {
6102
- if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
6107
+ const emittedValue = options.set ? options.set(value) : value;
6108
+ if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
6103
6109
  return;
6104
6110
  }
6105
6111
  const rawProps = i.vnode.props;
@@ -6108,7 +6114,6 @@ function useModel(props, name, options = EMPTY_OBJ) {
6108
6114
  localValue = value;
6109
6115
  trigger();
6110
6116
  }
6111
- const emittedValue = options.set ? options.set(value) : value;
6112
6117
  i.emit(`update:${name}`, emittedValue);
6113
6118
  if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
6114
6119
  trigger();
@@ -6146,9 +6151,9 @@ function emit(instance, event, ...rawArgs) {
6146
6151
  } = instance;
6147
6152
  if (emitsOptions) {
6148
6153
  if (!(event in emitsOptions) && true) {
6149
- if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
6154
+ if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
6150
6155
  warn$1(
6151
- `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
6156
+ `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
6152
6157
  );
6153
6158
  }
6154
6159
  } else {
@@ -8202,7 +8207,7 @@ function isMemoSame(cached, memo) {
8202
8207
  return true;
8203
8208
  }
8204
8209
 
8205
- const version = "3.4.35";
8210
+ const version = "3.4.37";
8206
8211
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8207
8212
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8208
8213
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -8214,7 +8219,8 @@ const _ssrUtils = {
8214
8219
  setCurrentRenderingInstance,
8215
8220
  isVNode: isVNode,
8216
8221
  normalizeVNode,
8217
- getComponentPublicInstance
8222
+ getComponentPublicInstance,
8223
+ ensureValidVNode
8218
8224
  };
8219
8225
  const ssrUtils = _ssrUtils ;
8220
8226
  const resolveFilter = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.4.35",
3
+ "version": "3.4.37",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
48
48
  "dependencies": {
49
- "@vue/shared": "3.4.35",
50
- "@vue/reactivity": "3.4.35"
49
+ "@vue/shared": "3.4.37",
50
+ "@vue/reactivity": "3.4.37"
51
51
  }
52
52
  }