@vue/runtime-core 3.6.0-rc.14 → 3.6.0-rc.15

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,10 +1,10 @@
1
1
  /**
2
- * @vue/runtime-core v3.6.0-rc.14
2
+ * @vue/runtime-core v3.6.0-rc.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- import { EffectScope, EffectScope as EffectScope$1, ReactiveEffect, ReactiveEffect as ReactiveEffect$1, TrackOpTypes, TriggerOpTypes, WatcherEffect, computed as computed$1, customRef, customRef as customRef$1, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isProxy as isProxy$1, isReactive, isReactive as isReactive$1, isReadonly, isReadonly as isReadonly$1, isRef, isRef as isRef$1, isShallow, isShallow as isShallow$1, markRaw, markRaw as markRaw$1, onScopeDispose, onWatcherCleanup, proxyRefs, proxyRefs as proxyRefs$1, reactive, reactive as reactive$1, readonly, readonly as readonly$1, ref, ref as ref$1, setActiveSub, setCurrentScope, shallowReactive, shallowReactive as shallowReactive$1, shallowReadArray, shallowReadonly, shallowReadonly as shallowReadonly$1, shallowRef, shallowRef as shallowRef$1, stop, toRaw, toRaw as toRaw$1, toReactive, toReadonly, toRef, toRefs, toValue, track, traverse, trigger, triggerRef, unref } from "@vue/reactivity";
7
- import { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, camelize, camelize as camelize$1, capitalize, capitalize as capitalize$1, def, extend, getEscapedCssVarName, getGlobalThis, getModifierPropName, getSequence, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isBuiltInTag, isFunction, isGloballyAllowed, isKnownHtmlAttr, isKnownSvgAttr, isModelListener, isObject, isOn, isPromise, isRegExp, isRenderableAttrValue, isReservedProp, isString, isSymbol, isVaporBranchStart, looseEqual, looseToNumber, makeMap, normalizeClass, normalizeClass as normalizeClass$1, normalizeCssVarValue, normalizeProps, normalizeStyle, normalizeStyle as normalizeStyle$1, remove, stringifyStyle, toDisplayString, toHandlerKey, toHandlerKey as toHandlerKey$1, toNumber, toRawType } from "@vue/shared";
6
+ import { EffectScope, EffectScope as EffectScope$1, ReactiveEffect, ReactiveEffect as ReactiveEffect$1, TrackOpTypes, TriggerOpTypes, WatcherEffect, computed as computed$1, customRef, customRef as customRef$1, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isProxy as isProxy$1, isReactive, isReactive as isReactive$1, isReadonly, isReadonly as isReadonly$1, isRef, isRef as isRef$1, isShallow, isShallow as isShallow$1, markRaw, markRaw as markRaw$1, onScopeDispose, onScopeDispose as onScopeDispose$1, onWatcherCleanup, proxyRefs, proxyRefs as proxyRefs$1, reactive, reactive as reactive$1, readonly, readonly as readonly$1, ref, ref as ref$1, setActiveSub, setCurrentScope, shallowReactive, shallowReactive as shallowReactive$1, shallowReadArray, shallowReadonly, shallowReadonly as shallowReadonly$1, shallowRef, shallowRef as shallowRef$1, stop, toRaw, toRaw as toRaw$1, toReactive, toReadonly, toRef, toRefs, toValue, track, traverse, trigger, triggerRef, unref } from "@vue/reactivity";
7
+ import { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, camelize, camelize as camelize$1, capitalize, capitalize as capitalize$1, def, extend, getEscapedCssVarName, getGlobalThis, getModifierPropName, getSequence, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isBuiltInTag, isFunction, isGloballyAllowed, isKnownHtmlAttr, isKnownSvgAttr, isModelListener, isObject, isOn, isPromise, isRegExp, isRenderableAttrValue, isReservedProp, isString, isSymbol, isVaporBranchStart, isVaporRangeStart, looseEqual, looseToNumber, makeMap, normalizeClass, normalizeClass as normalizeClass$1, normalizeCssVarValue, normalizeProps, normalizeStyle, normalizeStyle as normalizeStyle$1, rangeCloseOf, remove, stringifyStyle, toDisplayString, toHandlerKey, toHandlerKey as toHandlerKey$1, toNumber, toRawType } from "@vue/shared";
8
8
  //#region packages/runtime-core/src/warning.ts
9
9
  const stack = [];
10
10
  /**
@@ -198,7 +198,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
198
198
  if (isFunction(fn)) {
199
199
  const res = callWithErrorHandling(fn, instance, type, args);
200
200
  if (res && isPromise(res)) res.catch((err) => {
201
- handleError(err, instance, type);
201
+ handleError(err, instance, type, void 0, true);
202
202
  });
203
203
  return res;
204
204
  }
@@ -208,7 +208,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
208
208
  return values;
209
209
  } else if (!!(process.env.NODE_ENV !== "production")) warn$1(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`);
210
210
  }
211
- function handleError(err, instance, type, throwInDev = true) {
211
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
212
212
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
213
213
  if (instance) {
214
214
  let cur = instance.parent;
@@ -216,7 +216,7 @@ function handleError(err, instance, type, throwInDev = true) {
216
216
  const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;
217
217
  while (cur) {
218
218
  const errorCapturedHooks = cur.ec;
219
- if (errorCapturedHooks) {
219
+ if (errorCapturedHooks && !cur.isUnmounted && (!isAsyncError || cur.scope.active)) {
220
220
  for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
221
221
  }
222
222
  cur = cur.parent;
@@ -255,7 +255,9 @@ const SchedulerJobFlags = {
255
255
  "DISPOSED": 4,
256
256
  "4": "DISPOSED",
257
257
  "REQUEUE_ON_SUSPENSE_DISCARD": 8,
258
- "8": "REQUEUE_ON_SUSPENSE_DISCARD"
258
+ "8": "REQUEUE_ON_SUSPENSE_DISCARD",
259
+ "FLUSH_ON_SUSPENSE_RESOLVE": 16,
260
+ "16": "FLUSH_ON_SUSPENSE_RESOLVE"
259
261
  };
260
262
  const jobs = [];
261
263
  let postJobs = [];
@@ -532,7 +534,11 @@ function reload(id, newComp) {
532
534
  updateComponentDef(record.initialDef, newComp);
533
535
  const instances = [...record.instances];
534
536
  if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
535
- for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
537
+ for (const instance of instances) {
538
+ if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
539
+ const oldComp = normalizeClassComponent(instance.type);
540
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
541
+ }
536
542
  const dirtyInstances = new Set(instances);
537
543
  const rerenderedParents = /* @__PURE__ */ new Set();
538
544
  runWithHmrUpdating(() => {
@@ -573,7 +579,25 @@ function reload(id, newComp) {
573
579
  if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
574
580
  }
575
581
  parents.forEach((parent) => {
576
- queueJob(() => {
582
+ const children = instances.filter((instance) => instance.parent === parent);
583
+ const update = () => {
584
+ if (!parent.scope.active) return;
585
+ const activeChildren = children.filter((instance) => instance.scope.active);
586
+ if (!activeChildren.length) return;
587
+ const pending = activeChildren.find((instance) => instance.asyncDep && !instance.asyncResolved) || locateUnresolvedAsyncRoot(parent);
588
+ if (pending) {
589
+ pending.asyncDep.catch(NOOP).then(() => {
590
+ if (parent.scope.active && (pending.asyncResolved || !pending.scope.active)) queueJob(update);
591
+ });
592
+ return;
593
+ }
594
+ for (const instance of activeChildren) {
595
+ const oldComp = normalizeClassComponent(instance.type);
596
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
597
+ if (!dirtyInstances) hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
598
+ dirtyInstances.add(instance);
599
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
600
+ }
577
601
  runWithHmrUpdating(() => {
578
602
  if (parent.vapor) parent.hmrRerender();
579
603
  else {
@@ -584,7 +608,12 @@ function reload(id, newComp) {
584
608
  }
585
609
  }
586
610
  });
587
- });
611
+ queuePostFlushCb(() => {
612
+ hmrDirtyComponents.clear();
613
+ hmrDirtyComponentsMode.clear();
614
+ });
615
+ };
616
+ queueJob(update);
588
617
  });
589
618
  }
590
619
  queuePostFlushCb(() => {
@@ -781,18 +810,35 @@ function withDirectives(vnode, directives) {
781
810
  return vnode;
782
811
  }
783
812
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
784
- const bindings = vnode.dirs;
813
+ let hookVNode = vnode;
814
+ if (name === "beforeMount") vnode._mount = vnode;
815
+ else if (name === "beforeUpdate") {
816
+ const mount = prevVNode && prevVNode._mount;
817
+ if (mount) {
818
+ mount._latest = vnode;
819
+ vnode._mount = mount;
820
+ }
821
+ } else if (name === "mounted") {
822
+ const latest = vnode._latest;
823
+ vnode._mount = vnode._latest = void 0;
824
+ if (latest) {
825
+ hookVNode = latest;
826
+ latest._mount = void 0;
827
+ }
828
+ }
829
+ const bindings = hookVNode.dirs;
785
830
  const oldBindings = prevVNode && prevVNode.dirs;
786
831
  for (let i = 0; i < bindings.length; i++) {
787
- const binding = bindings[i];
832
+ let binding = bindings[i];
788
833
  if (oldBindings) binding.oldValue = oldBindings[i].value;
834
+ else if (name === "mounted" && binding.oldValue !== void 0) binding = extend({}, binding, { oldValue: void 0 });
789
835
  let hook = binding.dir[name];
790
836
  if (hook) {
791
837
  const prevSub = setActiveSub();
792
838
  callWithAsyncErrorHandling(hook, instance, 8, [
793
839
  vnode.el,
794
840
  binding,
795
- vnode,
841
+ hookVNode,
796
842
  prevVNode
797
843
  ]);
798
844
  setActiveSub(prevSub);
@@ -1237,7 +1283,15 @@ const BaseTransitionImpl = {
1237
1283
  const { mode } = rawProps;
1238
1284
  checkTransitionMode(mode);
1239
1285
  return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
1240
- if (!(instance.effect.flags & 1024)) instance.update();
1286
+ if (!(instance.effect.flags & 1024)) {
1287
+ if (instance.effect.running) {
1288
+ const job = () => {
1289
+ if (!(instance.effect.flags & 1024)) instance.update();
1290
+ };
1291
+ job.i = instance;
1292
+ queueJob(job);
1293
+ } else instance.update();
1294
+ }
1241
1295
  }) : NOOP);
1242
1296
  };
1243
1297
  }
@@ -1268,7 +1322,7 @@ function getLeavingNodesForType(state, vnode) {
1268
1322
  }
1269
1323
  return leavingVNodesCache;
1270
1324
  }
1271
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1325
+ function resolveTransitionHooks(vnode, props, state, instance) {
1272
1326
  const key = String(vnode.key);
1273
1327
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
1274
1328
  const hooks = baseResolveTransitionHooks({
@@ -1291,9 +1345,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1291
1345
  }
1292
1346
  },
1293
1347
  cloneHooks: (vnode) => {
1294
- const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
1295
- if (postClone) postClone(hooks);
1296
- return hooks;
1348
+ return resolveTransitionHooks(vnode, props, state, instance);
1297
1349
  }
1298
1350
  }, props, state, instance);
1299
1351
  if (isVaporInteropEnabled && vnode.type === VaporSlot) extend(hooks, {
@@ -1331,7 +1383,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
1331
1383
  callHook(hook, [el]);
1332
1384
  },
1333
1385
  enter(el) {
1334
- if (!isHmrUpdating && isLeaving()) return;
1386
+ if (!isHmrUpdating && isLeaving(el)) return;
1335
1387
  let hook = onEnter;
1336
1388
  let afterHook = onAfterEnter;
1337
1389
  let cancelHook = onEnterCancelled;
@@ -1375,7 +1427,19 @@ function baseResolveTransitionHooks(context, props, state, instance) {
1375
1427
  else done();
1376
1428
  },
1377
1429
  clone(node) {
1378
- return cloneHooks ? cloneHooks(node) : hooks;
1430
+ if (!cloneHooks) return hooks;
1431
+ const cloned = cloneHooks(node);
1432
+ cloned.afterLeave = () => {
1433
+ if (hooks.afterLeave) hooks.afterLeave();
1434
+ };
1435
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
1436
+ if (hooks.delayLeave) hooks.delayLeave(el, earlyRemove, delayedLeave);
1437
+ else delayedLeave();
1438
+ };
1439
+ cloned.delayedLeave = () => {
1440
+ if (hooks.delayedLeave) hooks.delayedLeave();
1441
+ };
1442
+ return cloned;
1379
1443
  }
1380
1444
  };
1381
1445
  return hooks;
@@ -1410,10 +1474,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
1410
1474
  if (state.isLeaving) return emptyPlaceholder(next);
1411
1475
  const nextInner = getInnerChild$1(next);
1412
1476
  if (!nextInner) return emptyPlaceholder(next);
1413
- let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
1414
- if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
1415
- enterHooks = hooks;
1416
- });
1477
+ const enterHooks = resolveTransitionHooks(nextInner, props, state, instance);
1417
1478
  if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
1418
1479
  if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
1419
1480
  const mode = props.mode;
@@ -1497,9 +1558,14 @@ function setTransitionHooks(vnode, hooks) {
1497
1558
  return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
1498
1559
  }
1499
1560
  } else if (vnode.shapeFlag & 128) {
1500
- const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1501
- const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1502
- return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
1561
+ const suspense = vnode.suspense;
1562
+ if (suspense) {
1563
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
1564
+ if (branch) return setTransitionHooks(branch, hooks.clone(branch));
1565
+ } else {
1566
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1567
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1568
+ }
1503
1569
  } else {
1504
1570
  vnode.transition = hooks;
1505
1571
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -1727,7 +1793,7 @@ const getContainerType = (container) => {
1727
1793
  };
1728
1794
  const isComment = (node) => node.nodeType === 8;
1729
1795
  /** The data of a comment opening a range a hydration steps over as one. */
1730
- const isRangeStart = (data) => data === "[" || data === "(" || isVaporBranchStart(data);
1796
+ const isRangeStart = (data) => data === "[" || data === "(" || isVaporRangeStart(data);
1731
1797
  function createHydrationFunctions(rendererInternals) {
1732
1798
  const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
1733
1799
  const hydrate = (vnode, container) => {
@@ -1747,7 +1813,7 @@ function createHydrationFunctions(rendererInternals) {
1747
1813
  };
1748
1814
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
1749
1815
  optimized = optimized || !!vnode.dynamicChildren;
1750
- const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporBranchStart(node.data));
1816
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporRangeStart(node.data));
1751
1817
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
1752
1818
  const { type, ref, shapeFlag, patchFlag } = vnode;
1753
1819
  let domType = node.nodeType;
@@ -1942,10 +2008,11 @@ function createHydrationFunctions(rendererInternals) {
1942
2008
  const container = parentNode(node);
1943
2009
  const first = nextSibling(node);
1944
2010
  const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
1945
- if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
2011
+ const close = isVaporInteropEnabled ? rangeCloseOf(node.data) : node.data === "(" ? ")" : "]";
2012
+ if (next && isComment(next) && next.data === close) return nextSibling(vnode.anchor = next);
1946
2013
  else {
1947
2014
  logMismatchError();
1948
- insert(vnode.anchor = createComment(`]`), container, next);
2015
+ insert(vnode.anchor = createComment(close), container, next);
1949
2016
  return next;
1950
2017
  }
1951
2018
  };
@@ -1967,13 +2034,13 @@ function createHydrationFunctions(rendererInternals) {
1967
2034
  const container = parentNode(node);
1968
2035
  remove(node);
1969
2036
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
1970
- if (parentComponent && parentComponent.vnode) {
2037
+ if (parentComponent && parentComponent.vnode && parentComponent.vnode.el === node) {
1971
2038
  parentComponent.vnode.el = vnode.el;
1972
2039
  updateHOCHostEl(parentComponent, vnode.el);
1973
2040
  }
1974
2041
  return next;
1975
2042
  };
1976
- const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
2043
+ const locateClosingAnchor = (node, open = node && isComment(node) && (node.data === "(" || isVaporInteropEnabled && node.data === "{") ? node.data : "[", close = isVaporInteropEnabled ? rangeCloseOf(open) : open === "(" ? ")" : "]") => {
1977
2044
  let match = 0;
1978
2045
  while (node) {
1979
2046
  node = nextSibling(node);
@@ -2248,7 +2315,7 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
2248
2315
  function forEachElement(node, cb) {
2249
2316
  if (isComment(node) && isRangeStart(node.data)) {
2250
2317
  const open = node.data;
2251
- const close = open === "(" ? ")" : "]";
2318
+ const close = rangeCloseOf(open);
2252
2319
  let depth = 1;
2253
2320
  let next = node.nextSibling;
2254
2321
  while (next) {
@@ -2285,7 +2352,7 @@ function defineAsyncComponent(source) {
2285
2352
  if (resolvedComp) return () => createInnerComp(resolvedComp, instance);
2286
2353
  const onError = (err) => {
2287
2354
  setPendingRequest(null);
2288
- handleError(err, instance, 13, !errorComponent);
2355
+ handleError(err, instance, 13, !errorComponent, true);
2289
2356
  };
2290
2357
  if (suspensible && instance.suspense || isInSSRComponentSetup) return load().then((comp) => {
2291
2358
  return () => createInnerComp(comp, instance);
@@ -2366,10 +2433,12 @@ const useAsyncComponentState = (delay = 200, timeout, onError, instance = curren
2366
2433
  const delayed = ref$1(!!delay);
2367
2434
  let timeoutTimer;
2368
2435
  let delayTimer;
2369
- if (instance) onUnmounted(() => {
2370
- if (timeoutTimer != null) clearTimeout(timeoutTimer);
2371
- if (delayTimer != null) clearTimeout(delayTimer);
2372
- }, instance);
2436
+ if (instance) instance.scope.run(() => {
2437
+ onScopeDispose$1(() => {
2438
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
2439
+ if (delayTimer != null) clearTimeout(delayTimer);
2440
+ });
2441
+ });
2373
2442
  if (delay) delayTimer = setTimeout(() => {
2374
2443
  if (instance && instance.isUnmounted) return;
2375
2444
  delayed.value = false;
@@ -2404,7 +2473,12 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
2404
2473
  }
2405
2474
  return;
2406
2475
  }
2407
- if (!el.parentNode || wasConnected && !el.isConnected) return;
2476
+ if (!el.parentNode) return;
2477
+ if (wasConnected && !el.isConnected) {
2478
+ let current = instance;
2479
+ while (current && !current.isDeactivated) current = current.parent;
2480
+ if (!current) return;
2481
+ }
2408
2482
  hydrate();
2409
2483
  };
2410
2484
  const doHydrate = hydrateStrategy ? () => {
@@ -2462,7 +2536,11 @@ const KeepAlive = /*@__PURE__*/ withKeepAliveEnabled({
2462
2536
  activate(vnode, container, anchor, renderer, keepAliveInstance, parentSuspense, namespace, optimized);
2463
2537
  };
2464
2538
  sharedContext.deactivate = (vnode) => {
2465
- deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
2539
+ const cached = sharedContext.getCachedComponent(vnode);
2540
+ if (!cached || cached.component !== vnode.component) return false;
2541
+ if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(keepAliveInstance, vnode).deactivate(vnode, storageContainer, parentSuspense);
2542
+ else deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
2543
+ return true;
2466
2544
  };
2467
2545
  function unmount(vnode) {
2468
2546
  resetShapeFlag(vnode);
@@ -2494,11 +2572,15 @@ const KeepAlive = /*@__PURE__*/ withKeepAliveEnabled({
2494
2572
  let pendingCacheKey = null;
2495
2573
  const cacheSubtree = () => {
2496
2574
  if (pendingCacheKey != null) {
2497
- if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
2498
- const vnode = getInnerChild(keepAliveInstance.subTree);
2499
- if (vnode.component) cache.set(pendingCacheKey, vnode);
2500
- }, void 0, keepAliveInstance.subTree.suspense);
2501
- else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
2575
+ if (isSuspense(keepAliveInstance.subTree.type)) {
2576
+ const cacheInnerChild = () => {
2577
+ const vnode = getInnerChild(keepAliveInstance.subTree);
2578
+ if (vnode.component) cache.set(pendingCacheKey, vnode);
2579
+ };
2580
+ const suspense = keepAliveInstance.subTree.suspense;
2581
+ if (suspense.pendingBranch) queuePostRenderEffect(cacheInnerChild, void 0, suspense);
2582
+ else cacheInnerChild();
2583
+ } else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
2502
2584
  }
2503
2585
  };
2504
2586
  onMounted(cacheSubtree);
@@ -2603,9 +2685,8 @@ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance())
2603
2685
  }
2604
2686
  function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
2605
2687
  const injected = injectHook(type, hook, keepAliveRoot, true);
2606
- onUnmounted(() => {
2607
- remove(keepAliveRoot[type], injected);
2608
- }, target);
2688
+ const removal = injectHook("um", () => remove(keepAliveRoot[type], injected), target);
2689
+ removal.flags = 8;
2609
2690
  }
2610
2691
  function resetShapeFlag(vnode) {
2611
2692
  vnode.shapeFlag &= -257;
@@ -2830,6 +2911,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
2830
2911
  ret.props = extend({}, ret.props, { key: branchKey });
2831
2912
  ret.key = branchKey;
2832
2913
  }
2914
+ if (isBlockTreeEnabled <= 0) {
2915
+ if (!ret.vs.props) ret.vs.props = ret.props;
2916
+ ret.props = ret.key != null ? { key: ret.key } : null;
2917
+ ret.vs.attrs = EMPTY_OBJ;
2918
+ }
2833
2919
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
2834
2920
  return ret;
2835
2921
  }
@@ -4674,8 +4760,10 @@ function baseCreateRenderer(options, createHydrationFns) {
4674
4760
  def(el, "__vueParentComponent", parentComponent, true);
4675
4761
  }
4676
4762
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
4677
- if (transition) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
4678
- else hostInsert(el, container, anchor);
4763
+ if (transition) {
4764
+ if (!needTransition(parentSuspense, transition) && !transition.persisted) el[deferredEnterKey] = true;
4765
+ performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
4766
+ } else hostInsert(el, container, anchor);
4679
4767
  if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
4680
4768
  const isHmr = !!(process.env.NODE_ENV !== "production") && isHmrUpdating;
4681
4769
  queuePostRenderEffect(() => {
@@ -4939,16 +5027,20 @@ function baseCreateRenderer(options, createHydrationFns) {
4939
5027
  } else {
4940
5028
  let { next, bu, u, parent, vnode } = instance;
4941
5029
  {
4942
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
4943
- if (nonHydratedAsyncRoot) {
5030
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
5031
+ if (unresolvedAsyncRoot) {
4944
5032
  if (next) {
4945
5033
  next.el = vnode.el;
4946
5034
  updateComponentPreRender(instance, next, optimized);
4947
5035
  }
4948
- nonHydratedAsyncRoot.asyncDep.then(() => {
4949
- queuePostRenderEffect(() => {
4950
- if (!instance.isUnmounted) instance.update();
4951
- }, void 0, parentSuspense);
5036
+ unresolvedAsyncRoot.asyncDep.then(() => {
5037
+ const retry = () => {
5038
+ if (instance.effect.flags & 1024) return;
5039
+ if (parentSuspense && parentSuspense.pendingBranch) queuePostRenderEffect(retry, void 0, parentSuspense);
5040
+ else instance.update();
5041
+ };
5042
+ retry.flags = 24;
5043
+ queuePostRenderEffect(retry, void 0, parentSuspense);
4952
5044
  });
4953
5045
  return;
4954
5046
  }
@@ -4971,7 +5063,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4971
5063
  const prevTree = instance.subTree;
4972
5064
  instance.subTree = nextTree;
4973
5065
  if (!!(process.env.NODE_ENV !== "production")) startMeasure(instance, `patch`);
4974
- patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, namespace);
5066
+ patch(prevTree, nextTree, hostParentNode(prevTree.el || resolveAsyncComponentPlaceholder(prevTree)), getNextHostNode(prevTree), instance, parentSuspense, namespace);
4975
5067
  if (!!(process.env.NODE_ENV !== "production")) endMeasure(instance, `patch`);
4976
5068
  next.el = nextTree.el;
4977
5069
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
@@ -5174,9 +5266,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5174
5266
  }
5175
5267
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
5176
5268
  if (shapeFlag & 256) {
5177
- if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
5178
- else parentComponent.ctx.deactivate(vnode);
5179
- return;
5269
+ if (parentComponent.ctx.deactivate(vnode)) return;
5180
5270
  }
5181
5271
  if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
5182
5272
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
@@ -5256,12 +5346,14 @@ function baseCreateRenderer(options, createHydrationFns) {
5256
5346
  if (effect) {
5257
5347
  effect.stop();
5258
5348
  unmount(subTree, instance, parentSuspense, doRemove);
5259
- } else if (instance.vnode.el && subTree) {
5349
+ } else if (subTree) {
5260
5350
  subTree.transition = instance.vnode.transition;
5261
5351
  unmount(subTree, instance, parentSuspense, doRemove);
5262
5352
  }
5263
5353
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
5264
- queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
5354
+ const markUnmounted = () => instance.isUnmounted = true;
5355
+ markUnmounted.flags = 8;
5356
+ queuePostRenderEffect(markUnmounted, void 0, parentSuspense);
5265
5357
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsComponentRemoved(instance);
5266
5358
  };
5267
5359
  const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
@@ -5375,11 +5467,11 @@ function traverseStaticChildren(n1, n2, shallow = false) {
5375
5467
  if (!!(process.env.NODE_ENV !== "production")) c2.el && (c2.el.__vnode = c2);
5376
5468
  }
5377
5469
  }
5378
- function locateNonHydratedAsyncRoot(instance) {
5470
+ function locateUnresolvedAsyncRoot(instance) {
5379
5471
  const subComponent = instance.subTree && instance.subTree.component;
5380
5472
  if (subComponent) {
5381
5473
  if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
5382
- else return locateNonHydratedAsyncRoot(subComponent);
5474
+ else return locateUnresolvedAsyncRoot(subComponent);
5383
5475
  }
5384
5476
  }
5385
5477
  function invalidateMount(hooks) {
@@ -5449,7 +5541,9 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
5449
5541
  function resolveAsyncComponentPlaceholder(anchorVnode) {
5450
5542
  if (anchorVnode.placeholder) return anchorVnode.placeholder;
5451
5543
  const instance = anchorVnode.component;
5452
- if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
5544
+ if (instance && instance.subTree) return resolveAsyncComponentPlaceholder(instance.subTree);
5545
+ const suspense = anchorVnode.suspense;
5546
+ if (suspense && suspense.activeBranch) return resolveAsyncComponentPlaceholder(suspense.activeBranch);
5453
5547
  return null;
5454
5548
  }
5455
5549
  //#endregion
@@ -5461,17 +5555,22 @@ function withSuspenseEnabled(value) {
5461
5555
  return value;
5462
5556
  }
5463
5557
  let suspenseId = 0;
5558
+ const deferredEnterKey = Symbol("_deferredEnter");
5464
5559
  const Suspense = /*@__PURE__*/ withSuspenseEnabled({
5465
5560
  name: "Suspense",
5466
5561
  __isSuspense: true,
5467
5562
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
5468
5563
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
5469
5564
  else {
5470
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
5471
- n2.suspense = n1.suspense;
5472
- n2.suspense.vnode = n2;
5473
- n2.el = n1.el;
5474
- return;
5565
+ const suspense = n1.suspense;
5566
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
5567
+ const owner = suspense.parentComponent;
5568
+ if (!!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId ? parentSuspense.pendingBranch && !isSameVNodeType(n2.ssContent, suspense.pendingBranch || suspense.activeBranch) : !suspense.isInFallback) {
5569
+ n2.suspense = suspense;
5570
+ suspense.vnode = n2;
5571
+ n2.el = n1.el;
5572
+ return;
5573
+ }
5475
5574
  }
5476
5575
  patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals);
5477
5576
  }
@@ -5483,6 +5582,36 @@ function triggerEvent(vnode, name) {
5483
5582
  const eventListener = vnode.props && vnode.props[name];
5484
5583
  if (isFunction(eventListener)) eventListener();
5485
5584
  }
5585
+ function enterDeferred(suspense, branch) {
5586
+ const enters = [];
5587
+ collectDeferredEnters(branch, enters, true);
5588
+ if (isVaporInteropEnabled) {
5589
+ const { parentComponent } = suspense;
5590
+ const vapor = parentComponent && parentComponent.appContext.vapor;
5591
+ if (vapor) vapor.enterDeferred(suspense, enters);
5592
+ }
5593
+ if (enters.length) queuePostFlushCb(enters);
5594
+ }
5595
+ function collectDeferredEnters(vnode, enters, isRoot) {
5596
+ const { el, transition, children, shapeFlag } = vnode;
5597
+ if (shapeFlag & 6) {
5598
+ const subTree = vnode.component.subTree;
5599
+ if (subTree) collectDeferredEnters(subTree, enters, isRoot);
5600
+ return;
5601
+ }
5602
+ if (shapeFlag & 192) return;
5603
+ if (shapeFlag & 1) {
5604
+ if (!isRoot && el && el[deferredEnterKey]) {
5605
+ el[deferredEnterKey] = void 0;
5606
+ if (transition && !transition.persisted) {
5607
+ transition.beforeEnter(el);
5608
+ enters.push(() => transition.enter(el));
5609
+ }
5610
+ }
5611
+ isRoot = false;
5612
+ }
5613
+ if (shapeFlag & 16) for (let i = 0; i < children.length; i++) collectDeferredEnters(children[i], enters, isRoot);
5614
+ }
5486
5615
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
5487
5616
  const { p: patch, o: { createElement } } = rendererInternals;
5488
5617
  const hiddenContainer = createElement("div");
@@ -5522,11 +5651,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
5522
5651
  suspense.activeBranch = pendingBranch;
5523
5652
  } else unmount(pendingBranch, parentComponent, suspense);
5524
5653
  suspense.deps = 0;
5525
- for (let i = 0; i < suspense.effects.length; i++) {
5526
- const effect = suspense.effects[i];
5527
- if (effect.flags & 8) queuePostFlushCb(effect);
5528
- }
5529
- suspense.effects.length = 0;
5654
+ discardEffects(suspense);
5530
5655
  suspense.hiddenContainer = createElement("div");
5531
5656
  if (isInFallback) {
5532
5657
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
@@ -5549,14 +5674,14 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
5549
5674
  } else {
5550
5675
  triggerEvent(n2, "onPending");
5551
5676
  suspense.pendingBranch = newBranch;
5552
- if (newBranch.shapeFlag & 512) suspense.pendingId = newBranch.component.suspenseId;
5553
- else suspense.pendingId = suspenseId++;
5677
+ suspense.pendingId = suspenseId++;
5554
5678
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
5555
5679
  if (suspense.deps <= 0) suspense.resolve();
5556
5680
  else {
5557
- const { timeout, pendingId } = suspense;
5558
- if (timeout > 0) setTimeout(() => {
5559
- if (suspense.pendingId === pendingId) suspense.fallback(newFallback);
5681
+ const { timeout } = suspense;
5682
+ if (timeout > 0) suspense.timeoutTimer = setTimeout(() => {
5683
+ suspense.timeoutTimer = void 0;
5684
+ suspense.fallback(suspense.vnode.ssFallback);
5560
5685
  }, timeout);
5561
5686
  else if (timeout === 0) suspense.fallback(newFallback);
5562
5687
  }
@@ -5592,6 +5717,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5592
5717
  deps: 0,
5593
5718
  pendingId: suspenseId++,
5594
5719
  timeout: typeof timeout === "number" ? timeout : -1,
5720
+ timeoutTimer: void 0,
5595
5721
  activeBranch: null,
5596
5722
  isFallbackMountPending: false,
5597
5723
  pendingBranch: null,
@@ -5611,26 +5737,39 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5611
5737
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
5612
5738
  let hasUpdatedAnchor = false;
5613
5739
  if (delayEnter) activeBranch.transition.afterLeave = () => {
5614
- if (pendingId === suspense.pendingId) {
5740
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
5741
+ enterDeferred(suspense, pendingBranch);
5615
5742
  move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
5616
5743
  queuePostFlushCb(effects);
5617
5744
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
5618
5745
  }
5619
5746
  };
5620
5747
  if (activeBranch && !suspense.isFallbackMountPending) {
5621
- if (parentNode(activeBranch.el) === container) {
5748
+ if (parentNode(activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)) === container) {
5622
5749
  anchor = next(activeBranch);
5623
5750
  hasUpdatedAnchor = true;
5624
5751
  }
5625
5752
  unmount(activeBranch, parentComponent, suspense, true);
5626
5753
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
5627
5754
  }
5628
- if (!delayEnter) move(pendingBranch, container, anchor, 0, parentComponent);
5755
+ if (!delayEnter) {
5756
+ enterDeferred(suspense, pendingBranch);
5757
+ move(pendingBranch, container, anchor, 0, parentComponent);
5758
+ }
5629
5759
  }
5760
+ clearTimeout(suspense.timeoutTimer);
5761
+ suspense.timeoutTimer = void 0;
5630
5762
  suspense.isFallbackMountPending = false;
5631
5763
  setActiveBranch(suspense, pendingBranch);
5632
5764
  suspense.pendingBranch = null;
5633
5765
  suspense.isInFallback = false;
5766
+ let kept = 0;
5767
+ for (let i = 0; i < effects.length; i++) {
5768
+ const effect = effects[i];
5769
+ if (effect.flags & 16) queuePostFlushCb(effect);
5770
+ else effects[kept++] = effect;
5771
+ }
5772
+ effects.length = kept;
5634
5773
  let parent = suspense.parent;
5635
5774
  let hasUnresolvedAncestor = false;
5636
5775
  while (parent) {
@@ -5653,13 +5792,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5653
5792
  triggerEvent(vnode, "onResolve");
5654
5793
  },
5655
5794
  fallback(fallbackVNode) {
5656
- if (!suspense.pendingBranch) return;
5795
+ if (suspense.isUnmounted || !suspense.pendingBranch) return;
5657
5796
  const { vnode, activeBranch, parentComponent, container, namespace } = suspense;
5658
5797
  triggerEvent(vnode, "onFallback");
5659
5798
  const anchor = next(activeBranch);
5660
5799
  const mountFallback = () => {
5661
5800
  suspense.isFallbackMountPending = false;
5662
- if (!suspense.isInFallback) return;
5801
+ if (suspense.isUnmounted || !suspense.isInFallback) return;
5663
5802
  const latestFallback = suspense.vnode.ssFallback;
5664
5803
  patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
5665
5804
  setActiveBranch(suspense, latestFallback);
@@ -5683,24 +5822,52 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5683
5822
  registerDep(instance, onResolve) {
5684
5823
  const isInPendingSuspense = !!suspense.pendingBranch;
5685
5824
  if (isInPendingSuspense) suspense.deps++;
5825
+ const render = (setupResult) => {
5826
+ instance.asyncResolved = true;
5827
+ onResolve(setupResult);
5828
+ };
5686
5829
  instance.asyncDep.catch((err) => {
5687
- handleError(err, instance, 0);
5830
+ handleError(err, instance, 0, false, true);
5831
+ return () => null;
5688
5832
  }).then((asyncSetupResult) => {
5689
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
5833
+ if (instance.isUnmounted || suspense.isUnmounted) return;
5834
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
5690
5835
  setCurrentInstance(null, void 0);
5691
5836
  if (!instance.scope.active) {
5692
- if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
5837
+ if (isPendingDep && --suspense.deps === 0) suspense.resolve();
5693
5838
  return;
5694
5839
  }
5695
- instance.asyncResolved = true;
5696
- onResolve(asyncSetupResult);
5697
- if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
5840
+ if (!isPendingDep && suspense.pendingBranch) {
5841
+ const job = () => {
5842
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) return;
5843
+ if (suspense.pendingBranch) queueEffectWithSuspense(job, void 0, suspense);
5844
+ else render(asyncSetupResult);
5845
+ };
5846
+ job.flags = 24;
5847
+ queueEffectWithSuspense(job, void 0, suspense);
5848
+ return;
5849
+ }
5850
+ render(asyncSetupResult);
5851
+ if (isPendingDep && --suspense.deps === 0) suspense.resolve();
5698
5852
  });
5699
5853
  },
5700
5854
  unmount(parentSuspense, doRemove) {
5701
5855
  suspense.isUnmounted = true;
5856
+ clearTimeout(suspense.timeoutTimer);
5857
+ suspense.timeoutTimer = void 0;
5858
+ if (parentSuspenseId !== void 0) {
5859
+ const parent = suspense.parent;
5860
+ const pendingId = parentSuspenseId;
5861
+ parentSuspenseId = void 0;
5862
+ queuePostFlushCb(() => {
5863
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) parent.resolve();
5864
+ });
5865
+ }
5702
5866
  if (suspense.activeBranch) unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);
5703
- if (suspense.pendingBranch) unmount(suspense.pendingBranch, parentComponent, parentSuspense, doRemove);
5867
+ if (suspense.pendingBranch) {
5868
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
5869
+ discardEffects(suspense);
5870
+ }
5704
5871
  }
5705
5872
  };
5706
5873
  return suspense;
@@ -5741,6 +5908,14 @@ function normalizeSuspenseSlot(s) {
5741
5908
  if (block && !s.dynamicChildren) s.dynamicChildren = block.filter((c) => c !== s);
5742
5909
  return s;
5743
5910
  }
5911
+ function discardEffects(suspense) {
5912
+ const { effects } = suspense;
5913
+ for (let i = 0; i < effects.length; i++) {
5914
+ const effect = effects[i];
5915
+ if (effect.flags & 8) queuePostFlushCb(effect);
5916
+ }
5917
+ effects.length = 0;
5918
+ }
5744
5919
  function queueEffectWithSuspense(fn, id, suspense) {
5745
5920
  if (suspense && suspense.pendingBranch) {
5746
5921
  if (isArray(fn)) suspense.effects.push(...fn);
@@ -5965,7 +6140,8 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
5965
6140
  }
5966
6141
  function guardReactiveProps(props) {
5967
6142
  if (!props) return null;
5968
- return isProxy$1(props) || isInternalObject(props) ? extend({}, props) : props;
6143
+ if (isProxy$1(props)) return extend({}, props);
6144
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
5969
6145
  }
5970
6146
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
5971
6147
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -6078,6 +6254,17 @@ function normalizeVNode(child) {
6078
6254
  function cloneIfMounted(child) {
6079
6255
  return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
6080
6256
  }
6257
+ let deferElementSlots = false;
6258
+ /**
6259
+ * While enabled, compiled default slots passed as children of plain elements
6260
+ * are kept on the vnode so the server renderer can render them in push mode.
6261
+ * @internal
6262
+ */
6263
+ function setDeferElementSlots(value) {
6264
+ const prev = deferElementSlots;
6265
+ deferElementSlots = value;
6266
+ return prev;
6267
+ }
6081
6268
  function normalizeChildren(vnode, children) {
6082
6269
  let type = 0;
6083
6270
  const { shapeFlag } = vnode;
@@ -6086,6 +6273,11 @@ function normalizeChildren(vnode, children) {
6086
6273
  else if (typeof children === "object") {
6087
6274
  if (shapeFlag & 65) {
6088
6275
  const slot = children.default;
6276
+ if (deferElementSlots && slot && slot._c && shapeFlag & 1) {
6277
+ vnode.children = children;
6278
+ vnode.shapeFlag |= 32;
6279
+ return;
6280
+ }
6089
6281
  if (slot) {
6090
6282
  slot._c && (slot._d = false);
6091
6283
  normalizeChildren(vnode, slot());
@@ -6369,7 +6561,8 @@ function setupStatefulComponent(instance, isSSR) {
6369
6561
  setInSSRSetupState(false);
6370
6562
  }
6371
6563
  }).catch((e) => {
6372
- handleError(e, instance, 0);
6564
+ handleError(e, instance, 0, void 0, true);
6565
+ instance.ssrRender = (_, push) => push("<!---->");
6373
6566
  });
6374
6567
  else {
6375
6568
  instance.asyncDep = setupResult;
@@ -6440,11 +6633,16 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
6440
6633
  else warn$1(`Component is missing template or render function: `, Component);
6441
6634
  }
6442
6635
  }
6636
+ /**
6637
+ * Read through the setup context `attrs` proxy to get the raw attrs object.
6638
+ * @internal
6639
+ */
6640
+ const rawAttrsKey = Symbol();
6443
6641
  const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
6444
6642
  get(target, key) {
6445
6643
  markAttrsAccessed();
6446
6644
  track(target, "get", "");
6447
- return target[key];
6645
+ return key === rawAttrsKey ? target : target[key];
6448
6646
  },
6449
6647
  set() {
6450
6648
  warn$1(`setupContext.attrs is readonly.`);
@@ -6456,7 +6654,7 @@ const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
6456
6654
  }
6457
6655
  } : { get(target, key) {
6458
6656
  track(target, "get", "");
6459
- return target[key];
6657
+ return key === rawAttrsKey ? target : target[key];
6460
6658
  } };
6461
6659
  /**
6462
6660
  * Dev-only
@@ -6752,7 +6950,7 @@ function isMemoSame(cached, memo) {
6752
6950
  }
6753
6951
  //#endregion
6754
6952
  //#region packages/runtime-core/src/index.ts
6755
- const version = "3.6.0-rc.14";
6953
+ const version = "3.6.0-rc.15";
6756
6954
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
6757
6955
  /**
6758
6956
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -6778,7 +6976,8 @@ const ssrUtils = {
6778
6976
  popWarningContext,
6779
6977
  VaporSlot,
6780
6978
  rawVaporSlotKey,
6781
- invokeSlotFallback
6979
+ invokeSlotFallback,
6980
+ setDeferElementSlots
6782
6981
  };
6783
6982
  /**
6784
6983
  * @internal only exposed in compat builds
@@ -6790,4 +6989,4 @@ const resolveFilter = null;
6790
6989
  const compatUtils = null;
6791
6990
  const DeprecationTypes = null;
6792
6991
  //#endregion
6793
- export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, VaporSlot, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defaultPropGetter, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, devtoolsComponentRemoved, effect, effectScope, endMeasure, ensureValidVNode, enterCbKey, expose, filterModelListeners, filterSingleRoot, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getNextUid, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, invokeSlotFallback, invokeVNodeHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isKeepAliveEnabled, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isSuspenseEnabled, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isTransitionEnabled, isUnchangedResourceProp, isVNode, isValidHtmlOrSvgAttribute, isVaporInteropEnabled, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveCssVars, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, setVaporInteropEnabled, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeepAliveEnabled, withMemo, withScopeId, withSuspenseEnabled, withTransitionEnabled };
6992
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, VaporSlot, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, collectDeferredEnters, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defaultPropGetter, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, devtoolsComponentRemoved, effect, effectScope, endMeasure, ensureValidVNode, enterCbKey, expose, filterModelListeners, filterSingleRoot, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getNextUid, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, invokeSlotFallback, invokeVNodeHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isKeepAliveEnabled, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isSuspenseEnabled, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isTransitionEnabled, isUnchangedResourceProp, isVNode, isValidHtmlOrSvgAttribute, isVaporInteropEnabled, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveCssVars, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, setVaporInteropEnabled, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeepAliveEnabled, withMemo, withScopeId, withSuspenseEnabled, withTransitionEnabled };