@vue/runtime-core 3.2.34-beta.1 → 3.2.36

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) => {
@@ -2393,7 +2394,10 @@ const KeepAliveImpl = {
2393
2394
  // if the internal renderer is not registered, it indicates that this is server-side rendering,
2394
2395
  // for KeepAlive, we just need to render its children
2395
2396
  if (!sharedContext.renderer) {
2396
- return slots.default;
2397
+ return () => {
2398
+ const children = slots.default && slots.default();
2399
+ return children && children.length === 1 ? children[0] : children;
2400
+ };
2397
2401
  }
2398
2402
  const cache = new Map();
2399
2403
  const keys = new Set();
@@ -4522,7 +4526,7 @@ const isComment = (node) => node.nodeType === 8 /* COMMENT */;
4522
4526
  // Hydration also depends on some renderer internal logic which needs to be
4523
4527
  // passed in via arguments.
4524
4528
  function createHydrationFunctions(rendererInternals) {
4525
- const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
4529
+ const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
4526
4530
  const hydrate = (vnode, container) => {
4527
4531
  if (!container.hasChildNodes()) {
4528
4532
  warn(`Attempting to hydrate existing markup but container is empty. ` +
@@ -4553,7 +4557,15 @@ function createHydrationFunctions(rendererInternals) {
4553
4557
  switch (type) {
4554
4558
  case Text:
4555
4559
  if (domType !== 3 /* TEXT */) {
4556
- nextNode = onMismatch();
4560
+ // #5728 empty text node inside a slot can cause hydration failure
4561
+ // because the server rendered HTML won't contain a text node
4562
+ if (vnode.children === '') {
4563
+ insert((vnode.el = createText('')), parentNode(node), node);
4564
+ nextNode = node;
4565
+ }
4566
+ else {
4567
+ nextNode = onMismatch();
4568
+ }
4557
4569
  }
4558
4570
  else {
4559
4571
  if (node.data !== vnode.children) {
@@ -4627,6 +4639,12 @@ function createHydrationFunctions(rendererInternals) {
4627
4639
  nextNode = isFragmentStart
4628
4640
  ? locateClosingAsyncAnchor(node)
4629
4641
  : nextSibling(node);
4642
+ // #4293 teleport as component root
4643
+ if (nextNode &&
4644
+ isComment(nextNode) &&
4645
+ nextNode.data === 'teleport end') {
4646
+ nextNode = nextSibling(nextNode);
4647
+ }
4630
4648
  // #3787
4631
4649
  // if component is async, it may get moved / unmounted before its
4632
4650
  // inner component is loaded, so we need to give it a placeholder
@@ -5290,8 +5308,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5290
5308
  const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));
5291
5309
  const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));
5292
5310
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
5293
- if (isHmrUpdating) {
5294
- // HMR updated, force full diff
5311
+ if (// #5523 dev root fragment may inherit directives
5312
+ (isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
5313
+ // HMR updated / Dev root fragment (w/ comments), force full diff
5295
5314
  patchFlag = 0;
5296
5315
  optimized = false;
5297
5316
  dynamicChildren = null;
@@ -5313,8 +5332,6 @@ function baseCreateRenderer(options, createHydrationFns) {
5313
5332
  else {
5314
5333
  if (patchFlag > 0 &&
5315
5334
  patchFlag & 64 /* STABLE_FRAGMENT */ &&
5316
- // #5523 dev root fragment may inherit directives so always force update
5317
- !(patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) &&
5318
5335
  dynamicChildren &&
5319
5336
  // #2715 the previous fragment could've been a BAILed one as a result
5320
5337
  // of renderSlot() with no valid children
@@ -6400,10 +6417,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
6400
6417
  }
6401
6418
  else {
6402
6419
  vnode.anchor = nextSibling(node);
6403
- vnode.targetAnchor = hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
6420
+ // lookahead until we find the target anchor
6421
+ // we cannot rely on return value of hydrateChildren() because there
6422
+ // could be nested teleports
6423
+ let targetAnchor = targetNode;
6424
+ while (targetAnchor) {
6425
+ targetAnchor = nextSibling(targetAnchor);
6426
+ if (targetAnchor &&
6427
+ targetAnchor.nodeType === 8 &&
6428
+ targetAnchor.data === 'teleport anchor') {
6429
+ vnode.targetAnchor = targetAnchor;
6430
+ target._lpa =
6431
+ vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6432
+ break;
6433
+ }
6434
+ }
6435
+ hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
6404
6436
  }
6405
- target._lpa =
6406
- vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6407
6437
  }
6408
6438
  }
6409
6439
  return vnode.anchor && nextSibling(vnode.anchor);
@@ -7007,6 +7037,7 @@ function setupComponent(instance, isSSR = false) {
7007
7037
  return setupResult;
7008
7038
  }
7009
7039
  function setupStatefulComponent(instance, isSSR) {
7040
+ var _a;
7010
7041
  const Component = instance.type;
7011
7042
  {
7012
7043
  if (Component.name) {
@@ -7065,7 +7096,7 @@ function setupStatefulComponent(instance, isSSR) {
7065
7096
  // bail here and wait for re-entry.
7066
7097
  instance.asyncDep = setupResult;
7067
7098
  if (!instance.suspense) {
7068
- const name = Component.name ?? 'Anonymous';
7099
+ const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
7069
7100
  warn(`Component <${name}>: setup function returned a promise, but no ` +
7070
7101
  `<Suspense> boundary was found in the parent component tree. ` +
7071
7102
  `A component with async setup() must be nested in a <Suspense> ` +
@@ -7695,7 +7726,7 @@ function isMemoSame(cached, memo) {
7695
7726
  }
7696
7727
 
7697
7728
  // Core API ------------------------------------------------------------------
7698
- const version = "3.2.34-beta.1";
7729
+ const version = "3.2.36";
7699
7730
  const _ssrUtils = {
7700
7731
  createComponentInstance,
7701
7732
  setupComponent,
@@ -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) => {
@@ -1899,7 +1900,10 @@ const KeepAliveImpl = {
1899
1900
  // if the internal renderer is not registered, it indicates that this is server-side rendering,
1900
1901
  // for KeepAlive, we just need to render its children
1901
1902
  if (!sharedContext.renderer) {
1902
- return slots.default;
1903
+ return () => {
1904
+ const children = slots.default && slots.default();
1905
+ return children && children.length === 1 ? children[0] : children;
1906
+ };
1903
1907
  }
1904
1908
  const cache = new Map();
1905
1909
  const keys = new Set();
@@ -3548,7 +3552,7 @@ const isComment = (node) => node.nodeType === 8 /* COMMENT */;
3548
3552
  // Hydration also depends on some renderer internal logic which needs to be
3549
3553
  // passed in via arguments.
3550
3554
  function createHydrationFunctions(rendererInternals) {
3551
- const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
3555
+ const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
3552
3556
  const hydrate = (vnode, container) => {
3553
3557
  if (!container.hasChildNodes()) {
3554
3558
  patch(null, vnode, container);
@@ -3577,7 +3581,15 @@ function createHydrationFunctions(rendererInternals) {
3577
3581
  switch (type) {
3578
3582
  case Text:
3579
3583
  if (domType !== 3 /* TEXT */) {
3580
- nextNode = onMismatch();
3584
+ // #5728 empty text node inside a slot can cause hydration failure
3585
+ // because the server rendered HTML won't contain a text node
3586
+ if (vnode.children === '') {
3587
+ insert((vnode.el = createText('')), parentNode(node), node);
3588
+ nextNode = node;
3589
+ }
3590
+ else {
3591
+ nextNode = onMismatch();
3592
+ }
3581
3593
  }
3582
3594
  else {
3583
3595
  if (node.data !== vnode.children) {
@@ -3648,6 +3660,12 @@ function createHydrationFunctions(rendererInternals) {
3648
3660
  nextNode = isFragmentStart
3649
3661
  ? locateClosingAsyncAnchor(node)
3650
3662
  : nextSibling(node);
3663
+ // #4293 teleport as component root
3664
+ if (nextNode &&
3665
+ isComment(nextNode) &&
3666
+ nextNode.data === 'teleport end') {
3667
+ nextNode = nextSibling(nextNode);
3668
+ }
3651
3669
  // #3787
3652
3670
  // if component is async, it may get moved / unmounted before its
3653
3671
  // inner component is loaded, so we need to give it a placeholder
@@ -4229,8 +4247,6 @@ function baseCreateRenderer(options, createHydrationFns) {
4229
4247
  else {
4230
4248
  if (patchFlag > 0 &&
4231
4249
  patchFlag & 64 /* STABLE_FRAGMENT */ &&
4232
- // #5523 dev root fragment may inherit directives so always force update
4233
- !(false /* DEV_ROOT_FRAGMENT */) &&
4234
4250
  dynamicChildren &&
4235
4251
  // #2715 the previous fragment could've been a BAILed one as a result
4236
4252
  // of renderSlot() with no valid children
@@ -5178,10 +5194,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
5178
5194
  }
5179
5195
  else {
5180
5196
  vnode.anchor = nextSibling(node);
5181
- vnode.targetAnchor = hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
5197
+ // lookahead until we find the target anchor
5198
+ // we cannot rely on return value of hydrateChildren() because there
5199
+ // could be nested teleports
5200
+ let targetAnchor = targetNode;
5201
+ while (targetAnchor) {
5202
+ targetAnchor = nextSibling(targetAnchor);
5203
+ if (targetAnchor &&
5204
+ targetAnchor.nodeType === 8 &&
5205
+ targetAnchor.data === 'teleport anchor') {
5206
+ vnode.targetAnchor = targetAnchor;
5207
+ target._lpa =
5208
+ vnode.targetAnchor && nextSibling(vnode.targetAnchor);
5209
+ break;
5210
+ }
5211
+ }
5212
+ hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
5182
5213
  }
5183
- target._lpa =
5184
- vnode.targetAnchor && nextSibling(vnode.targetAnchor);
5185
5214
  }
5186
5215
  }
5187
5216
  return vnode.anchor && nextSibling(vnode.anchor);
@@ -6132,7 +6161,7 @@ function isMemoSame(cached, memo) {
6132
6161
  }
6133
6162
 
6134
6163
  // Core API ------------------------------------------------------------------
6135
- const version = "3.2.34-beta.1";
6164
+ const version = "3.2.36";
6136
6165
  const _ssrUtils = {
6137
6166
  createComponentInstance,
6138
6167
  setupComponent,
@@ -439,7 +439,7 @@ export declare type ComponentObjectPropsOptions<P = Data> = {
439
439
 
440
440
  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
441
 
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 {
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 = {}> extends LegacyOptions<Props, D, C, M, Mixin, Extends>, ComponentInternalOptions, ComponentCustomOptions {
443
443
  setup?: (this: void, props: Readonly<LooseRequired<Props & UnionToIntersection<ExtractOptionProp<Mixin>> & UnionToIntersection<ExtractOptionProp<Extends>>>>, ctx: SetupContext<E>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
444
444
  name?: string;
445
445
  template?: string | object;
@@ -464,23 +464,23 @@ export declare interface ComponentOptionsBase<Props, RawBindings, D, C extends C
464
464
 
465
465
  export declare type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>;
466
466
 
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<{
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, Props = Readonly<{
468
468
  [key in PropNames]?: any;
469
- }> & EmitsToProps<E>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, Provide> & {
469
+ }> & EmitsToProps<E>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}> & {
470
470
  props: PropNames[];
471
471
  } & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E>>;
472
472
 
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> & {
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, Props = Readonly<ExtractPropTypes<PropsOptions>> & EmitsToProps<E>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults> & {
474
474
  props: PropsOptions & ThisType<void>;
475
475
  } & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false>>;
476
476
 
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> & {
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, PE = Props & EmitsToProps<E>> = ComponentOptionsBase<PE, RawBindings, D, C, M, Mixin, Extends, E, EE, {}> & {
478
478
  props?: undefined;
479
479
  } & ThisType<CreateComponentPublicInstance<PE, RawBindings, D, C, M, Mixin, Extends, E>>;
480
480
 
481
481
  export declare type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
482
482
 
483
- declare type ComponentProvideOptions = ObjectProvideOptions | Function;
483
+ export declare type ComponentProvideOptions = ObjectProvideOptions | Function;
484
484
 
485
485
  export declare type ComponentPublicInstance<P = {}, // props type extracted from props option
486
486
  B = {}, // raw bindings returned from setup()
@@ -562,7 +562,7 @@ declare function createCompatVue(createApp: CreateAppFunction<Element>, createSi
562
562
 
563
563
  declare function createComponentInstance(vnode: VNode, parent: ComponentInternalInstance | null, suspense: SuspenseBoundary | null): ComponentInternalInstance;
564
564
 
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>>;
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>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults>>;
566
566
 
567
567
  /**
568
568
  * @private
@@ -653,17 +653,17 @@ export declare function defineAsyncComponent<T extends Component = {
653
653
  new (): ComponentPublicInstance;
654
654
  }>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
655
655
 
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;
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, 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
657
 
658
658
  export declare function defineComponent<Props, RawBindings = object>(setup: (props: Readonly<Props>, ctx: SetupContext) => RawBindings | RenderFunction): DefineComponent<Props, RawBindings>;
659
659
 
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 {} = {}>(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>;
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>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>;
661
661
 
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 {} = {}>(options: Options & ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide>): DefineComponent<Readonly<{
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>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<Readonly<{
663
663
  [key in PropNames]?: any;
664
- }>, RawBindings, D, C, M, Mixin, Extends, E, EE, Provide, Options>;
664
+ }>, RawBindings, D, C, M, Mixin, Extends, E, EE>;
665
665
 
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 {} = {}>(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>;
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>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>;
667
667
 
668
668
  /**
669
669
  * Vue `<script setup>` compiler macro for declaring a component's emitted
@@ -976,7 +976,7 @@ export declare interface HydrationRenderer extends Renderer<Element | ShadowRoot
976
976
  hydrate: RootHydrateFunction;
977
977
  }
978
978
 
979
- declare type InferDefault<P, T> = T extends null | number | string | boolean | symbol | Function ? T : (props: P) => T;
979
+ declare type InferDefault<P, T> = T extends null | number | string | boolean | symbol | Function ? T | ((props: P) => T) : (props: P) => T;
980
980
 
981
981
  declare type InferDefaults<T> = {
982
982
  [K in keyof T]?: InferDefault<T, NotUndefined<T[K]>>;
@@ -1073,14 +1073,14 @@ export declare type LegacyConfig = {
1073
1073
  productionTip?: boolean;
1074
1074
  };
1075
1075
 
1076
- declare interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, Provide extends ComponentProvideOptions = ComponentProvideOptions> {
1076
+ declare interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin> {
1077
1077
  compatConfig?: CompatConfig;
1078
1078
  [key: string]: any;
1079
1079
  data?: (this: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
1080
1080
  computed?: C;
1081
1081
  methods?: M;
1082
1082
  watch?: ComponentWatchOptions;
1083
- provide?: Provide;
1083
+ provide?: ComponentProvideOptions;
1084
1084
  inject?: ComponentInjectOptions;
1085
1085
  filters?: Record<string, Function>;
1086
1086
  mixins?: Mixin[];
@@ -1890,7 +1890,7 @@ export declare type VNodeProps = {
1890
1890
  onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
1891
1891
  };
1892
1892
 
1893
- declare type VNodeRef = string | Ref | ((ref: object | null, refs: Record<string, any>) => void);
1893
+ export declare type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
1894
1894
 
1895
1895
  export declare type VNodeTypes = string | VNode | Component | typeof Text_2 | typeof Static | typeof Comment_2 | typeof Fragment | typeof TeleportImpl | typeof SuspenseImpl;
1896
1896
 
@@ -2404,7 +2404,10 @@ const KeepAliveImpl = {
2404
2404
  // if the internal renderer is not registered, it indicates that this is server-side rendering,
2405
2405
  // for KeepAlive, we just need to render its children
2406
2406
  if (!sharedContext.renderer) {
2407
- return slots.default;
2407
+ return () => {
2408
+ const children = slots.default && slots.default();
2409
+ return children && children.length === 1 ? children[0] : children;
2410
+ };
2408
2411
  }
2409
2412
  const cache = new Map();
2410
2413
  const keys = new Set();
@@ -4548,7 +4551,7 @@ const isComment = (node) => node.nodeType === 8 /* COMMENT */;
4548
4551
  // Hydration also depends on some renderer internal logic which needs to be
4549
4552
  // passed in via arguments.
4550
4553
  function createHydrationFunctions(rendererInternals) {
4551
- const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
4554
+ const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
4552
4555
  const hydrate = (vnode, container) => {
4553
4556
  if (!container.hasChildNodes()) {
4554
4557
  (process.env.NODE_ENV !== 'production') &&
@@ -4580,7 +4583,15 @@ function createHydrationFunctions(rendererInternals) {
4580
4583
  switch (type) {
4581
4584
  case Text:
4582
4585
  if (domType !== 3 /* TEXT */) {
4583
- nextNode = onMismatch();
4586
+ // #5728 empty text node inside a slot can cause hydration failure
4587
+ // because the server rendered HTML won't contain a text node
4588
+ if (vnode.children === '') {
4589
+ insert((vnode.el = createText('')), parentNode(node), node);
4590
+ nextNode = node;
4591
+ }
4592
+ else {
4593
+ nextNode = onMismatch();
4594
+ }
4584
4595
  }
4585
4596
  else {
4586
4597
  if (node.data !== vnode.children) {
@@ -4655,6 +4666,12 @@ function createHydrationFunctions(rendererInternals) {
4655
4666
  nextNode = isFragmentStart
4656
4667
  ? locateClosingAsyncAnchor(node)
4657
4668
  : nextSibling(node);
4669
+ // #4293 teleport as component root
4670
+ if (nextNode &&
4671
+ isComment(nextNode) &&
4672
+ nextNode.data === 'teleport end') {
4673
+ nextNode = nextSibling(nextNode);
4674
+ }
4658
4675
  // #3787
4659
4676
  // if component is async, it may get moved / unmounted before its
4660
4677
  // inner component is loaded, so we need to give it a placeholder
@@ -5362,8 +5379,10 @@ function baseCreateRenderer(options, createHydrationFns) {
5362
5379
  const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));
5363
5380
  const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));
5364
5381
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
5365
- if ((process.env.NODE_ENV !== 'production') && isHmrUpdating) {
5366
- // HMR updated, force full diff
5382
+ if ((process.env.NODE_ENV !== 'production') &&
5383
+ // #5523 dev root fragment may inherit directives
5384
+ (isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
5385
+ // HMR updated / Dev root fragment (w/ comments), force full diff
5367
5386
  patchFlag = 0;
5368
5387
  optimized = false;
5369
5388
  dynamicChildren = null;
@@ -5385,8 +5404,6 @@ function baseCreateRenderer(options, createHydrationFns) {
5385
5404
  else {
5386
5405
  if (patchFlag > 0 &&
5387
5406
  patchFlag & 64 /* STABLE_FRAGMENT */ &&
5388
- // #5523 dev root fragment may inherit directives so always force update
5389
- !((process.env.NODE_ENV !== 'production') && patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) &&
5390
5407
  dynamicChildren &&
5391
5408
  // #2715 the previous fragment could've been a BAILed one as a result
5392
5409
  // of renderSlot() with no valid children
@@ -6477,10 +6494,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
6477
6494
  }
6478
6495
  else {
6479
6496
  vnode.anchor = nextSibling(node);
6480
- vnode.targetAnchor = hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
6497
+ // lookahead until we find the target anchor
6498
+ // we cannot rely on return value of hydrateChildren() because there
6499
+ // could be nested teleports
6500
+ let targetAnchor = targetNode;
6501
+ while (targetAnchor) {
6502
+ targetAnchor = nextSibling(targetAnchor);
6503
+ if (targetAnchor &&
6504
+ targetAnchor.nodeType === 8 &&
6505
+ targetAnchor.data === 'teleport anchor') {
6506
+ vnode.targetAnchor = targetAnchor;
6507
+ target._lpa =
6508
+ vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6509
+ break;
6510
+ }
6511
+ }
6512
+ hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
6481
6513
  }
6482
- target._lpa =
6483
- vnode.targetAnchor && nextSibling(vnode.targetAnchor);
6484
6514
  }
6485
6515
  }
6486
6516
  return vnode.anchor && nextSibling(vnode.anchor);
@@ -7794,7 +7824,7 @@ function isMemoSame(cached, memo) {
7794
7824
  }
7795
7825
 
7796
7826
  // Core API ------------------------------------------------------------------
7797
- const version = "3.2.34-beta.1";
7827
+ const version = "3.2.36";
7798
7828
  const _ssrUtils = {
7799
7829
  createComponentInstance,
7800
7830
  setupComponent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.2.34-beta.1",
3
+ "version": "3.2.36",
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-beta.1",
36
- "@vue/reactivity": "3.2.34-beta.1"
35
+ "@vue/shared": "3.2.36",
36
+ "@vue/reactivity": "3.2.36"
37
37
  }
38
38
  }