@vue/runtime-core 3.5.0-alpha.1 → 3.5.0-alpha.2

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.0-alpha.1
2
+ * @vue/runtime-core v3.5.0-alpha.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -157,7 +157,9 @@ const ErrorCodes = {
157
157
  "ASYNC_COMPONENT_LOADER": 13,
158
158
  "13": "ASYNC_COMPONENT_LOADER",
159
159
  "SCHEDULER": 14,
160
- "14": "SCHEDULER"
160
+ "14": "SCHEDULER",
161
+ "APP_UNMOUNT_CLEANUP": 15,
162
+ "15": "APP_UNMOUNT_CLEANUP"
161
163
  };
162
164
  const ErrorTypeStrings$1 = {
163
165
  ["sp"]: "serverPrefetch hook",
@@ -188,7 +190,8 @@ const ErrorTypeStrings$1 = {
188
190
  [11]: "app warnHandler",
189
191
  [12]: "ref function",
190
192
  [13]: "async component loader",
191
- [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
193
+ [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core .",
194
+ [15]: "app unmount cleanup function"
192
195
  };
193
196
  function callWithErrorHandling(fn, instance, type, args) {
194
197
  try {
@@ -913,7 +916,7 @@ function renderComponentRoot(instance) {
913
916
  true ? {
914
917
  get attrs() {
915
918
  markAttrsAccessed();
916
- return attrs;
919
+ return reactivity.shallowReadonly(attrs);
917
920
  },
918
921
  slots,
919
922
  emit
@@ -946,7 +949,7 @@ function renderComponentRoot(instance) {
946
949
  propsOptions
947
950
  );
948
951
  }
949
- root = cloneVNode(root, fallthroughAttrs);
952
+ root = cloneVNode(root, fallthroughAttrs, false, true);
950
953
  } else if (!accessedAttrs && root.type !== Comment) {
951
954
  const allAttrs = Object.keys(attrs);
952
955
  const eventAttrs = [];
@@ -980,7 +983,7 @@ function renderComponentRoot(instance) {
980
983
  `Runtime directive used on component with non-element root node. The directives will not function as intended.`
981
984
  );
982
985
  }
983
- root = cloneVNode(root);
986
+ root = cloneVNode(root, null, false, true);
984
987
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
985
988
  }
986
989
  if (vnode.transition) {
@@ -1471,7 +1474,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1471
1474
  let parentSuspenseId;
1472
1475
  const isSuspensible = isVNodeSuspensible(vnode);
1473
1476
  if (isSuspensible) {
1474
- if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
1477
+ if (parentSuspense && parentSuspense.pendingBranch) {
1475
1478
  parentSuspenseId = parentSuspense.pendingId;
1476
1479
  parentSuspense.deps++;
1477
1480
  }
@@ -1783,8 +1786,8 @@ function setActiveBranch(suspense, branch) {
1783
1786
  }
1784
1787
  }
1785
1788
  function isVNodeSuspensible(vnode) {
1786
- var _a;
1787
- return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
1789
+ const suspensible = vnode.props && vnode.props.suspensible;
1790
+ return suspensible != null && suspensible !== false;
1788
1791
  }
1789
1792
 
1790
1793
  const ssrContextKey = Symbol.for("v-scx");
@@ -2041,34 +2044,29 @@ function createPathGetter(ctx, path) {
2041
2044
  return cur;
2042
2045
  };
2043
2046
  }
2044
- function traverse(value, depth, currentDepth = 0, seen) {
2045
- if (!shared.isObject(value) || value["__v_skip"]) {
2047
+ function traverse(value, depth = Infinity, seen) {
2048
+ if (depth <= 0 || !shared.isObject(value) || value["__v_skip"]) {
2046
2049
  return value;
2047
2050
  }
2048
- if (depth && depth > 0) {
2049
- if (currentDepth >= depth) {
2050
- return value;
2051
- }
2052
- currentDepth++;
2053
- }
2054
2051
  seen = seen || /* @__PURE__ */ new Set();
2055
2052
  if (seen.has(value)) {
2056
2053
  return value;
2057
2054
  }
2058
2055
  seen.add(value);
2056
+ depth--;
2059
2057
  if (reactivity.isRef(value)) {
2060
- traverse(value.value, depth, currentDepth, seen);
2058
+ traverse(value.value, depth, seen);
2061
2059
  } else if (shared.isArray(value)) {
2062
2060
  for (let i = 0; i < value.length; i++) {
2063
- traverse(value[i], depth, currentDepth, seen);
2061
+ traverse(value[i], depth, seen);
2064
2062
  }
2065
2063
  } else if (shared.isSet(value) || shared.isMap(value)) {
2066
2064
  value.forEach((v) => {
2067
- traverse(v, depth, currentDepth, seen);
2065
+ traverse(v, depth, seen);
2068
2066
  });
2069
2067
  } else if (shared.isPlainObject(value)) {
2070
2068
  for (const key in value) {
2071
- traverse(value[key], depth, currentDepth, seen);
2069
+ traverse(value[key], depth, seen);
2072
2070
  }
2073
2071
  }
2074
2072
  return value;
@@ -2211,7 +2209,7 @@ const BaseTransitionImpl = {
2211
2209
  instance
2212
2210
  );
2213
2211
  setTransitionHooks(oldInnerChild, leavingHooks);
2214
- if (mode === "out-in") {
2212
+ if (mode === "out-in" && innerChild.type !== Comment) {
2215
2213
  state.isLeaving = true;
2216
2214
  leavingHooks.afterLeave = () => {
2217
2215
  state.isLeaving = false;
@@ -2752,7 +2750,7 @@ const KeepAliveImpl = {
2752
2750
  return () => {
2753
2751
  pendingCacheKey = null;
2754
2752
  if (!slots.default) {
2755
- return current = null;
2753
+ return null;
2756
2754
  }
2757
2755
  const children = slots.default();
2758
2756
  const rawVNode = children[0];
@@ -3858,6 +3856,7 @@ function createAppAPI(render, hydrate) {
3858
3856
  }
3859
3857
  const context = createAppContext();
3860
3858
  const installedPlugins = /* @__PURE__ */ new WeakSet();
3859
+ const pluginCleanupFns = [];
3861
3860
  let isMounted = false;
3862
3861
  const app = context.app = {
3863
3862
  _uid: uid$1++,
@@ -3975,8 +3974,21 @@ If you want to remount the same app, move your app creation logic into a factory
3975
3974
  );
3976
3975
  }
3977
3976
  },
3977
+ onUnmount(cleanupFn) {
3978
+ if (typeof cleanupFn !== "function") {
3979
+ warn$1(
3980
+ `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}`
3981
+ );
3982
+ }
3983
+ pluginCleanupFns.push(cleanupFn);
3984
+ },
3978
3985
  unmount() {
3979
3986
  if (isMounted) {
3987
+ callWithAsyncErrorHandling(
3988
+ pluginCleanupFns,
3989
+ app._instance,
3990
+ 15
3991
+ );
3980
3992
  render(null, app._container);
3981
3993
  {
3982
3994
  app._instance = null;
@@ -4502,7 +4514,7 @@ const initSlots = (instance, children) => {
4502
4514
  const type = children._;
4503
4515
  if (type) {
4504
4516
  shared.extend(slots, children);
4505
- shared.def(slots, "_", type);
4517
+ shared.def(slots, "_", type, true);
4506
4518
  } else {
4507
4519
  normalizeObjectSlots(children, slots);
4508
4520
  }
@@ -7248,8 +7260,8 @@ function guardReactiveProps(props) {
7248
7260
  return null;
7249
7261
  return reactivity.isProxy(props) || isInternalObject(props) ? shared.extend({}, props) : props;
7250
7262
  }
7251
- function cloneVNode(vnode, extraProps, mergeRef = false) {
7252
- const { props, ref, patchFlag, children } = vnode;
7263
+ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
7264
+ const { props, ref, patchFlag, children, transition } = vnode;
7253
7265
  const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
7254
7266
  const cloned = {
7255
7267
  __v_isVNode: true,
@@ -7279,7 +7291,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
7279
7291
  dynamicChildren: vnode.dynamicChildren,
7280
7292
  appContext: vnode.appContext,
7281
7293
  dirs: vnode.dirs,
7282
- transition: vnode.transition,
7294
+ transition,
7283
7295
  // These should technically only be non-null on mounted VNodes. However,
7284
7296
  // they *should* be copied for kept-alive vnodes. So we just always copy
7285
7297
  // them since them being non-null during a mount doesn't affect the logic as
@@ -7293,6 +7305,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
7293
7305
  ctx: vnode.ctx,
7294
7306
  ce: vnode.ce
7295
7307
  };
7308
+ if (transition && cloneTransition) {
7309
+ cloned.transition = transition.clone(cloned);
7310
+ }
7296
7311
  return cloned;
7297
7312
  }
7298
7313
  function deepCloneVNode(vnode) {
@@ -8119,7 +8134,7 @@ function isMemoSame(cached, memo) {
8119
8134
  return true;
8120
8135
  }
8121
8136
 
8122
- const version = "3.5.0-alpha.1";
8137
+ const version = "3.5.0-alpha.2";
8123
8138
  const warn = warn$1 ;
8124
8139
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8125
8140
  const devtools = devtools$1 ;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.0-alpha.1
2
+ * @vue/runtime-core v3.5.0-alpha.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -44,7 +44,9 @@ const ErrorCodes = {
44
44
  "ASYNC_COMPONENT_LOADER": 13,
45
45
  "13": "ASYNC_COMPONENT_LOADER",
46
46
  "SCHEDULER": 14,
47
- "14": "SCHEDULER"
47
+ "14": "SCHEDULER",
48
+ "APP_UNMOUNT_CLEANUP": 15,
49
+ "15": "APP_UNMOUNT_CLEANUP"
48
50
  };
49
51
  const ErrorTypeStrings$1 = {
50
52
  ["sp"]: "serverPrefetch hook",
@@ -75,7 +77,8 @@ const ErrorTypeStrings$1 = {
75
77
  [11]: "app warnHandler",
76
78
  [12]: "ref function",
77
79
  [13]: "async component loader",
78
- [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
80
+ [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core .",
81
+ [15]: "app unmount cleanup function"
79
82
  };
80
83
  function callWithErrorHandling(fn, instance, type, args) {
81
84
  try {
@@ -481,7 +484,7 @@ function renderComponentRoot(instance) {
481
484
  false ? {
482
485
  get attrs() {
483
486
  markAttrsAccessed();
484
- return attrs;
487
+ return shallowReadonly(attrs);
485
488
  },
486
489
  slots,
487
490
  emit
@@ -510,12 +513,12 @@ function renderComponentRoot(instance) {
510
513
  propsOptions
511
514
  );
512
515
  }
513
- root = cloneVNode(root, fallthroughAttrs);
516
+ root = cloneVNode(root, fallthroughAttrs, false, true);
514
517
  }
515
518
  }
516
519
  }
517
520
  if (vnode.dirs) {
518
- root = cloneVNode(root);
521
+ root = cloneVNode(root, null, false, true);
519
522
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
520
523
  }
521
524
  if (vnode.transition) {
@@ -951,7 +954,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
951
954
  let parentSuspenseId;
952
955
  const isSuspensible = isVNodeSuspensible(vnode);
953
956
  if (isSuspensible) {
954
- if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
957
+ if (parentSuspense && parentSuspense.pendingBranch) {
955
958
  parentSuspenseId = parentSuspense.pendingId;
956
959
  parentSuspense.deps++;
957
960
  }
@@ -1239,8 +1242,8 @@ function setActiveBranch(suspense, branch) {
1239
1242
  }
1240
1243
  }
1241
1244
  function isVNodeSuspensible(vnode) {
1242
- var _a;
1243
- return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
1245
+ const suspensible = vnode.props && vnode.props.suspensible;
1246
+ return suspensible != null && suspensible !== false;
1244
1247
  }
1245
1248
 
1246
1249
  const ssrContextKey = Symbol.for("v-scx");
@@ -1451,34 +1454,29 @@ function createPathGetter(ctx, path) {
1451
1454
  return cur;
1452
1455
  };
1453
1456
  }
1454
- function traverse(value, depth, currentDepth = 0, seen) {
1455
- if (!shared.isObject(value) || value["__v_skip"]) {
1457
+ function traverse(value, depth = Infinity, seen) {
1458
+ if (depth <= 0 || !shared.isObject(value) || value["__v_skip"]) {
1456
1459
  return value;
1457
1460
  }
1458
- if (depth && depth > 0) {
1459
- if (currentDepth >= depth) {
1460
- return value;
1461
- }
1462
- currentDepth++;
1463
- }
1464
1461
  seen = seen || /* @__PURE__ */ new Set();
1465
1462
  if (seen.has(value)) {
1466
1463
  return value;
1467
1464
  }
1468
1465
  seen.add(value);
1466
+ depth--;
1469
1467
  if (reactivity.isRef(value)) {
1470
- traverse(value.value, depth, currentDepth, seen);
1468
+ traverse(value.value, depth, seen);
1471
1469
  } else if (shared.isArray(value)) {
1472
1470
  for (let i = 0; i < value.length; i++) {
1473
- traverse(value[i], depth, currentDepth, seen);
1471
+ traverse(value[i], depth, seen);
1474
1472
  }
1475
1473
  } else if (shared.isSet(value) || shared.isMap(value)) {
1476
1474
  value.forEach((v) => {
1477
- traverse(v, depth, currentDepth, seen);
1475
+ traverse(v, depth, seen);
1478
1476
  });
1479
1477
  } else if (shared.isPlainObject(value)) {
1480
1478
  for (const key in value) {
1481
- traverse(value[key], depth, currentDepth, seen);
1479
+ traverse(value[key], depth, seen);
1482
1480
  }
1483
1481
  }
1484
1482
  return value;
@@ -1612,7 +1610,7 @@ const BaseTransitionImpl = {
1612
1610
  instance
1613
1611
  );
1614
1612
  setTransitionHooks(oldInnerChild, leavingHooks);
1615
- if (mode === "out-in") {
1613
+ if (mode === "out-in" && innerChild.type !== Comment) {
1616
1614
  state.isLeaving = true;
1617
1615
  leavingHooks.afterLeave = () => {
1618
1616
  state.isLeaving = false;
@@ -2126,7 +2124,7 @@ const KeepAliveImpl = {
2126
2124
  return () => {
2127
2125
  pendingCacheKey = null;
2128
2126
  if (!slots.default) {
2129
- return current = null;
2127
+ return null;
2130
2128
  }
2131
2129
  const children = slots.default();
2132
2130
  const rawVNode = children[0];
@@ -2993,6 +2991,7 @@ function createAppAPI(render, hydrate) {
2993
2991
  }
2994
2992
  const context = createAppContext();
2995
2993
  const installedPlugins = /* @__PURE__ */ new WeakSet();
2994
+ const pluginCleanupFns = [];
2996
2995
  let isMounted = false;
2997
2996
  const app = context.app = {
2998
2997
  _uid: uid$1++,
@@ -3059,8 +3058,16 @@ function createAppAPI(render, hydrate) {
3059
3058
  return getExposeProxy(vnode.component) || vnode.component.proxy;
3060
3059
  }
3061
3060
  },
3061
+ onUnmount(cleanupFn) {
3062
+ pluginCleanupFns.push(cleanupFn);
3063
+ },
3062
3064
  unmount() {
3063
3065
  if (isMounted) {
3066
+ callWithAsyncErrorHandling(
3067
+ pluginCleanupFns,
3068
+ app._instance,
3069
+ 15
3070
+ );
3064
3071
  render(null, app._container);
3065
3072
  delete app._container.__vue_app__;
3066
3073
  }
@@ -3429,7 +3436,7 @@ const initSlots = (instance, children) => {
3429
3436
  const type = children._;
3430
3437
  if (type) {
3431
3438
  shared.extend(slots, children);
3432
- shared.def(slots, "_", type);
3439
+ shared.def(slots, "_", type, true);
3433
3440
  } else {
3434
3441
  normalizeObjectSlots(children, slots);
3435
3442
  }
@@ -5767,8 +5774,8 @@ function guardReactiveProps(props) {
5767
5774
  return null;
5768
5775
  return reactivity.isProxy(props) || isInternalObject(props) ? shared.extend({}, props) : props;
5769
5776
  }
5770
- function cloneVNode(vnode, extraProps, mergeRef = false) {
5771
- const { props, ref, patchFlag, children } = vnode;
5777
+ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
5778
+ const { props, ref, patchFlag, children, transition } = vnode;
5772
5779
  const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
5773
5780
  const cloned = {
5774
5781
  __v_isVNode: true,
@@ -5798,7 +5805,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
5798
5805
  dynamicChildren: vnode.dynamicChildren,
5799
5806
  appContext: vnode.appContext,
5800
5807
  dirs: vnode.dirs,
5801
- transition: vnode.transition,
5808
+ transition,
5802
5809
  // These should technically only be non-null on mounted VNodes. However,
5803
5810
  // they *should* be copied for kept-alive vnodes. So we just always copy
5804
5811
  // them since them being non-null during a mount doesn't affect the logic as
@@ -5812,6 +5819,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
5812
5819
  ctx: vnode.ctx,
5813
5820
  ce: vnode.ce
5814
5821
  };
5822
+ if (transition && cloneTransition) {
5823
+ cloned.transition = transition.clone(cloned);
5824
+ }
5815
5825
  return cloned;
5816
5826
  }
5817
5827
  function createTextVNode(text = " ", flag = 0) {
@@ -6308,7 +6318,7 @@ function isMemoSame(cached, memo) {
6308
6318
  return true;
6309
6319
  }
6310
6320
 
6311
- const version = "3.5.0-alpha.1";
6321
+ const version = "3.5.0-alpha.2";
6312
6322
  const warn$1 = shared.NOOP;
6313
6323
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6314
6324
  const devtools = void 0;
@@ -255,7 +255,7 @@ export declare function defineOptions<RawBindings = {}, D = {}, C extends Comput
255
255
  /**
256
256
  * props should be defined via defineProps().
257
257
  */
258
- props: never;
258
+ props?: never;
259
259
  /**
260
260
  * emits should be defined via defineEmits().
261
261
  */
@@ -405,7 +405,7 @@ export interface DirectiveBinding<Value = any, Modifiers extends string = string
405
405
  dir: ObjectDirective<any, Value>;
406
406
  }
407
407
  export type DirectiveHook<HostElement = any, Prev = VNode<any, HostElement> | null, Value = any, Modifiers extends string = string, Arg extends string = string> = (el: HostElement, binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode<any, HostElement>, prevVNode: Prev) => void;
408
- type SSRDirectiveHook = (binding: DirectiveBinding, vnode: VNode) => Data | undefined;
408
+ type SSRDirectiveHook<Value = any, Modifiers extends string = string, Arg extends string = string> = (binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode) => Data | undefined;
409
409
  export interface ObjectDirective<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string> {
410
410
  created?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
411
411
  beforeMount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
@@ -414,7 +414,7 @@ export interface ObjectDirective<HostElement = any, Value = any, Modifiers exten
414
414
  updated?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>;
415
415
  beforeUnmount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
416
416
  unmounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
417
- getSSRProps?: SSRDirectiveHook;
417
+ getSSRProps?: SSRDirectiveHook<Value, Modifiers, Arg>;
418
418
  deep?: boolean;
419
419
  }
420
420
  export type FunctionDirective<HostElement = any, V = any, Modifiers extends string = string, Arg extends string = string> = DirectiveHook<HostElement, any, V, Modifiers, Arg>;
@@ -467,7 +467,19 @@ type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props,
467
467
  __isSuspense?: never;
468
468
  new (...args: any[]): T;
469
469
  };
470
- export type CreateComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, 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, {}, string, S, LC, Directives, Exposed, Provide>, I, S, Exposed>;
470
+ /**
471
+ * @deprecated This is no longer used internally, but exported and relied on by
472
+ * existing library types generated by vue-tsc.
473
+ */
474
+ export type CreateComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, 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, {}, string, S>, I, S>;
475
+ /**
476
+ * This is the same as `CreateComponentPublicInstance` but adds local components,
477
+ * global directives, exposed, and provide inference.
478
+ * It changes the arguments order so that we don't need to repeat mixin
479
+ * inference everywhere internally, but it has to be a new type to avoid
480
+ * breaking types that relies on previous arguments order (#10842)
481
+ */
482
+ export type CreateComponentPublicInstanceWithMixins<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, 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, {}, string, S, LC, Directives, Exposed, Provide>, I, S, Exposed>;
471
483
  type ExposedKeys<T, Exposed extends string & keyof T> = '' extends Exposed ? T : Pick<T, Exposed>;
472
484
  export type ComponentPublicInstance<P = {}, // props type extracted from props option
473
485
  B = {}, // raw bindings returned from setup()
@@ -836,7 +848,7 @@ export interface RuntimeCompilerOptions {
836
848
  comments?: boolean;
837
849
  delimiters?: [string, string];
838
850
  }
839
- export 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, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S, LC, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstance<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>, Defaults, false, I, S, LC, Directives>>;
851
+ export 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, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S, LC, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>, Defaults, false, I, S, LC, Directives>>;
840
852
  export type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
841
853
  export type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
842
854
  export interface MethodOptions {
@@ -868,7 +880,7 @@ type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? {
868
880
  interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, I extends ComponentInjectOptions, II extends string, Provide extends ComponentProvideOptions = ComponentProvideOptions> {
869
881
  compatConfig?: CompatConfig;
870
882
  [key: string]: any;
871
- data?: (this: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
883
+ data?: (this: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
872
884
  computed?: C;
873
885
  methods?: M;
874
886
  watch?: ComponentWatchOptions;
@@ -938,6 +950,34 @@ type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M e
938
950
  M: M;
939
951
  Defaults: Defaults;
940
952
  };
953
+ /**
954
+ * @deprecated
955
+ */
956
+ export type ComponentOptionsWithoutProps<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, TE extends ComponentTypeEmits = {}, ResolvedEmits extends EmitsOptions = {} extends E ? TypeEmitsToOptions<TE> : E, PE = Props & EmitsToProps<ResolvedEmits>> = ComponentOptionsBase<PE, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S, LC, Directives, Exposed, Provide> & {
957
+ props?: never;
958
+ /**
959
+ * @private for language-tools use only
960
+ */
961
+ __typeProps?: Props;
962
+ /**
963
+ * @private for language-tools use only
964
+ */
965
+ __typeEmits?: TE;
966
+ } & ThisType<CreateComponentPublicInstanceWithMixins<PE, RawBindings, D, C, M, Mixin, Extends, ResolvedEmits, EE, {}, false, I, S, LC, Directives, Exposed>>;
967
+ /**
968
+ * @deprecated
969
+ */
970
+ export type ComponentOptionsWithArrayProps<PropNames extends string = string, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, Props = Prettify<Readonly<{
971
+ [key in PropNames]?: any;
972
+ } & EmitsToProps<E>>>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S, LC, Directives, Exposed, Provide> & {
973
+ props: PropNames[];
974
+ } & ThisType<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, {}, false, I, S, LC, Directives, Exposed>>;
975
+ /**
976
+ * @deprecated
977
+ */
978
+ export type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsOptions, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, Props = Prettify<Readonly<ExtractPropTypes<PropsOptions> & EmitsToProps<E>>>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S, LC, Directives, Exposed, Provide> & {
979
+ props: PropsOptions & ThisType<void>;
980
+ } & ThisType<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false, I, S, LC, Directives>>;
941
981
 
942
982
  export interface InjectionKey<T> extends Symbol {
943
983
  }
@@ -954,8 +994,8 @@ export declare function hasInjectionContext(): boolean;
954
994
 
955
995
  export type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
956
996
  type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
957
- 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 = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true> = ComponentPublicInstanceConstructor<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
958
- export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstance<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
997
+ 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 = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
998
+ export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
959
999
  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'> & {
960
1000
  props?: (keyof Props)[];
961
1001
  emits?: E | EE[];
@@ -979,7 +1019,7 @@ export declare function defineComponent<TypeProps, RuntimePropsOptions extends C
979
1019
  */
980
1020
  __typeEmits?: TypeEmits;
981
1021
  } & ComponentOptionsBase<ResolvedProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
982
- InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstance<ResolvedProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ResolvedProps, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false>;
1022
+ InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ResolvedProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ResolvedProps, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false>;
983
1023
 
984
1024
  export interface App<HostElement = any> {
985
1025
  version: string;
@@ -988,11 +1028,12 @@ export interface App<HostElement = any> {
988
1028
  use<Options>(plugin: Plugin<Options>, options: Options): this;
989
1029
  mixin(mixin: ComponentOptions): this;
990
1030
  component(name: string): Component | undefined;
991
- component(name: string, component: Component | DefineComponent): this;
1031
+ component<T extends Component | DefineComponent>(name: string, component: T): this;
992
1032
  directive<T = any, V = any>(name: string): Directive<T, V> | undefined;
993
1033
  directive<T = any, V = any>(name: string, directive: Directive<T, V>): this;
994
1034
  mount(rootContainer: HostElement | string, isHydrate?: boolean, namespace?: boolean | ElementNamespace): ComponentPublicInstance;
995
1035
  unmount(): void;
1036
+ onUnmount(cb: () => void): void;
996
1037
  provide<T>(key: InjectionKey<T> | string, value: T): this;
997
1038
  /**
998
1039
  * Runs a function with the app as active instance. This allows using of `inject()` within the function to get access
@@ -1221,7 +1262,7 @@ export declare function createBaseVNode(type: VNodeTypes | ClassComponent | type
1221
1262
  export declare const createVNode: typeof _createVNode;
1222
1263
  declare function _createVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, isBlockNode?: boolean): VNode;
1223
1264
  export declare function guardReactiveProps(props: (Data & VNodeProps) | null): (Data & VNodeProps) | null;
1224
- export declare function cloneVNode<T, U>(vnode: VNode<T, U>, extraProps?: (Data & VNodeProps) | null, mergeRef?: boolean): VNode<T, U>;
1265
+ export declare function cloneVNode<T, U>(vnode: VNode<T, U>, extraProps?: (Data & VNodeProps) | null, mergeRef?: boolean, cloneTransition?: boolean): VNode<T, U>;
1225
1266
  /**
1226
1267
  * @private
1227
1268
  */
@@ -1506,7 +1547,8 @@ export declare enum ErrorCodes {
1506
1547
  APP_WARN_HANDLER = 11,
1507
1548
  FUNCTION_REF = 12,
1508
1549
  ASYNC_COMPONENT_LOADER = 13,
1509
- SCHEDULER = 14
1550
+ SCHEDULER = 14,
1551
+ APP_UNMOUNT_CLEANUP = 15
1510
1552
  }
1511
1553
  type ErrorTypes = LifecycleHooks | ErrorCodes;
1512
1554
  export declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any;
@@ -1671,7 +1713,8 @@ export type CompatVue = Pick<App, 'version' | 'component' | 'directive'> & {
1671
1713
  version: string;
1672
1714
  config: AppConfig & LegacyConfig;
1673
1715
  nextTick: typeof nextTick;
1674
- use(plugin: Plugin, ...options: any[]): CompatVue;
1716
+ use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: Options): CompatVue;
1717
+ use<Options>(plugin: Plugin<Options>, options: Options): CompatVue;
1675
1718
  mixin(mixin: ComponentOptions): CompatVue;
1676
1719
  component(name: string): Component | undefined;
1677
1720
  component(name: string, component: Component): CompatVue;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.0-alpha.1
2
+ * @vue/runtime-core v3.5.0-alpha.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -157,7 +157,9 @@ const ErrorCodes = {
157
157
  "ASYNC_COMPONENT_LOADER": 13,
158
158
  "13": "ASYNC_COMPONENT_LOADER",
159
159
  "SCHEDULER": 14,
160
- "14": "SCHEDULER"
160
+ "14": "SCHEDULER",
161
+ "APP_UNMOUNT_CLEANUP": 15,
162
+ "15": "APP_UNMOUNT_CLEANUP"
161
163
  };
162
164
  const ErrorTypeStrings$1 = {
163
165
  ["sp"]: "serverPrefetch hook",
@@ -188,7 +190,8 @@ const ErrorTypeStrings$1 = {
188
190
  [11]: "app warnHandler",
189
191
  [12]: "ref function",
190
192
  [13]: "async component loader",
191
- [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
193
+ [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core .",
194
+ [15]: "app unmount cleanup function"
192
195
  };
193
196
  function callWithErrorHandling(fn, instance, type, args) {
194
197
  try {
@@ -915,7 +918,7 @@ function renderComponentRoot(instance) {
915
918
  !!(process.env.NODE_ENV !== "production") ? {
916
919
  get attrs() {
917
920
  markAttrsAccessed();
918
- return attrs;
921
+ return shallowReadonly(attrs);
919
922
  },
920
923
  slots,
921
924
  emit
@@ -948,7 +951,7 @@ function renderComponentRoot(instance) {
948
951
  propsOptions
949
952
  );
950
953
  }
951
- root = cloneVNode(root, fallthroughAttrs);
954
+ root = cloneVNode(root, fallthroughAttrs, false, true);
952
955
  } else if (!!(process.env.NODE_ENV !== "production") && !accessedAttrs && root.type !== Comment) {
953
956
  const allAttrs = Object.keys(attrs);
954
957
  const eventAttrs = [];
@@ -982,7 +985,7 @@ function renderComponentRoot(instance) {
982
985
  `Runtime directive used on component with non-element root node. The directives will not function as intended.`
983
986
  );
984
987
  }
985
- root = cloneVNode(root);
988
+ root = cloneVNode(root, null, false, true);
986
989
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
987
990
  }
988
991
  if (vnode.transition) {
@@ -1473,7 +1476,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1473
1476
  let parentSuspenseId;
1474
1477
  const isSuspensible = isVNodeSuspensible(vnode);
1475
1478
  if (isSuspensible) {
1476
- if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
1479
+ if (parentSuspense && parentSuspense.pendingBranch) {
1477
1480
  parentSuspenseId = parentSuspense.pendingId;
1478
1481
  parentSuspense.deps++;
1479
1482
  }
@@ -1785,8 +1788,8 @@ function setActiveBranch(suspense, branch) {
1785
1788
  }
1786
1789
  }
1787
1790
  function isVNodeSuspensible(vnode) {
1788
- var _a;
1789
- return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
1791
+ const suspensible = vnode.props && vnode.props.suspensible;
1792
+ return suspensible != null && suspensible !== false;
1790
1793
  }
1791
1794
 
1792
1795
  const ssrContextKey = Symbol.for("v-scx");
@@ -2043,34 +2046,29 @@ function createPathGetter(ctx, path) {
2043
2046
  return cur;
2044
2047
  };
2045
2048
  }
2046
- function traverse(value, depth, currentDepth = 0, seen) {
2047
- if (!isObject(value) || value["__v_skip"]) {
2049
+ function traverse(value, depth = Infinity, seen) {
2050
+ if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
2048
2051
  return value;
2049
2052
  }
2050
- if (depth && depth > 0) {
2051
- if (currentDepth >= depth) {
2052
- return value;
2053
- }
2054
- currentDepth++;
2055
- }
2056
2053
  seen = seen || /* @__PURE__ */ new Set();
2057
2054
  if (seen.has(value)) {
2058
2055
  return value;
2059
2056
  }
2060
2057
  seen.add(value);
2058
+ depth--;
2061
2059
  if (isRef(value)) {
2062
- traverse(value.value, depth, currentDepth, seen);
2060
+ traverse(value.value, depth, seen);
2063
2061
  } else if (isArray(value)) {
2064
2062
  for (let i = 0; i < value.length; i++) {
2065
- traverse(value[i], depth, currentDepth, seen);
2063
+ traverse(value[i], depth, seen);
2066
2064
  }
2067
2065
  } else if (isSet(value) || isMap(value)) {
2068
2066
  value.forEach((v) => {
2069
- traverse(v, depth, currentDepth, seen);
2067
+ traverse(v, depth, seen);
2070
2068
  });
2071
2069
  } else if (isPlainObject(value)) {
2072
2070
  for (const key in value) {
2073
- traverse(value[key], depth, currentDepth, seen);
2071
+ traverse(value[key], depth, seen);
2074
2072
  }
2075
2073
  }
2076
2074
  return value;
@@ -2213,7 +2211,7 @@ const BaseTransitionImpl = {
2213
2211
  instance
2214
2212
  );
2215
2213
  setTransitionHooks(oldInnerChild, leavingHooks);
2216
- if (mode === "out-in") {
2214
+ if (mode === "out-in" && innerChild.type !== Comment) {
2217
2215
  state.isLeaving = true;
2218
2216
  leavingHooks.afterLeave = () => {
2219
2217
  state.isLeaving = false;
@@ -2756,7 +2754,7 @@ const KeepAliveImpl = {
2756
2754
  return () => {
2757
2755
  pendingCacheKey = null;
2758
2756
  if (!slots.default) {
2759
- return current = null;
2757
+ return null;
2760
2758
  }
2761
2759
  const children = slots.default();
2762
2760
  const rawVNode = children[0];
@@ -3864,6 +3862,7 @@ function createAppAPI(render, hydrate) {
3864
3862
  }
3865
3863
  const context = createAppContext();
3866
3864
  const installedPlugins = /* @__PURE__ */ new WeakSet();
3865
+ const pluginCleanupFns = [];
3867
3866
  let isMounted = false;
3868
3867
  const app = context.app = {
3869
3868
  _uid: uid$1++,
@@ -3983,8 +3982,21 @@ If you want to remount the same app, move your app creation logic into a factory
3983
3982
  );
3984
3983
  }
3985
3984
  },
3985
+ onUnmount(cleanupFn) {
3986
+ if (!!(process.env.NODE_ENV !== "production") && typeof cleanupFn !== "function") {
3987
+ warn$1(
3988
+ `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}`
3989
+ );
3990
+ }
3991
+ pluginCleanupFns.push(cleanupFn);
3992
+ },
3986
3993
  unmount() {
3987
3994
  if (isMounted) {
3995
+ callWithAsyncErrorHandling(
3996
+ pluginCleanupFns,
3997
+ app._instance,
3998
+ 15
3999
+ );
3988
4000
  render(null, app._container);
3989
4001
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
3990
4002
  app._instance = null;
@@ -4510,7 +4522,7 @@ const initSlots = (instance, children) => {
4510
4522
  const type = children._;
4511
4523
  if (type) {
4512
4524
  extend(slots, children);
4513
- def(slots, "_", type);
4525
+ def(slots, "_", type, true);
4514
4526
  } else {
4515
4527
  normalizeObjectSlots(children, slots);
4516
4528
  }
@@ -7304,8 +7316,8 @@ function guardReactiveProps(props) {
7304
7316
  return null;
7305
7317
  return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
7306
7318
  }
7307
- function cloneVNode(vnode, extraProps, mergeRef = false) {
7308
- const { props, ref, patchFlag, children } = vnode;
7319
+ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
7320
+ const { props, ref, patchFlag, children, transition } = vnode;
7309
7321
  const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
7310
7322
  const cloned = {
7311
7323
  __v_isVNode: true,
@@ -7335,7 +7347,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
7335
7347
  dynamicChildren: vnode.dynamicChildren,
7336
7348
  appContext: vnode.appContext,
7337
7349
  dirs: vnode.dirs,
7338
- transition: vnode.transition,
7350
+ transition,
7339
7351
  // These should technically only be non-null on mounted VNodes. However,
7340
7352
  // they *should* be copied for kept-alive vnodes. So we just always copy
7341
7353
  // them since them being non-null during a mount doesn't affect the logic as
@@ -7349,6 +7361,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
7349
7361
  ctx: vnode.ctx,
7350
7362
  ce: vnode.ce
7351
7363
  };
7364
+ if (transition && cloneTransition) {
7365
+ cloned.transition = transition.clone(cloned);
7366
+ }
7352
7367
  return cloned;
7353
7368
  }
7354
7369
  function deepCloneVNode(vnode) {
@@ -8189,7 +8204,7 @@ function isMemoSame(cached, memo) {
8189
8204
  return true;
8190
8205
  }
8191
8206
 
8192
- const version = "3.5.0-alpha.1";
8207
+ const version = "3.5.0-alpha.2";
8193
8208
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8194
8209
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8195
8210
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.5.0-alpha.1",
3
+ "version": "3.5.0-alpha.2",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
48
48
  "dependencies": {
49
- "@vue/shared": "3.5.0-alpha.1",
50
- "@vue/reactivity": "3.5.0-alpha.1"
49
+ "@vue/shared": "3.5.0-alpha.2",
50
+ "@vue/reactivity": "3.5.0-alpha.2"
51
51
  }
52
52
  }