@vue/runtime-core 3.6.0-rc.11 → 3.6.0-rc.13

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.6.0-rc.11
2
+ * @vue/runtime-core v3.6.0-rc.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -309,15 +309,15 @@ function queuePostFlushCb(jobs, id = Infinity) {
309
309
  } else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
310
310
  queueFlush();
311
311
  }
312
- function flushPreFlushCbs(instance, seen) {
312
+ function flushPreFlushCbs(instance, minUid, seen) {
313
313
  seen = seen || /* @__PURE__ */ new Map();
314
314
  for (let i = flushIndex; i < jobsLength; i++) {
315
315
  const cb = jobs[i];
316
316
  if (cb.order & 1 || cb.order === Infinity) continue;
317
- if (instance && cb.order !== instance.uid * 2) continue;
317
+ if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
318
318
  if (checkRecursiveUpdates(seen, cb)) continue;
319
319
  jobs.splice(i, 1);
320
- i--;
320
+ i = instance ? i - 1 : flushIndex - 1;
321
321
  jobsLength--;
322
322
  if (cb.flags & 2) cb.flags &= -2;
323
323
  try {
@@ -327,15 +327,24 @@ function flushPreFlushCbs(instance, seen) {
327
327
  }
328
328
  }
329
329
  }
330
- function flushPostFlushCbs(seen) {
330
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
331
331
  if (postJobs.length) {
332
+ let cbs = postJobs;
333
+ if (skip) {
334
+ cbs = [];
335
+ let kept = 0;
336
+ for (let i = 0; i < postJobs.length; i++) {
337
+ const cb = postJobs[i];
338
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
339
+ else cbs.push(cb);
340
+ }
341
+ postJobs.length = kept;
342
+ } else postJobs = [];
332
343
  if (activePostJobs) {
333
- for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
334
- postJobs.length = 0;
344
+ for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
335
345
  return;
336
346
  }
337
- activePostJobs = postJobs;
338
- postJobs = [];
347
+ activePostJobs = cbs;
339
348
  seen = seen || /* @__PURE__ */ new Map();
340
349
  try {
341
350
  while (postFlushIndex < activePostJobs.length) {
@@ -357,17 +366,28 @@ function flushPostFlushCbs(seen) {
357
366
  }
358
367
  let isFlushing = false;
359
368
  /**
369
+ * Run a root render, then flush the jobs it is responsible for. A mount or
370
+ * unmount (`minUid` given) only flushes the jobs of the components it created
371
+ * and the post cbs it queued, so pre watchers triggered in setup run before
372
+ * mounted (#5721) while the jobs of other components stay in the queue and
373
+ * keep their order (#6728). A root update keeps flushing all pending pre jobs
374
+ * and post cbs, as the jobs of the components it re-renders may predate it.
375
+ *
360
376
  * @internal
361
377
  */
362
- function flushOnAppMount(instance) {
363
- if (!isFlushing) {
364
- isFlushing = true;
365
- try {
366
- flushPreFlushCbs(instance);
367
- flushPostFlushCbs();
368
- } finally {
369
- isFlushing = false;
370
- }
378
+ function flushOnAppMount(fn, minUid) {
379
+ if (isFlushing) {
380
+ fn();
381
+ return;
382
+ }
383
+ const queued = minUid === void 0 ? void 0 : new Set(postJobs);
384
+ fn();
385
+ isFlushing = true;
386
+ try {
387
+ flushPreFlushCbs(void 0, minUid);
388
+ flushPostFlushCbs(void 0, queued, minUid);
389
+ } finally {
390
+ isFlushing = false;
371
391
  }
372
392
  }
373
393
  function flushJobs(seen) {
@@ -835,7 +855,7 @@ var RenderWatcherEffect = class extends _vue_reactivity.WatcherEffect {
835
855
  this.flags |= 128;
836
856
  job.flags |= 2;
837
857
  }
838
- if (instance) job.i = instance;
858
+ job.i = instance;
839
859
  this.job = job;
840
860
  }
841
861
  notify() {
@@ -910,6 +930,16 @@ function createPathGetter(ctx, path) {
910
930
  };
911
931
  }
912
932
  //#endregion
933
+ //#region packages/runtime-core/src/vaporInteropState.ts
934
+ /**
935
+ * Set by `vaporInteropPlugin`. Stays false in apps that never import the
936
+ * plugin, so bundlers drop the vapor-in-vdom branches of the renderer.
937
+ */
938
+ let isVaporInteropEnabled = false;
939
+ function setVaporInteropEnabled() {
940
+ isVaporInteropEnabled = true;
941
+ }
942
+ //#endregion
913
943
  //#region packages/runtime-core/src/components/Teleport.ts
914
944
  const pendingMounts = /* @__PURE__ */ new WeakMap();
915
945
  const TeleportEndKey = Symbol("_vte");
@@ -1046,7 +1076,11 @@ const TeleportImpl = {
1046
1076
  hydrate: hydrateTeleport
1047
1077
  };
1048
1078
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
1049
- if (moveType === 0) insert(vnode.targetAnchor, container, parentAnchor);
1079
+ if (moveType === 0) {
1080
+ if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
1081
+ insert(vnode.targetAnchor, container, parentAnchor);
1082
+ parentAnchor = vnode.targetAnchor;
1083
+ }
1050
1084
  const { el, anchor, shapeFlag, children, props } = vnode;
1051
1085
  const isReorder = moveType === 2;
1052
1086
  if (isReorder) insert(el, container, parentAnchor);
@@ -1165,9 +1199,18 @@ const BaseTransitionPropsValidators = {
1165
1199
  onAfterAppear: TransitionHookValidator,
1166
1200
  onAppearCancelled: TransitionHookValidator
1167
1201
  };
1202
+ let isTransitionEnabled = false;
1203
+ function withTransitionEnabled(value) {
1204
+ isTransitionEnabled = true;
1205
+ return value;
1206
+ }
1168
1207
  function isEmptyTransitionChild(vnode, instance) {
1169
1208
  if (vnode.type === Comment) return true;
1170
- if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
1209
+ if (vnode.type === Fragment) {
1210
+ const child = (0, _vue_shared.isArray)(vnode.children) && filterSingleRoot(vnode.children, false);
1211
+ return !child || isEmptyTransitionChild(child, instance);
1212
+ }
1213
+ if (isVaporInteropEnabled && (vnode.type === VaporSlot || isVaporComponent(vnode.type))) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
1171
1214
  return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
1172
1215
  }
1173
1216
  const BaseTransitionImpl = {
@@ -1184,7 +1227,7 @@ const BaseTransitionImpl = {
1184
1227
  const { mode } = rawProps;
1185
1228
  checkTransitionMode(mode);
1186
1229
  return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
1187
- if (!(instance.job.flags & 4)) instance.update();
1230
+ if (!(instance.effect.flags & 1024)) instance.update();
1188
1231
  }) : _vue_shared.NOOP);
1189
1232
  };
1190
1233
  }
@@ -1204,7 +1247,7 @@ function findNonCommentChild(children) {
1204
1247
  }
1205
1248
  return child;
1206
1249
  }
1207
- const BaseTransition = BaseTransitionImpl;
1250
+ const BaseTransition = /*@__PURE__*/ withTransitionEnabled(BaseTransitionImpl);
1208
1251
  function getLeavingNodesForType(state, vnode) {
1209
1252
  const { leavingNodes } = state;
1210
1253
  let leavingVNodesCache = leavingNodes.get(vnode.type);
@@ -1227,7 +1270,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1227
1270
  },
1228
1271
  earlyRemove: () => {
1229
1272
  const leavingVNode = leavingVNodesCache[key];
1230
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) leavingVNode.el[leaveCbKey]();
1273
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
1274
+ let leavingCb = leavingVNode.el[leaveCbKey];
1275
+ if (!leavingCb) {
1276
+ const leavingRoot = getTransitionRoot(leavingVNode);
1277
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
1278
+ }
1279
+ if (leavingCb) leavingCb();
1280
+ }
1231
1281
  },
1232
1282
  cloneHooks: (vnode) => {
1233
1283
  const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
@@ -1235,7 +1285,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1235
1285
  return hooks;
1236
1286
  }
1237
1287
  }, props, state, instance);
1238
- if (vnode.type === VaporSlot) (0, _vue_shared.extend)(hooks, {
1288
+ if (isVaporInteropEnabled && vnode.type === VaporSlot) (0, _vue_shared.extend)(hooks, {
1239
1289
  __vapor: true,
1240
1290
  props,
1241
1291
  state,
@@ -1412,7 +1462,7 @@ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, pr
1412
1462
  function setTransitionHooks(vnode, hooks) {
1413
1463
  if (vnode.shapeFlag & 6 && vnode.component) {
1414
1464
  vnode.transition = hooks;
1415
- if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
1465
+ if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
1416
1466
  else {
1417
1467
  const subTree = vnode.component.subTree;
1418
1468
  return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
@@ -1421,7 +1471,13 @@ function setTransitionHooks(vnode, hooks) {
1421
1471
  const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1422
1472
  const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1423
1473
  return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
1424
- } else vnode.transition = hooks;
1474
+ } else {
1475
+ vnode.transition = hooks;
1476
+ if (vnode.type === Fragment && (0, _vue_shared.isArray)(vnode.children)) {
1477
+ const child = filterSingleRoot(vnode.children, false);
1478
+ if (child) setTransitionHooks(child, hooks);
1479
+ }
1480
+ }
1425
1481
  return hooks;
1426
1482
  }
1427
1483
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -1444,6 +1500,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
1444
1500
  function checkTransitionMode(mode) {
1445
1501
  if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") warn$1(`invalid <transition> mode: ${mode}`);
1446
1502
  }
1503
+ function getTransitionRoot(vnode) {
1504
+ if (vnode.component && (!isVaporInteropEnabled || !isVaporComponent(vnode.type))) return getTransitionRoot(vnode.component.subTree);
1505
+ if (vnode.type === Fragment) {
1506
+ const child = (0, _vue_shared.isArray)(vnode.children) && filterSingleRoot(vnode.children, false);
1507
+ return child ? getTransitionRoot(child) : void 0;
1508
+ }
1509
+ if (vnode.type !== Comment) return vnode;
1510
+ }
1447
1511
  //#endregion
1448
1512
  //#region packages/runtime-core/src/apiDefineComponent.ts
1449
1513
  /*@__NO_SIDE_EFFECTS__*/
@@ -1697,7 +1761,7 @@ function createHydrationFunctions(rendererInternals) {
1697
1761
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
1698
1762
  break;
1699
1763
  case VaporSlot:
1700
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
1764
+ if (isVaporInteropEnabled) nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
1701
1765
  break;
1702
1766
  default: if (shapeFlag & 1) {
1703
1767
  if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
@@ -1829,7 +1893,7 @@ function createHydrationFunctions(rendererInternals) {
1829
1893
  if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
1830
1894
  const container = parentNode(node);
1831
1895
  const first = nextSibling(node);
1832
- const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
1896
+ const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
1833
1897
  if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
1834
1898
  else {
1835
1899
  logMismatchError();
@@ -2073,14 +2137,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
2073
2137
  break;
2074
2138
  }
2075
2139
  }, opts);
2076
- forEach((el) => {
2077
- if (!(el instanceof Element)) return;
2140
+ const observe = (el) => {
2078
2141
  if (elementIsVisibleInViewport(el)) {
2079
2142
  hydrate();
2080
2143
  ob.disconnect();
2081
2144
  return false;
2082
2145
  }
2146
+ if (getComputedStyle(el).display === "contents") {
2147
+ for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
2148
+ }
2083
2149
  ob.observe(el);
2150
+ };
2151
+ forEach((el) => {
2152
+ if (!(el instanceof Element)) return;
2153
+ return observe(el);
2084
2154
  });
2085
2155
  return () => ob.disconnect();
2086
2156
  };
@@ -2230,7 +2300,7 @@ function createAsyncComponentContext(source) {
2230
2300
  setPendingRequest: (request) => pendingRequest = request
2231
2301
  };
2232
2302
  }
2233
- const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
2303
+ const useAsyncComponentState = (delay = 200, timeout, onError, instance = currentInstance) => {
2234
2304
  const loaded = (0, _vue_reactivity.ref)(false);
2235
2305
  const error = (0, _vue_reactivity.ref)();
2236
2306
  const delayed = (0, _vue_reactivity.ref)(!!delay);
@@ -2287,7 +2357,12 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
2287
2357
  //#endregion
2288
2358
  //#region packages/runtime-core/src/components/KeepAlive.ts
2289
2359
  const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
2290
- const KeepAlive = {
2360
+ let isKeepAliveEnabled = false;
2361
+ function withKeepAliveEnabled(value) {
2362
+ isKeepAliveEnabled = true;
2363
+ return value;
2364
+ }
2365
+ const KeepAlive = /*@__PURE__*/ withKeepAliveEnabled({
2291
2366
  name: `KeepAlive`,
2292
2367
  __isKeepAlive: true,
2293
2368
  props: {
@@ -2342,7 +2417,10 @@ const KeepAlive = {
2342
2417
  function pruneCacheEntry(key) {
2343
2418
  const cached = cache.get(key);
2344
2419
  if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
2345
- else if (current) resetShapeFlag(current);
2420
+ else if (current) {
2421
+ resetShapeFlag(current);
2422
+ if (cached) resetShapeFlag(cached);
2423
+ }
2346
2424
  cache.delete(key);
2347
2425
  keys.delete(key);
2348
2426
  }
@@ -2427,7 +2505,7 @@ const KeepAlive = {
2427
2505
  return isSuspense(rawVNode.type) ? rawVNode : vnode;
2428
2506
  };
2429
2507
  }
2430
- };
2508
+ });
2431
2509
  function matches(pattern, name) {
2432
2510
  if ((0, _vue_shared.isArray)(pattern)) return pattern.some((p) => matches(p, name));
2433
2511
  else if ((0, _vue_shared.isString)(pattern)) return pattern.split(",").includes(name);
@@ -2676,16 +2754,22 @@ function invokeSlotFallback(fallback, owner) {
2676
2754
  function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
2677
2755
  if (props == null) props = {};
2678
2756
  let slot = slots[name];
2679
- const vaporSlot = slot && slot[rawVaporSlotKey];
2757
+ const vaporSlot = isVaporInteropEnabled && slot && slot[rawVaporSlotKey];
2680
2758
  if (vaporSlot) {
2681
2759
  const ret = (openBlock(), createBlock(VaporSlot, props));
2682
2760
  ret.vs = {
2683
2761
  slot: vaporSlot,
2762
+ name,
2684
2763
  outlets: fallback ? [{
2685
2764
  fallback,
2686
2765
  owner: currentRenderingInstance
2687
2766
  }] : void 0
2688
2767
  };
2768
+ if (branchKey != null && props.key == null) {
2769
+ ret.vs.props = ret.props;
2770
+ ret.props = (0, _vue_shared.extend)({}, ret.props, { key: branchKey });
2771
+ ret.key = branchKey;
2772
+ }
2689
2773
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
2690
2774
  return ret;
2691
2775
  }
@@ -2706,7 +2790,7 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
2706
2790
  try {
2707
2791
  const validSlotContent = slot && ensureValidVNode(slot(props));
2708
2792
  let attached = false;
2709
- if (fallback && validSlotContent && currentRenderingInstance) {
2793
+ if (isVaporInteropEnabled && fallback && validSlotContent && currentRenderingInstance) {
2710
2794
  const interop = currentRenderingInstance.appContext.vapor;
2711
2795
  if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
2712
2796
  }
@@ -3878,7 +3962,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
3878
3962
  if (nextKeys.length !== Object.keys(prevProps).length) return true;
3879
3963
  for (let i = 0; i < nextKeys.length; i++) {
3880
3964
  const key = nextKeys[i];
3881
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
3965
+ if (!(0, _vue_shared.hasOwn)(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
3882
3966
  }
3883
3967
  return false;
3884
3968
  }
@@ -4391,7 +4475,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4391
4475
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4392
4476
  break;
4393
4477
  case VaporSlot:
4394
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
4478
+ if (isVaporInteropEnabled) getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
4395
4479
  break;
4396
4480
  default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
4397
4481
  else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
@@ -4525,7 +4609,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4525
4609
  let vnodeHook;
4526
4610
  parentComponent && toggleRecurse(parentComponent, false);
4527
4611
  if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
4528
- if (n2.ibu) n2.ibu();
4612
+ if (isVaporInteropEnabled && n2.ibu) n2.ibu();
4529
4613
  if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
4530
4614
  parentComponent && toggleRecurse(parentComponent, true);
4531
4615
  if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
@@ -4559,9 +4643,9 @@ function baseCreateRenderer(options, createHydrationFns) {
4559
4643
  if (n1.children !== n2.children) hostSetElementText(el, n2.children);
4560
4644
  }
4561
4645
  } else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
4562
- if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
4646
+ if ((vnodeHook = newProps.onVnodeUpdated) || dirs || isVaporInteropEnabled && n2.iu) queuePostRenderEffect(() => {
4563
4647
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
4564
- n2.iu && n2.iu();
4648
+ isVaporInteropEnabled && n2.iu && n2.iu();
4565
4649
  dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
4566
4650
  }, void 0, parentSuspense);
4567
4651
  };
@@ -4569,7 +4653,8 @@ function baseCreateRenderer(options, createHydrationFns) {
4569
4653
  for (let i = 0; i < newChildren.length; i++) {
4570
4654
  const oldVNode = oldChildren[i];
4571
4655
  const newVNode = newChildren[i];
4572
- const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
4656
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
4657
+ const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
4573
4658
  patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
4574
4659
  }
4575
4660
  };
@@ -4661,6 +4746,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4661
4746
  if (instance.asyncDep && !instance.asyncResolved) {
4662
4747
  pushWarningContext(n2);
4663
4748
  n2.el = n1.el;
4749
+ n2.placeholder = n1.placeholder;
4664
4750
  updateComponentPreRender(instance, n2, optimized);
4665
4751
  popWarningContext();
4666
4752
  return;
@@ -4670,6 +4756,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4670
4756
  }
4671
4757
  } else {
4672
4758
  n2.el = n1.el;
4759
+ n2.placeholder = n1.placeholder;
4673
4760
  instance.vnode = n2;
4674
4761
  }
4675
4762
  };
@@ -4766,7 +4853,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4766
4853
  } else next = vnode;
4767
4854
  if (bu) (0, _vue_shared.invokeArrayFns)(bu);
4768
4855
  if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
4769
- if (next.ibu) next.ibu();
4856
+ if (isVaporInteropEnabled && next.ibu) next.ibu();
4770
4857
  toggleRecurse(instance, true);
4771
4858
  startMeasure(instance, `render`);
4772
4859
  const nextTree = renderComponentRoot(instance);
@@ -4779,9 +4866,9 @@ function baseCreateRenderer(options, createHydrationFns) {
4779
4866
  next.el = nextTree.el;
4780
4867
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
4781
4868
  if (u) queuePostRenderEffect(u, void 0, parentSuspense);
4782
- if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
4869
+ if ((vnodeHook = next.props && next.props.onVnodeUpdated) || isVaporInteropEnabled && next.iu) queuePostRenderEffect(() => {
4783
4870
  vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
4784
- next.iu && next.iu();
4871
+ isVaporInteropEnabled && next.iu && next.iu();
4785
4872
  }, void 0, parentSuspense);
4786
4873
  devtoolsComponentUpdated(instance);
4787
4874
  popWarningContext();
@@ -4933,7 +5020,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4933
5020
  };
4934
5021
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
4935
5022
  const { el, type, transition, children, shapeFlag } = vnode;
4936
- if (isVaporComponent(type) || type === VaporSlot) {
5023
+ if (isVaporInteropEnabled && (isVaporComponent(type) || type === VaporSlot)) {
4937
5024
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
4938
5025
  return;
4939
5026
  }
@@ -4977,11 +5064,11 @@ function baseCreateRenderer(options, createHydrationFns) {
4977
5064
  }
4978
5065
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
4979
5066
  if (shapeFlag & 256) {
4980
- if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
5067
+ if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
4981
5068
  else parentComponent.ctx.deactivate(vnode);
4982
5069
  return;
4983
5070
  }
4984
- if (shapeFlag & 6 && isVaporComponent(type)) {
5071
+ if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
4985
5072
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
4986
5073
  return;
4987
5074
  }
@@ -4999,7 +5086,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4999
5086
  if (shapeFlag & 64) vnode.type.remove(vnode, parentComponent, parentSuspense, internals, doRemove);
5000
5087
  else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
5001
5088
  else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
5002
- if (type === VaporSlot) {
5089
+ if (isVaporInteropEnabled && type === VaporSlot) {
5003
5090
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
5004
5091
  return;
5005
5092
  }
@@ -5014,12 +5101,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5014
5101
  };
5015
5102
  const remove = (vnode) => {
5016
5103
  const { type, el, anchor, transition } = vnode;
5017
- if (type === Fragment) {
5018
- if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) vnode.children.forEach((child) => {
5019
- if (child.type === Comment) hostRemove(child.el);
5020
- else remove(child);
5021
- });
5022
- else removeFragment(el, anchor);
5104
+ const isFragment = type === Fragment;
5105
+ if (isFragment && !transition) {
5106
+ removeFragment(el, anchor);
5023
5107
  return;
5024
5108
  }
5025
5109
  if (type === Static) {
@@ -5027,8 +5111,21 @@ function baseCreateRenderer(options, createHydrationFns) {
5027
5111
  if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
5028
5112
  return;
5029
5113
  }
5030
- if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
5031
- else hostRemove(el);
5114
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
5115
+ const performRemove = () => {
5116
+ if (isFragment) {
5117
+ if (hostParentNode(el)) removeFragment(el, anchor);
5118
+ } else hostRemove(el);
5119
+ };
5120
+ if (transition) {
5121
+ let leavingEl = leavingNode && leavingNode.el;
5122
+ let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
5123
+ if (isVaporInteropEnabled && isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
5124
+ leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
5125
+ isElement = !!leavingEl;
5126
+ }
5127
+ performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
5128
+ } else performRemove();
5032
5129
  };
5033
5130
  const removeFragment = (cur, end) => {
5034
5131
  let next;
@@ -5062,7 +5159,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5062
5159
  };
5063
5160
  const getNextHostNode = (vnode) => {
5064
5161
  if (vnode.shapeFlag & 6) {
5065
- if (isVaporComponent(vnode.type)) return hostNextSibling(vnode.anchor);
5162
+ if (isVaporInteropEnabled && isVaporComponent(vnode.type)) return hostNextSibling(vnode.anchor);
5066
5163
  return getNextHostNode(vnode.component.subTree);
5067
5164
  }
5068
5165
  if (vnode.shapeFlag & 128) return vnode.suspense.next();
@@ -5071,15 +5168,12 @@ function baseCreateRenderer(options, createHydrationFns) {
5071
5168
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
5072
5169
  };
5073
5170
  const render = (vnode, container, namespace) => {
5074
- let instance;
5075
- if (vnode == null) {
5076
- if (container._vnode) {
5077
- unmount(container._vnode, null, null, true);
5078
- instance = container._vnode.component;
5079
- }
5080
- } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
5081
- container._vnode = vnode;
5082
- flushOnAppMount(instance);
5171
+ flushOnAppMount(() => {
5172
+ if (vnode == null) {
5173
+ if (container._vnode) unmount(container._vnode, null, null, true);
5174
+ } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
5175
+ container._vnode = vnode;
5176
+ }, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
5083
5177
  };
5084
5178
  const internals = {
5085
5179
  p: patch,
@@ -5126,7 +5220,7 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
5126
5220
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
5127
5221
  }
5128
5222
  function toggleRecurse({ effect, job, vapor }, allowed) {
5129
- if (!vapor) {
5223
+ if (!isVaporInteropEnabled || !vapor) {
5130
5224
  if (allowed) {
5131
5225
  effect.flags |= 128;
5132
5226
  job.flags |= 2;
@@ -5238,7 +5332,7 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
5238
5332
  currentParent = currentParent.parent;
5239
5333
  } else break;
5240
5334
  }
5241
- const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
5335
+ const vaporScopeIds = isVaporInteropEnabled && includeVaporRootIds && currentVNode.vaporScopeIds;
5242
5336
  if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
5243
5337
  return inheritedScopeIds;
5244
5338
  }
@@ -5251,8 +5345,13 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
5251
5345
  //#endregion
5252
5346
  //#region packages/runtime-core/src/components/Suspense.ts
5253
5347
  const isSuspense = (type) => type.__isSuspense;
5348
+ let isSuspenseEnabled = false;
5349
+ function withSuspenseEnabled(value) {
5350
+ isSuspenseEnabled = true;
5351
+ return value;
5352
+ }
5254
5353
  let suspenseId = 0;
5255
- const Suspense = {
5354
+ const Suspense = /*@__PURE__*/ withSuspenseEnabled({
5256
5355
  name: "Suspense",
5257
5356
  __isSuspense: true,
5258
5357
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
@@ -5269,7 +5368,7 @@ const Suspense = {
5269
5368
  },
5270
5369
  hydrate: hydrateSuspense,
5271
5370
  normalize: normalizeSuspenseChildren
5272
- };
5371
+ });
5273
5372
  function triggerEvent(vnode, name) {
5274
5373
  const eventListener = vnode.props && vnode.props[name];
5275
5374
  if ((0, _vue_shared.isFunction)(eventListener)) eventListener();
@@ -5472,13 +5571,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5472
5571
  registerDep(instance, onResolve) {
5473
5572
  const isInPendingSuspense = !!suspense.pendingBranch;
5474
5573
  if (isInPendingSuspense) suspense.deps++;
5475
- const hydratedEl = instance.vnode && instance.vnode.el;
5476
5574
  instance.asyncDep.catch((err) => {
5477
5575
  handleError(err, instance, 0);
5478
5576
  }).then((asyncSetupResult) => {
5479
5577
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
5480
5578
  setCurrentInstance(null, void 0);
5481
- if (hydratedEl && !instance.scope.active) {
5579
+ if (!instance.scope.active) {
5482
5580
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
5483
5581
  return;
5484
5582
  }
@@ -5791,7 +5889,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
5791
5889
  ctx: vnode.ctx,
5792
5890
  ce: vnode.ce,
5793
5891
  vi: vnode.vi,
5794
- vs: cloneVaporSlotMeta(vnode),
5892
+ vs: cloneVaporSlotMeta(vnode, extraProps),
5795
5893
  vb: vnode.vb,
5796
5894
  ibu: vnode.ibu,
5797
5895
  iu: vnode.iu,
@@ -5800,13 +5898,29 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
5800
5898
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
5801
5899
  return cloned;
5802
5900
  }
5803
- function cloneVaporSlotMeta(vnode) {
5901
+ function cloneVaporSlotMeta(vnode, extraProps) {
5804
5902
  const vaporSlot = vnode.vs;
5805
5903
  if (!vaporSlot) return vaporSlot;
5806
5904
  const cloned = {
5807
5905
  slot: vaporSlot.slot,
5808
- outlets: vaporSlot.outlets
5906
+ name: vaporSlot.name,
5907
+ outlets: vaporSlot.outlets,
5908
+ props: vaporSlot.props,
5909
+ attrs: vaporSlot.attrs && vaporSlot.attrs === _vue_shared.EMPTY_OBJ ? {} : vaporSlot.attrs,
5910
+ group: vaporSlot.group
5809
5911
  };
5912
+ const attrs = cloned.attrs;
5913
+ if (extraProps && vaporSlot.props) {
5914
+ let extraSlotProps;
5915
+ for (const key in extraProps) if (attrs ? !(0, _vue_shared.isReservedProp)(key) : key !== "key") {
5916
+ if (!extraSlotProps) extraSlotProps = {};
5917
+ extraSlotProps[key] = extraProps[key];
5918
+ }
5919
+ if (extraSlotProps) {
5920
+ if (attrs) cloned.attrs = mergeProps(attrs, extraSlotProps);
5921
+ else cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
5922
+ }
5923
+ }
5810
5924
  if (vnode.el) {
5811
5925
  cloned.state = vaporSlot.state;
5812
5926
  cloned.ref = vaporSlot.ref;
@@ -5998,6 +6112,9 @@ const useInstanceOption = (key, silent = false) => {
5998
6112
  //#region packages/runtime-core/src/component.ts
5999
6113
  const emptyAppContext = /*@__PURE__*/ createAppContext();
6000
6114
  let uid = 0;
6115
+ function getNextUid() {
6116
+ return uid;
6117
+ }
6001
6118
  function createComponentInstance(vnode, parent, suspense) {
6002
6119
  const type = vnode.type;
6003
6120
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -6084,7 +6201,7 @@ function setupComponent(instance, isSSR = false, optimized = false) {
6084
6201
  isSSR && setInSSRSetupState(isSSR);
6085
6202
  const { props, children, vi } = instance.vnode;
6086
6203
  const isStateful = isStatefulComponent(instance);
6087
- if (vi) vi(instance);
6204
+ if (isVaporInteropEnabled && vi) vi(instance);
6088
6205
  else {
6089
6206
  initProps(instance, props, isStateful, isSSR);
6090
6207
  initSlots(instance, children, optimized || isSSR);
@@ -6504,7 +6621,7 @@ function isMemoSame(cached, memo) {
6504
6621
  }
6505
6622
  //#endregion
6506
6623
  //#region packages/runtime-core/src/index.ts
6507
- const version = "3.6.0-rc.11";
6624
+ const version = "3.6.0-rc.13";
6508
6625
  const warn = warn$1;
6509
6626
  /**
6510
6627
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -6605,6 +6722,12 @@ exports.hydrateOnMediaQuery = hydrateOnMediaQuery;
6605
6722
  exports.hydrateOnVisible = hydrateOnVisible;
6606
6723
  exports.initCustomFormatter = initCustomFormatter;
6607
6724
  exports.inject = inject;
6725
+ Object.defineProperty(exports, "isKeepAliveEnabled", {
6726
+ enumerable: true,
6727
+ get: function() {
6728
+ return isKeepAliveEnabled;
6729
+ }
6730
+ });
6608
6731
  exports.isMemoSame = isMemoSame;
6609
6732
  exports.isProxy = _vue_reactivity.isProxy;
6610
6733
  exports.isReactive = _vue_reactivity.isReactive;
@@ -6612,7 +6735,25 @@ exports.isReadonly = _vue_reactivity.isReadonly;
6612
6735
  exports.isRef = _vue_reactivity.isRef;
6613
6736
  exports.isRuntimeOnly = isRuntimeOnly;
6614
6737
  exports.isShallow = _vue_reactivity.isShallow;
6738
+ Object.defineProperty(exports, "isSuspenseEnabled", {
6739
+ enumerable: true,
6740
+ get: function() {
6741
+ return isSuspenseEnabled;
6742
+ }
6743
+ });
6744
+ Object.defineProperty(exports, "isTransitionEnabled", {
6745
+ enumerable: true,
6746
+ get: function() {
6747
+ return isTransitionEnabled;
6748
+ }
6749
+ });
6615
6750
  exports.isVNode = isVNode;
6751
+ Object.defineProperty(exports, "isVaporInteropEnabled", {
6752
+ enumerable: true,
6753
+ get: function() {
6754
+ return isVaporInteropEnabled;
6755
+ }
6756
+ });
6616
6757
  exports.markRaw = _vue_reactivity.markRaw;
6617
6758
  exports.mergeDefaults = mergeDefaults;
6618
6759
  exports.mergeModels = mergeModels;
@@ -6656,6 +6797,7 @@ exports.setBlockTracking = setBlockTracking;
6656
6797
  exports.setDevtoolsHook = setDevtoolsHook;
6657
6798
  exports.setIsHydratingEnabled = setIsHydratingEnabled;
6658
6799
  exports.setTransitionHooks = setTransitionHooks;
6800
+ exports.setVaporInteropEnabled = setVaporInteropEnabled;
6659
6801
  exports.shallowReactive = _vue_reactivity.shallowReactive;
6660
6802
  exports.shallowReadonly = _vue_reactivity.shallowReadonly;
6661
6803
  exports.shallowRef = _vue_reactivity.shallowRef;
@@ -6690,5 +6832,8 @@ exports.withAsyncContext = withAsyncContext;
6690
6832
  exports.withCtx = withCtx;
6691
6833
  exports.withDefaults = withDefaults;
6692
6834
  exports.withDirectives = withDirectives;
6835
+ exports.withKeepAliveEnabled = withKeepAliveEnabled;
6693
6836
  exports.withMemo = withMemo;
6694
6837
  exports.withScopeId = withScopeId;
6838
+ exports.withSuspenseEnabled = withSuspenseEnabled;
6839
+ exports.withTransitionEnabled = withTransitionEnabled;