@vue/runtime-core 3.3.8 → 3.3.10

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.
@@ -813,9 +813,19 @@ function renderComponentRoot(instance) {
813
813
  try {
814
814
  if (vnode.shapeFlag & 4) {
815
815
  const proxyToUse = withProxy || proxy;
816
+ const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
817
+ get(target, key, receiver) {
818
+ warn(
819
+ `Property '${String(
820
+ key
821
+ )}' was accessed via 'this'. Avoid using 'this' in templates.`
822
+ );
823
+ return Reflect.get(target, key, receiver);
824
+ }
825
+ }) : proxyToUse;
816
826
  result = normalizeVNode(
817
827
  render.call(
818
- proxyToUse,
828
+ thisProxy,
819
829
  proxyToUse,
820
830
  renderCache,
821
831
  props,
@@ -1426,7 +1436,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1426
1436
  if (delayEnter) {
1427
1437
  activeBranch.transition.afterLeave = () => {
1428
1438
  if (pendingId === suspense.pendingId) {
1429
- move(pendingBranch, container2, anchor2, 0);
1439
+ move(
1440
+ pendingBranch,
1441
+ container2,
1442
+ next(activeBranch),
1443
+ 0
1444
+ );
1430
1445
  queuePostFlushCb(effects);
1431
1446
  }
1432
1447
  };
@@ -1473,7 +1488,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1473
1488
  }
1474
1489
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
1475
1490
  triggerEvent(vnode2, "onFallback");
1476
- const anchor2 = next(activeBranch);
1477
1491
  const mountFallback = () => {
1478
1492
  if (!suspense.isInFallback) {
1479
1493
  return;
@@ -1482,7 +1496,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1482
1496
  null,
1483
1497
  fallbackVNode,
1484
1498
  container2,
1485
- anchor2,
1499
+ next(activeBranch),
1486
1500
  parentComponent2,
1487
1501
  null,
1488
1502
  // fallback tree will not have suspense context
@@ -1777,6 +1791,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1777
1791
  let onCleanup = (fn) => {
1778
1792
  cleanup = effect.onStop = () => {
1779
1793
  callWithErrorHandling(fn, instance, 4);
1794
+ cleanup = effect.onStop = void 0;
1780
1795
  };
1781
1796
  };
1782
1797
  let ssrCleanup;
@@ -2268,7 +2283,11 @@ function emptyPlaceholder(vnode) {
2268
2283
  }
2269
2284
  }
2270
2285
  function getKeepAliveChild(vnode) {
2271
- return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : void 0 : vnode;
2286
+ return isKeepAlive(vnode) ? (
2287
+ // #7121 ensure get the child component subtree in case
2288
+ // it's been replaced during HMR
2289
+ vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0
2290
+ ) : vnode;
2272
2291
  }
2273
2292
  function setTransitionHooks(vnode, hooks) {
2274
2293
  if (vnode.shapeFlag & 6 && vnode.component) {
@@ -4267,6 +4286,9 @@ function assertType(value, type) {
4267
4286
  };
4268
4287
  }
4269
4288
  function getInvalidTypeMessage(name, value, expectedTypes) {
4289
+ if (expectedTypes.length === 0) {
4290
+ return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
4291
+ }
4270
4292
  let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(shared.capitalize).join(" | ")}`;
4271
4293
  const expectedType = expectedTypes[0];
4272
4294
  const receivedType = shared.toRawType(value);
@@ -4536,6 +4558,20 @@ function createHydrationFunctions(rendererInternals) {
4536
4558
  const { type, ref, shapeFlag, patchFlag } = vnode;
4537
4559
  let domType = node.nodeType;
4538
4560
  vnode.el = node;
4561
+ {
4562
+ if (!("__vnode" in node)) {
4563
+ Object.defineProperty(node, "__vnode", {
4564
+ value: vnode,
4565
+ enumerable: false
4566
+ });
4567
+ }
4568
+ if (!("__vueParentComponent" in node)) {
4569
+ Object.defineProperty(node, "__vueParentComponent", {
4570
+ value: parentComponent,
4571
+ enumerable: false
4572
+ });
4573
+ }
4574
+ }
4539
4575
  if (patchFlag === -2) {
4540
4576
  optimized = false;
4541
4577
  vnode.dynamicChildren = null;
@@ -4697,15 +4733,16 @@ function createHydrationFunctions(rendererInternals) {
4697
4733
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4698
4734
  optimized = optimized || !!vnode.dynamicChildren;
4699
4735
  const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4700
- const forcePatchValue = type === "input" && dirs || type === "option";
4736
+ const forcePatch = type === "input" || type === "option";
4701
4737
  {
4702
4738
  if (dirs) {
4703
4739
  invokeDirectiveHook(vnode, null, parentComponent, "created");
4704
4740
  }
4705
4741
  if (props) {
4706
- if (forcePatchValue || !optimized || patchFlag & (16 | 32)) {
4742
+ if (forcePatch || !optimized || patchFlag & (16 | 32)) {
4707
4743
  for (const key in props) {
4708
- if (forcePatchValue && key.endsWith("value") || shared.isOn(key) && !shared.isReservedProp(key)) {
4744
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4745
+ key[0] === ".") {
4709
4746
  patchProp(
4710
4747
  el,
4711
4748
  key,
@@ -6462,6 +6499,7 @@ const resolveTarget = (props, select) => {
6462
6499
  }
6463
6500
  };
6464
6501
  const TeleportImpl = {
6502
+ name: "Teleport",
6465
6503
  __isTeleport: true,
6466
6504
  process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
6467
6505
  const {
@@ -6883,7 +6921,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
6883
6921
  if (shapeFlag & 4 && reactivity.isProxy(type)) {
6884
6922
  type = reactivity.toRaw(type);
6885
6923
  warn(
6886
- `Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
6924
+ `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
6887
6925
  `
6888
6926
  Component that was made reactive: `,
6889
6927
  type
@@ -7524,9 +7562,9 @@ function initCustomFormatter() {
7524
7562
  return;
7525
7563
  }
7526
7564
  const vueStyle = { style: "color:#3ba776" };
7527
- const numberStyle = { style: "color:#0b1bc9" };
7528
- const stringStyle = { style: "color:#b62e24" };
7529
- const keywordStyle = { style: "color:#9d288c" };
7565
+ const numberStyle = { style: "color:#1677ff" };
7566
+ const stringStyle = { style: "color:#f5222d" };
7567
+ const keywordStyle = { style: "color:#eb2f96" };
7530
7568
  const formatter = {
7531
7569
  header(obj) {
7532
7570
  if (!shared.isObject(obj)) {
@@ -7720,7 +7758,7 @@ function isMemoSame(cached, memo) {
7720
7758
  return true;
7721
7759
  }
7722
7760
 
7723
- const version = "3.3.8";
7761
+ const version = "3.3.10";
7724
7762
  const _ssrUtils = {
7725
7763
  createComponentInstance,
7726
7764
  setupComponent,
@@ -400,9 +400,19 @@ function renderComponentRoot(instance) {
400
400
  try {
401
401
  if (vnode.shapeFlag & 4) {
402
402
  const proxyToUse = withProxy || proxy;
403
+ const thisProxy = false ? new Proxy(proxyToUse, {
404
+ get(target, key, receiver) {
405
+ warn(
406
+ `Property '${String(
407
+ key
408
+ )}' was accessed via 'this'. Avoid using 'this' in templates.`
409
+ );
410
+ return Reflect.get(target, key, receiver);
411
+ }
412
+ }) : proxyToUse;
403
413
  result = normalizeVNode(
404
414
  render.call(
405
- proxyToUse,
415
+ thisProxy,
406
416
  proxyToUse,
407
417
  renderCache,
408
418
  props,
@@ -913,7 +923,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
913
923
  if (delayEnter) {
914
924
  activeBranch.transition.afterLeave = () => {
915
925
  if (pendingId === suspense.pendingId) {
916
- move(pendingBranch, container2, anchor2, 0);
926
+ move(
927
+ pendingBranch,
928
+ container2,
929
+ next(activeBranch),
930
+ 0
931
+ );
917
932
  queuePostFlushCb(effects);
918
933
  }
919
934
  };
@@ -960,7 +975,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
960
975
  }
961
976
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
962
977
  triggerEvent(vnode2, "onFallback");
963
- const anchor2 = next(activeBranch);
964
978
  const mountFallback = () => {
965
979
  if (!suspense.isInFallback) {
966
980
  return;
@@ -969,7 +983,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
969
983
  null,
970
984
  fallbackVNode,
971
985
  container2,
972
- anchor2,
986
+ next(activeBranch),
973
987
  parentComponent2,
974
988
  null,
975
989
  // fallback tree will not have suspense context
@@ -1228,6 +1242,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
1228
1242
  let onCleanup = (fn) => {
1229
1243
  cleanup = effect.onStop = () => {
1230
1244
  callWithErrorHandling(fn, instance, 4);
1245
+ cleanup = effect.onStop = void 0;
1231
1246
  };
1232
1247
  };
1233
1248
  let ssrCleanup;
@@ -1699,7 +1714,11 @@ function emptyPlaceholder(vnode) {
1699
1714
  }
1700
1715
  }
1701
1716
  function getKeepAliveChild(vnode) {
1702
- return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : void 0 : vnode;
1717
+ return isKeepAlive(vnode) ? (
1718
+ // #7121 ensure get the child component subtree in case
1719
+ // it's been replaced during HMR
1720
+ vnode.children ? vnode.children[0] : void 0
1721
+ ) : vnode;
1703
1722
  }
1704
1723
  function setTransitionHooks(vnode, hooks) {
1705
1724
  if (vnode.shapeFlag & 6 && vnode.component) {
@@ -3627,15 +3646,16 @@ function createHydrationFunctions(rendererInternals) {
3627
3646
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
3628
3647
  optimized = optimized || !!vnode.dynamicChildren;
3629
3648
  const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
3630
- const forcePatchValue = type === "input" && dirs || type === "option";
3631
- if (forcePatchValue || patchFlag !== -1) {
3649
+ const forcePatch = type === "input" || type === "option";
3650
+ if (forcePatch || patchFlag !== -1) {
3632
3651
  if (dirs) {
3633
3652
  invokeDirectiveHook(vnode, null, parentComponent, "created");
3634
3653
  }
3635
3654
  if (props) {
3636
- if (forcePatchValue || !optimized || patchFlag & (16 | 32)) {
3655
+ if (forcePatch || !optimized || patchFlag & (16 | 32)) {
3637
3656
  for (const key in props) {
3638
- if (forcePatchValue && key.endsWith("value") || shared.isOn(key) && !shared.isReservedProp(key)) {
3657
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
3658
+ key[0] === ".") {
3639
3659
  patchProp(
3640
3660
  el,
3641
3661
  key,
@@ -5173,6 +5193,7 @@ const resolveTarget = (props, select) => {
5173
5193
  }
5174
5194
  };
5175
5195
  const TeleportImpl = {
5196
+ name: "Teleport",
5176
5197
  __isTeleport: true,
5177
5198
  process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
5178
5199
  const {
@@ -6069,7 +6090,7 @@ function isMemoSame(cached, memo) {
6069
6090
  return true;
6070
6091
  }
6071
6092
 
6072
- const version = "3.3.8";
6093
+ const version = "3.3.10";
6073
6094
  const _ssrUtils = {
6074
6095
  createComponentInstance,
6075
6096
  setupComponent,
@@ -126,7 +126,7 @@ C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOpt
126
126
  $forceUpdate: () => void;
127
127
  $nextTick: typeof nextTick;
128
128
  $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;
129
- } & P & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>;
129
+ } & IfAny<P, P, Omit<P, keyof ShallowUnwrapRef<B>>> & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>;
130
130
 
131
131
  declare const enum LifecycleHooks {
132
132
  BEFORE_CREATE = "bc",
@@ -737,6 +737,25 @@ export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T
737
737
  */
738
738
  export declare function hasInjectionContext(): boolean;
739
739
 
740
+ type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
741
+ type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
742
+ export 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 = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}> = ComponentPublicInstanceConstructor<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, true, {}, S>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S> & PP;
743
+ export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
744
+ props?: (keyof Props)[];
745
+ emits?: E | EE[];
746
+ slots?: S;
747
+ }): (props: Props & EmitsToProps<E>) => any;
748
+ export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
749
+ props?: ComponentObjectPropsOptions<Props>;
750
+ emits?: E | EE[];
751
+ slots?: S;
752
+ }): (props: Props & EmitsToProps<E>) => any;
753
+ 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, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<Props, E>, ExtractDefaultPropTypes<Props>, S>;
754
+ 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, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string, Props = Readonly<{
755
+ [key in PropNames]?: any;
756
+ }>>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<Props, E>, ExtractDefaultPropTypes<Props>, S>;
757
+ 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, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<PropsOptions, E>, ExtractDefaultPropTypes<PropsOptions>, S>;
758
+
740
759
  export interface App<HostElement = any> {
741
760
  version: string;
742
761
  config: AppConfig;
@@ -744,7 +763,7 @@ export interface App<HostElement = any> {
744
763
  use<Options>(plugin: Plugin<Options>, options: Options): this;
745
764
  mixin(mixin: ComponentOptions): this;
746
765
  component(name: string): Component | undefined;
747
- component(name: string, component: Component): this;
766
+ component(name: string, component: Component | DefineComponent): this;
748
767
  directive(name: string): Directive | undefined;
749
768
  directive(name: string, directive: Directive): this;
750
769
  mount(rootContainer: HostElement | string, isHydrate?: boolean, isSVG?: boolean): ComponentPublicInstance;
@@ -814,6 +833,7 @@ export interface TeleportProps {
814
833
  disabled?: boolean;
815
834
  }
816
835
  declare const TeleportImpl: {
836
+ name: string;
817
837
  __isTeleport: boolean;
818
838
  process(n1: TeleportVNode | null, n2: TeleportVNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, internals: RendererInternals): void;
819
839
  remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, optimized: boolean, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: boolean): void;
@@ -883,7 +903,7 @@ export type VNodeProps = {
883
903
  onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[];
884
904
  onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
885
905
  };
886
- type VNodeChildAtom = VNode | typeof NULL_DYNAMIC_COMPONENT | string | number | boolean | null | undefined | void;
906
+ type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
887
907
  export type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
888
908
  export type VNodeChild = VNodeChildAtom | VNodeArrayChildren;
889
909
  export type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null;
@@ -1019,7 +1039,7 @@ interface ComponentInternalOptions {
1019
1039
  __name?: string;
1020
1040
  }
1021
1041
  export interface FunctionalComponent<P = {}, E extends EmitsOptions = {}, S extends Record<string, any> = any> extends ComponentInternalOptions {
1022
- (props: P, ctx: Omit<SetupContext<E, IfAny<S, {}, SlotsType<S>>>, 'expose'>): any;
1042
+ (props: P & EmitsToProps<E>, ctx: Omit<SetupContext<E, IfAny<S, {}, SlotsType<S>>>, 'expose'>): any;
1023
1043
  props?: ComponentPropsOptions<P>;
1024
1044
  emits?: E | (keyof E)[];
1025
1045
  slots?: IfAny<S, Slots, SlotsType<S>>;
@@ -1123,25 +1143,6 @@ export declare function watch<T extends Readonly<MultiWatchSources>, Immediate e
1123
1143
  export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;
1124
1144
  export declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;
1125
1145
 
1126
- type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
1127
- type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
1128
- export 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 = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}> = ComponentPublicInstanceConstructor<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, true, {}, S> & Props> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S> & PP;
1129
- export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
1130
- props?: (keyof Props)[];
1131
- emits?: E | EE[];
1132
- slots?: S;
1133
- }): (props: Props & EmitsToProps<E>) => any;
1134
- export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
1135
- props?: ComponentObjectPropsOptions<Props>;
1136
- emits?: E | EE[];
1137
- slots?: S;
1138
- }): (props: Props & EmitsToProps<E>) => any;
1139
- 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, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<Props, E>, ExtractDefaultPropTypes<Props>, S>;
1140
- 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, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string, Props = Readonly<{
1141
- [key in PropNames]?: any;
1142
- }>>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<Props, E>, ExtractDefaultPropTypes<Props>, S>;
1143
- 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, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<PropsOptions, E>, ExtractDefaultPropTypes<PropsOptions>, S>;
1144
-
1145
1146
  type AsyncComponentResolveResult<T = Component> = T | {
1146
1147
  default: T;
1147
1148
  };
@@ -1196,7 +1197,7 @@ export declare function defineProps<PropNames extends string = string>(props: Pr
1196
1197
  [key in PropNames]?: any;
1197
1198
  }>>;
1198
1199
  export declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>;
1199
- export declare function defineProps<TypeProps>(): DefineProps<TypeProps, BooleanKey<TypeProps>>;
1200
+ export declare function defineProps<TypeProps>(): DefineProps<LooseRequired<TypeProps>, BooleanKey<TypeProps>>;
1200
1201
  type DefineProps<T, BKeys extends keyof T> = Readonly<T> & {
1201
1202
  readonly [K in BKeys]-?: boolean;
1202
1203
  };
@@ -1319,8 +1320,8 @@ type InferDefaults<T> = {
1319
1320
  };
1320
1321
  type NativeType = null | number | string | boolean | symbol | Function;
1321
1322
  type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
1322
- type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Omit<T, keyof Defaults> & {
1323
- [K in keyof Defaults]-?: K extends keyof T ? Defaults[K] extends undefined ? T[K] : NotUndefined<T[K]> : never;
1323
+ type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Readonly<Omit<T, keyof Defaults>> & {
1324
+ readonly [K in keyof Defaults]-?: K extends keyof T ? Defaults[K] extends undefined ? T[K] : NotUndefined<T[K]> : never;
1324
1325
  } & {
1325
1326
  readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean;
1326
1327
  };
@@ -817,9 +817,19 @@ function renderComponentRoot(instance) {
817
817
  try {
818
818
  if (vnode.shapeFlag & 4) {
819
819
  const proxyToUse = withProxy || proxy;
820
+ const thisProxy = !!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup ? new Proxy(proxyToUse, {
821
+ get(target, key, receiver) {
822
+ warn(
823
+ `Property '${String(
824
+ key
825
+ )}' was accessed via 'this'. Avoid using 'this' in templates.`
826
+ );
827
+ return Reflect.get(target, key, receiver);
828
+ }
829
+ }) : proxyToUse;
820
830
  result = normalizeVNode(
821
831
  render.call(
822
- proxyToUse,
832
+ thisProxy,
823
833
  proxyToUse,
824
834
  renderCache,
825
835
  props,
@@ -1430,7 +1440,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1430
1440
  if (delayEnter) {
1431
1441
  activeBranch.transition.afterLeave = () => {
1432
1442
  if (pendingId === suspense.pendingId) {
1433
- move(pendingBranch, container2, anchor2, 0);
1443
+ move(
1444
+ pendingBranch,
1445
+ container2,
1446
+ next(activeBranch),
1447
+ 0
1448
+ );
1434
1449
  queuePostFlushCb(effects);
1435
1450
  }
1436
1451
  };
@@ -1477,7 +1492,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1477
1492
  }
1478
1493
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
1479
1494
  triggerEvent(vnode2, "onFallback");
1480
- const anchor2 = next(activeBranch);
1481
1495
  const mountFallback = () => {
1482
1496
  if (!suspense.isInFallback) {
1483
1497
  return;
@@ -1486,7 +1500,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1486
1500
  null,
1487
1501
  fallbackVNode,
1488
1502
  container2,
1489
- anchor2,
1503
+ next(activeBranch),
1490
1504
  parentComponent2,
1491
1505
  null,
1492
1506
  // fallback tree will not have suspense context
@@ -1781,6 +1795,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
1781
1795
  let onCleanup = (fn) => {
1782
1796
  cleanup = effect.onStop = () => {
1783
1797
  callWithErrorHandling(fn, instance, 4);
1798
+ cleanup = effect.onStop = void 0;
1784
1799
  };
1785
1800
  };
1786
1801
  let ssrCleanup;
@@ -2274,7 +2289,11 @@ function emptyPlaceholder(vnode) {
2274
2289
  }
2275
2290
  }
2276
2291
  function getKeepAliveChild(vnode) {
2277
- return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : void 0 : vnode;
2292
+ return isKeepAlive(vnode) ? (
2293
+ // #7121 ensure get the child component subtree in case
2294
+ // it's been replaced during HMR
2295
+ !!(process.env.NODE_ENV !== "production") && vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0
2296
+ ) : vnode;
2278
2297
  }
2279
2298
  function setTransitionHooks(vnode, hooks) {
2280
2299
  if (vnode.shapeFlag & 6 && vnode.component) {
@@ -4277,6 +4296,9 @@ function assertType(value, type) {
4277
4296
  };
4278
4297
  }
4279
4298
  function getInvalidTypeMessage(name, value, expectedTypes) {
4299
+ if (expectedTypes.length === 0) {
4300
+ return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
4301
+ }
4280
4302
  let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
4281
4303
  const expectedType = expectedTypes[0];
4282
4304
  const receivedType = toRawType(value);
@@ -4546,6 +4568,20 @@ function createHydrationFunctions(rendererInternals) {
4546
4568
  const { type, ref, shapeFlag, patchFlag } = vnode;
4547
4569
  let domType = node.nodeType;
4548
4570
  vnode.el = node;
4571
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
4572
+ if (!("__vnode" in node)) {
4573
+ Object.defineProperty(node, "__vnode", {
4574
+ value: vnode,
4575
+ enumerable: false
4576
+ });
4577
+ }
4578
+ if (!("__vueParentComponent" in node)) {
4579
+ Object.defineProperty(node, "__vueParentComponent", {
4580
+ value: parentComponent,
4581
+ enumerable: false
4582
+ });
4583
+ }
4584
+ }
4549
4585
  if (patchFlag === -2) {
4550
4586
  optimized = false;
4551
4587
  vnode.dynamicChildren = null;
@@ -4707,15 +4743,16 @@ function createHydrationFunctions(rendererInternals) {
4707
4743
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4708
4744
  optimized = optimized || !!vnode.dynamicChildren;
4709
4745
  const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4710
- const forcePatchValue = type === "input" && dirs || type === "option";
4711
- if (!!(process.env.NODE_ENV !== "production") || forcePatchValue || patchFlag !== -1) {
4746
+ const forcePatch = type === "input" || type === "option";
4747
+ if (!!(process.env.NODE_ENV !== "production") || forcePatch || patchFlag !== -1) {
4712
4748
  if (dirs) {
4713
4749
  invokeDirectiveHook(vnode, null, parentComponent, "created");
4714
4750
  }
4715
4751
  if (props) {
4716
- if (forcePatchValue || !optimized || patchFlag & (16 | 32)) {
4752
+ if (forcePatch || !optimized || patchFlag & (16 | 32)) {
4717
4753
  for (const key in props) {
4718
- if (forcePatchValue && key.endsWith("value") || isOn(key) && !isReservedProp(key)) {
4754
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4755
+ key[0] === ".") {
4719
4756
  patchProp(
4720
4757
  el,
4721
4758
  key,
@@ -6506,6 +6543,7 @@ const resolveTarget = (props, select) => {
6506
6543
  }
6507
6544
  };
6508
6545
  const TeleportImpl = {
6546
+ name: "Teleport",
6509
6547
  __isTeleport: true,
6510
6548
  process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
6511
6549
  const {
@@ -6927,7 +6965,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
6927
6965
  if (!!(process.env.NODE_ENV !== "production") && shapeFlag & 4 && isProxy(type)) {
6928
6966
  type = toRaw(type);
6929
6967
  warn(
6930
- `Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
6968
+ `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
6931
6969
  `
6932
6970
  Component that was made reactive: `,
6933
6971
  type
@@ -7584,9 +7622,9 @@ function initCustomFormatter() {
7584
7622
  return;
7585
7623
  }
7586
7624
  const vueStyle = { style: "color:#3ba776" };
7587
- const numberStyle = { style: "color:#0b1bc9" };
7588
- const stringStyle = { style: "color:#b62e24" };
7589
- const keywordStyle = { style: "color:#9d288c" };
7625
+ const numberStyle = { style: "color:#1677ff" };
7626
+ const stringStyle = { style: "color:#f5222d" };
7627
+ const keywordStyle = { style: "color:#eb2f96" };
7590
7628
  const formatter = {
7591
7629
  header(obj) {
7592
7630
  if (!isObject(obj)) {
@@ -7780,7 +7818,7 @@ function isMemoSame(cached, memo) {
7780
7818
  return true;
7781
7819
  }
7782
7820
 
7783
- const version = "3.3.8";
7821
+ const version = "3.3.10";
7784
7822
  const _ssrUtils = {
7785
7823
  createComponentInstance,
7786
7824
  setupComponent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.3.8",
3
+ "version": "3.3.10",
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.3.8",
36
- "@vue/reactivity": "3.3.8"
35
+ "@vue/shared": "3.3.10",
36
+ "@vue/reactivity": "3.3.10"
37
37
  }
38
38
  }