@vue/runtime-core 3.2.34 → 3.2.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.
@@ -581,6 +581,7 @@ function emit(event, ...args) {
581
581
  }
582
582
  }
583
583
  function setDevtoolsHook(hook, target) {
584
+ var _a, _b;
584
585
  exports.devtools = hook;
585
586
  if (exports.devtools) {
586
587
  exports.devtools.enabled = true;
@@ -595,7 +596,7 @@ function setDevtoolsHook(hook, target) {
595
596
  // some envs mock window but not fully
596
597
  window.HTMLElement &&
597
598
  // also exclude jsdom
598
- !window.navigator?.userAgent?.includes('jsdom')) {
599
+ !((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
599
600
  const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
600
601
  target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
601
602
  replay.push((newHook) => {
@@ -2822,7 +2823,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
2822
2823
  const Component = instance.type;
2823
2824
  // explicit self name has highest priority
2824
2825
  if (type === COMPONENTS) {
2825
- const selfName = getComponentName(Component);
2826
+ const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
2826
2827
  if (selfName &&
2827
2828
  (selfName === name ||
2828
2829
  selfName === shared.camelize(name) ||
@@ -4493,7 +4494,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4493
4494
  setupState[ref] = value;
4494
4495
  }
4495
4496
  }
4496
- else if (reactivity.isRef(ref)) {
4497
+ else if (_isRef) {
4497
4498
  ref.value = value;
4498
4499
  if (rawRef.k)
4499
4500
  refs[rawRef.k] = value;
@@ -4532,11 +4533,13 @@ function createHydrationFunctions(rendererInternals) {
4532
4533
  `Performing full mount instead.`);
4533
4534
  patch(null, vnode, container);
4534
4535
  flushPostFlushCbs();
4536
+ container._vnode = vnode;
4535
4537
  return;
4536
4538
  }
4537
4539
  hasMismatch = false;
4538
4540
  hydrateNode(container.firstChild, vnode, null, null, null);
4539
4541
  flushPostFlushCbs();
4542
+ container._vnode = vnode;
4540
4543
  if (hasMismatch && !false) {
4541
4544
  // this error should show up in production
4542
4545
  console.error(`Hydration completed but contains mismatches.`);
@@ -4559,7 +4562,7 @@ function createHydrationFunctions(rendererInternals) {
4559
4562
  // #5728 empty text node inside a slot can cause hydration failure
4560
4563
  // because the server rendered HTML won't contain a text node
4561
4564
  if (vnode.children === '') {
4562
- insert((vnode.el = createText('')), node.parentElement, node);
4565
+ insert((vnode.el = createText('')), parentNode(node), node);
4563
4566
  nextNode = node;
4564
4567
  }
4565
4568
  else {
@@ -4586,7 +4589,7 @@ function createHydrationFunctions(rendererInternals) {
4586
4589
  }
4587
4590
  break;
4588
4591
  case Static:
4589
- if (domType !== 1 /* ELEMENT */) {
4592
+ if (domType !== 1 /* ELEMENT */ && domType !== 3 /* TEXT */) {
4590
4593
  nextNode = onMismatch();
4591
4594
  }
4592
4595
  else {
@@ -4597,7 +4600,10 @@ function createHydrationFunctions(rendererInternals) {
4597
4600
  const needToAdoptContent = !vnode.children.length;
4598
4601
  for (let i = 0; i < vnode.staticCount; i++) {
4599
4602
  if (needToAdoptContent)
4600
- vnode.children += nextNode.outerHTML;
4603
+ vnode.children +=
4604
+ nextNode.nodeType === 1 /* ELEMENT */
4605
+ ? nextNode.outerHTML
4606
+ : nextNode.data;
4601
4607
  if (i === vnode.staticCount - 1) {
4602
4608
  vnode.anchor = nextNode;
4603
4609
  }
@@ -7036,6 +7042,7 @@ function setupComponent(instance, isSSR = false) {
7036
7042
  return setupResult;
7037
7043
  }
7038
7044
  function setupStatefulComponent(instance, isSSR) {
7045
+ var _a;
7039
7046
  const Component = instance.type;
7040
7047
  {
7041
7048
  if (Component.name) {
@@ -7094,7 +7101,7 @@ function setupStatefulComponent(instance, isSSR) {
7094
7101
  // bail here and wait for re-entry.
7095
7102
  instance.asyncDep = setupResult;
7096
7103
  if (!instance.suspense) {
7097
- const name = Component.name ?? 'Anonymous';
7104
+ const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
7098
7105
  warn(`Component <${name}>: setup function returned a promise, but no ` +
7099
7106
  `<Suspense> boundary was found in the parent component tree. ` +
7100
7107
  `A component with async setup() must be nested in a <Suspense> ` +
@@ -7273,10 +7280,10 @@ function getExposeProxy(instance) {
7273
7280
  }
7274
7281
  const classifyRE = /(?:^|[-_])(\w)/g;
7275
7282
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
7276
- function getComponentName(Component) {
7283
+ function getComponentName(Component, includeInferred = true) {
7277
7284
  return shared.isFunction(Component)
7278
7285
  ? Component.displayName || Component.name
7279
- : Component.name;
7286
+ : Component.name || (includeInferred && Component.__name);
7280
7287
  }
7281
7288
  /* istanbul ignore next */
7282
7289
  function formatComponentName(instance, Component, isRoot = false) {
@@ -7724,7 +7731,7 @@ function isMemoSame(cached, memo) {
7724
7731
  }
7725
7732
 
7726
7733
  // Core API ------------------------------------------------------------------
7727
- const version = "3.2.34";
7734
+ const version = "3.2.37";
7728
7735
  const _ssrUtils = {
7729
7736
  createComponentInstance,
7730
7737
  setupComponent,
@@ -7734,7 +7741,7 @@ const _ssrUtils = {
7734
7741
  normalizeVNode
7735
7742
  };
7736
7743
  /**
7737
- * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
7744
+ * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
7738
7745
  * @internal
7739
7746
  */
7740
7747
  const ssrUtils = (_ssrUtils );
@@ -340,6 +340,7 @@ function flushJobs(seen) {
340
340
 
341
341
  let buffer = [];
342
342
  function setDevtoolsHook(hook, target) {
343
+ var _a, _b;
343
344
  exports.devtools = hook;
344
345
  if (exports.devtools) {
345
346
  exports.devtools.enabled = true;
@@ -354,7 +355,7 @@ function setDevtoolsHook(hook, target) {
354
355
  // some envs mock window but not fully
355
356
  window.HTMLElement &&
356
357
  // also exclude jsdom
357
- !window.navigator?.userAgent?.includes('jsdom')) {
358
+ !((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
358
359
  const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
359
360
  target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
360
361
  replay.push((newHook) => {
@@ -2299,7 +2300,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
2299
2300
  const Component = instance.type;
2300
2301
  // explicit self name has highest priority
2301
2302
  if (type === COMPONENTS) {
2302
- const selfName = getComponentName(Component);
2303
+ const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
2303
2304
  if (selfName &&
2304
2305
  (selfName === name ||
2305
2306
  selfName === shared.camelize(name) ||
@@ -3524,7 +3525,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3524
3525
  setupState[ref] = value;
3525
3526
  }
3526
3527
  }
3527
- else if (reactivity.isRef(ref)) {
3528
+ else if (_isRef) {
3528
3529
  ref.value = value;
3529
3530
  if (rawRef.k)
3530
3531
  refs[rawRef.k] = value;
@@ -3556,11 +3557,13 @@ function createHydrationFunctions(rendererInternals) {
3556
3557
  if (!container.hasChildNodes()) {
3557
3558
  patch(null, vnode, container);
3558
3559
  flushPostFlushCbs();
3560
+ container._vnode = vnode;
3559
3561
  return;
3560
3562
  }
3561
3563
  hasMismatch = false;
3562
3564
  hydrateNode(container.firstChild, vnode, null, null, null);
3563
3565
  flushPostFlushCbs();
3566
+ container._vnode = vnode;
3564
3567
  if (hasMismatch && !false) {
3565
3568
  // this error should show up in production
3566
3569
  console.error(`Hydration completed but contains mismatches.`);
@@ -3583,7 +3586,7 @@ function createHydrationFunctions(rendererInternals) {
3583
3586
  // #5728 empty text node inside a slot can cause hydration failure
3584
3587
  // because the server rendered HTML won't contain a text node
3585
3588
  if (vnode.children === '') {
3586
- insert((vnode.el = createText('')), node.parentElement, node);
3589
+ insert((vnode.el = createText('')), parentNode(node), node);
3587
3590
  nextNode = node;
3588
3591
  }
3589
3592
  else {
@@ -3607,7 +3610,7 @@ function createHydrationFunctions(rendererInternals) {
3607
3610
  }
3608
3611
  break;
3609
3612
  case Static:
3610
- if (domType !== 1 /* ELEMENT */) {
3613
+ if (domType !== 1 /* ELEMENT */ && domType !== 3 /* TEXT */) {
3611
3614
  nextNode = onMismatch();
3612
3615
  }
3613
3616
  else {
@@ -3618,7 +3621,10 @@ function createHydrationFunctions(rendererInternals) {
3618
3621
  const needToAdoptContent = !vnode.children.length;
3619
3622
  for (let i = 0; i < vnode.staticCount; i++) {
3620
3623
  if (needToAdoptContent)
3621
- vnode.children += nextNode.outerHTML;
3624
+ vnode.children +=
3625
+ nextNode.nodeType === 1 /* ELEMENT */
3626
+ ? nextNode.outerHTML
3627
+ : nextNode.data;
3622
3628
  if (i === vnode.staticCount - 1) {
3623
3629
  vnode.anchor = nextNode;
3624
3630
  }
@@ -5920,10 +5926,10 @@ function getExposeProxy(instance) {
5920
5926
  }
5921
5927
  const classifyRE = /(?:^|[-_])(\w)/g;
5922
5928
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
5923
- function getComponentName(Component) {
5929
+ function getComponentName(Component, includeInferred = true) {
5924
5930
  return shared.isFunction(Component)
5925
5931
  ? Component.displayName || Component.name
5926
- : Component.name;
5932
+ : Component.name || (includeInferred && Component.__name);
5927
5933
  }
5928
5934
  /* istanbul ignore next */
5929
5935
  function formatComponentName(instance, Component, isRoot = false) {
@@ -6160,7 +6166,7 @@ function isMemoSame(cached, memo) {
6160
6166
  }
6161
6167
 
6162
6168
  // Core API ------------------------------------------------------------------
6163
- const version = "3.2.34";
6169
+ const version = "3.2.37";
6164
6170
  const _ssrUtils = {
6165
6171
  createComponentInstance,
6166
6172
  setupComponent,
@@ -6170,7 +6176,7 @@ const _ssrUtils = {
6170
6176
  normalizeVNode
6171
6177
  };
6172
6178
  /**
6173
- * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
6179
+ * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
6174
6180
  * @internal
6175
6181
  */
6176
6182
  const ssrUtils = (_ssrUtils );
@@ -431,6 +431,10 @@ declare interface ComponentInternalOptions {
431
431
  * This one should be exposed so that devtools can make use of it
432
432
  */
433
433
  __file?: string;
434
+ /**
435
+ * name inferred from filename
436
+ */
437
+ __name?: string;
434
438
  }
435
439
 
436
440
  export declare type ComponentObjectPropsOptions<P = Data> = {
@@ -439,7 +443,7 @@ export declare type ComponentObjectPropsOptions<P = Data> = {
439
443
 
440
444
  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>>>;
441
445
 
442
- 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 = {}, Provide extends ComponentProvideOptions = ComponentProvideOptions> extends LegacyOptions<Props, D, C, M, Mixin, Extends, Provide>, ComponentInternalOptions, ComponentCustomOptions {
446
+ 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 {
443
447
  setup?: (this: void, props: Readonly<LooseRequired<Props & UnionToIntersection<ExtractOptionProp<Mixin>> & UnionToIntersection<ExtractOptionProp<Extends>>>>, ctx: SetupContext<E>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
444
448
  name?: string;
445
449
  template?: string | object;
@@ -464,17 +468,17 @@ export declare interface ComponentOptionsBase<Props, RawBindings, D, C extends C
464
468
 
465
469
  export declare type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>;
466
470
 
467
- 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, Provide extends ComponentProvideOptions = ComponentProvideOptions, Props = Readonly<{
471
+ 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<{
468
472
  [key in PropNames]?: any;
469
- }> & EmitsToProps<E>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, Provide> & {
473
+ }> & EmitsToProps<E>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}> & {
470
474
  props: PropNames[];
471
475
  } & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E>>;
472
476
 
473
- 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, Provide extends ComponentProvideOptions = ComponentProvideOptions, Props = Readonly<ExtractPropTypes<PropsOptions>> & EmitsToProps<E>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, Provide> & {
477
+ 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> & {
474
478
  props: PropsOptions & ThisType<void>;
475
479
  } & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false>>;
476
480
 
477
- 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, Provide extends ComponentProvideOptions = ComponentProvideOptions, PE = Props & EmitsToProps<E>> = ComponentOptionsBase<PE, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, Provide> & {
481
+ 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, {}> & {
478
482
  props?: undefined;
479
483
  } & ThisType<CreateComponentPublicInstance<PE, RawBindings, D, C, M, Mixin, Extends, E>>;
480
484
 
@@ -562,7 +566,7 @@ declare function createCompatVue(createApp: CreateAppFunction<Element>, createSi
562
566
 
563
567
  declare function createComponentInstance(vnode: VNode, parent: ComponentInternalInstance | null, suspense: SuspenseBoundary | null): ComponentInternalInstance;
564
568
 
565
- 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>, Provide extends ComponentProvideOptions = ComponentProvideOptions> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults, Provide>>;
569
+ 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>>;
566
570
 
567
571
  /**
568
572
  * @private
@@ -653,17 +657,17 @@ export declare function defineAsyncComponent<T extends Component = {
653
657
  new (): ComponentPublicInstance;
654
658
  }>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
655
659
 
656
- export declare type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, RawOptions extends {} = {}, PP = PublicProps, Props = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>), Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>> = RawOptions & ComponentPublicInstanceConstructor<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, true> & Props> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, Provide> & PP;
660
+ export declare type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>), Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>> = ComponentPublicInstanceConstructor<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, true> & Props> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults> & PP;
657
661
 
658
662
  export declare function defineComponent<Props, RawBindings = object>(setup: (props: Readonly<Props>, ctx: SetupContext) => RawBindings | RenderFunction): DefineComponent<Props, RawBindings>;
659
663
 
660
- export declare function defineComponent<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, Provide extends ComponentProvideOptions = ComponentProvideOptions, Options extends ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide> = ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide>>(options: Options & ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide, Options>;
664
+ export declare function defineComponent<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>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>;
661
665
 
662
- 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 = Record<string, any>, EE extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, Options extends ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide> = ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide>>(options: Options & ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide>): DefineComponent<Readonly<{
666
+ 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 = Record<string, any>, EE extends string = string>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<Readonly<{
663
667
  [key in PropNames]?: any;
664
- }>, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide, Options>;
668
+ }>, RawBindings, D, C, M, Mixin, Extends, E, EE>;
665
669
 
666
- 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 = Record<string, any>, EE extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, Options extends ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide> = ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide>>(options: Options & ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide, Options>;
670
+ 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 = Record<string, any>, 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>;
667
671
 
668
672
  /**
669
673
  * Vue `<script setup>` compiler macro for declaring a component's emitted
@@ -976,7 +980,7 @@ export declare interface HydrationRenderer extends Renderer<Element | ShadowRoot
976
980
  hydrate: RootHydrateFunction;
977
981
  }
978
982
 
979
- declare type InferDefault<P, T> = T extends null | number | string | boolean | symbol | Function ? T : (props: P) => T;
983
+ declare type InferDefault<P, T> = T extends null | number | string | boolean | symbol | Function ? T | ((props: P) => T) : (props: P) => T;
980
984
 
981
985
  declare type InferDefaults<T> = {
982
986
  [K in keyof T]?: InferDefault<T, NotUndefined<T[K]>>;
@@ -1073,14 +1077,14 @@ export declare type LegacyConfig = {
1073
1077
  productionTip?: boolean;
1074
1078
  };
1075
1079
 
1076
- declare interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, Provide extends ComponentProvideOptions = ComponentProvideOptions> {
1080
+ declare interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin> {
1077
1081
  compatConfig?: CompatConfig;
1078
1082
  [key: string]: any;
1079
1083
  data?: (this: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
1080
1084
  computed?: C;
1081
1085
  methods?: M;
1082
1086
  watch?: ComponentWatchOptions;
1083
- provide?: Provide;
1087
+ provide?: ComponentProvideOptions;
1084
1088
  inject?: ComponentInjectOptions;
1085
1089
  filters?: Record<string, Function>;
1086
1090
  mixins?: Mixin[];
@@ -1544,7 +1548,9 @@ export declare function resolveDynamicComponent(component: unknown): VNodeTypes;
1544
1548
 
1545
1549
  export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
1546
1550
 
1547
- export declare type RootHydrateFunction = (vnode: VNode<Node, Element>, container: Element | ShadowRoot) => void;
1551
+ export declare type RootHydrateFunction = (vnode: VNode<Node, Element>, container: (Element | ShadowRoot) & {
1552
+ _vnode?: VNode;
1553
+ }) => void;
1548
1554
 
1549
1555
  export declare type RootRenderFunction<HostElement = RendererElement> = (vnode: VNode | null, container: HostElement, isSVG?: boolean) => void;
1550
1556
 
@@ -1890,7 +1896,7 @@ export declare type VNodeProps = {
1890
1896
  onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
1891
1897
  };
1892
1898
 
1893
- declare type VNodeRef = string | Ref | ((ref: object | null, refs: Record<string, any>) => void);
1899
+ export declare type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
1894
1900
 
1895
1901
  export declare type VNodeTypes = string | VNode | Component | typeof Text_2 | typeof Static | typeof Comment_2 | typeof Fragment | typeof TeleportImpl | typeof SuspenseImpl;
1896
1902
 
@@ -2833,7 +2833,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
2833
2833
  const Component = instance.type;
2834
2834
  // explicit self name has highest priority
2835
2835
  if (type === COMPONENTS) {
2836
- const selfName = getComponentName(Component);
2836
+ const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
2837
2837
  if (selfName &&
2838
2838
  (selfName === name ||
2839
2839
  selfName === camelize(name) ||
@@ -4519,7 +4519,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4519
4519
  setupState[ref] = value;
4520
4520
  }
4521
4521
  }
4522
- else if (isRef(ref)) {
4522
+ else if (_isRef) {
4523
4523
  ref.value = value;
4524
4524
  if (rawRef.k)
4525
4525
  refs[rawRef.k] = value;
@@ -4559,11 +4559,13 @@ function createHydrationFunctions(rendererInternals) {
4559
4559
  `Performing full mount instead.`);
4560
4560
  patch(null, vnode, container);
4561
4561
  flushPostFlushCbs();
4562
+ container._vnode = vnode;
4562
4563
  return;
4563
4564
  }
4564
4565
  hasMismatch = false;
4565
4566
  hydrateNode(container.firstChild, vnode, null, null, null);
4566
4567
  flushPostFlushCbs();
4568
+ container._vnode = vnode;
4567
4569
  if (hasMismatch && !false) {
4568
4570
  // this error should show up in production
4569
4571
  console.error(`Hydration completed but contains mismatches.`);
@@ -4586,7 +4588,7 @@ function createHydrationFunctions(rendererInternals) {
4586
4588
  // #5728 empty text node inside a slot can cause hydration failure
4587
4589
  // because the server rendered HTML won't contain a text node
4588
4590
  if (vnode.children === '') {
4589
- insert((vnode.el = createText('')), node.parentElement, node);
4591
+ insert((vnode.el = createText('')), parentNode(node), node);
4590
4592
  nextNode = node;
4591
4593
  }
4592
4594
  else {
@@ -4614,7 +4616,7 @@ function createHydrationFunctions(rendererInternals) {
4614
4616
  }
4615
4617
  break;
4616
4618
  case Static:
4617
- if (domType !== 1 /* ELEMENT */) {
4619
+ if (domType !== 1 /* ELEMENT */ && domType !== 3 /* TEXT */) {
4618
4620
  nextNode = onMismatch();
4619
4621
  }
4620
4622
  else {
@@ -4625,7 +4627,10 @@ function createHydrationFunctions(rendererInternals) {
4625
4627
  const needToAdoptContent = !vnode.children.length;
4626
4628
  for (let i = 0; i < vnode.staticCount; i++) {
4627
4629
  if (needToAdoptContent)
4628
- vnode.children += nextNode.outerHTML;
4630
+ vnode.children +=
4631
+ nextNode.nodeType === 1 /* ELEMENT */
4632
+ ? nextNode.outerHTML
4633
+ : nextNode.data;
4629
4634
  if (i === vnode.staticCount - 1) {
4630
4635
  vnode.anchor = nextNode;
4631
4636
  }
@@ -7373,10 +7378,10 @@ function getExposeProxy(instance) {
7373
7378
  }
7374
7379
  const classifyRE = /(?:^|[-_])(\w)/g;
7375
7380
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
7376
- function getComponentName(Component) {
7381
+ function getComponentName(Component, includeInferred = true) {
7377
7382
  return isFunction(Component)
7378
7383
  ? Component.displayName || Component.name
7379
- : Component.name;
7384
+ : Component.name || (includeInferred && Component.__name);
7380
7385
  }
7381
7386
  /* istanbul ignore next */
7382
7387
  function formatComponentName(instance, Component, isRoot = false) {
@@ -7824,7 +7829,7 @@ function isMemoSame(cached, memo) {
7824
7829
  }
7825
7830
 
7826
7831
  // Core API ------------------------------------------------------------------
7827
- const version = "3.2.34";
7832
+ const version = "3.2.37";
7828
7833
  const _ssrUtils = {
7829
7834
  createComponentInstance,
7830
7835
  setupComponent,
@@ -7834,7 +7839,7 @@ const _ssrUtils = {
7834
7839
  normalizeVNode
7835
7840
  };
7836
7841
  /**
7837
- * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
7842
+ * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
7838
7843
  * @internal
7839
7844
  */
7840
7845
  const ssrUtils = (_ssrUtils );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.2.34",
3
+ "version": "3.2.37",
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.34",
36
- "@vue/reactivity": "3.2.34"
35
+ "@vue/shared": "3.2.37",
36
+ "@vue/reactivity": "3.2.37"
37
37
  }
38
38
  }