@vue/runtime-core 3.6.0-rc.1 → 3.6.0-rc.3

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.1
2
+ * @vue/runtime-core v3.6.0-rc.3
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -304,7 +304,7 @@ function queueFlush() {
304
304
  function queuePostFlushCb(jobs, id = Infinity) {
305
305
  if (!(0, _vue_shared.isArray)(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
306
306
  else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
307
- else for (const job of jobs) queueJobWorker(job, id, postJobs, postJobs.length, 0);
307
+ else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
308
308
  queueFlush();
309
309
  }
310
310
  function flushPreFlushCbs(instance, seen) {
@@ -325,7 +325,7 @@ function flushPreFlushCbs(instance, seen) {
325
325
  function flushPostFlushCbs(seen) {
326
326
  if (postJobs.length) {
327
327
  if (activePostJobs) {
328
- activePostJobs.push(...postJobs);
328
+ for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
329
329
  postJobs.length = 0;
330
330
  return;
331
331
  }
@@ -883,7 +883,7 @@ function instanceWatch(source, value, options) {
883
883
  }
884
884
  const prev = setCurrentInstance(this);
885
885
  const res = doWatch(getter, cb.bind(publicThis), options);
886
- setCurrentInstance(...prev);
886
+ restoreCurrentInstance(prev);
887
887
  return res;
888
888
  }
889
889
  function createPathGetter(ctx, path) {
@@ -1156,49 +1156,16 @@ const BaseTransitionImpl = {
1156
1156
  setup(props, { slots }) {
1157
1157
  const instance = getCurrentInstance();
1158
1158
  const state = useTransitionState();
1159
+ let resumeAfterLeave;
1159
1160
  return () => {
1160
- const children = slots.default && getTransitionRawChildren(slots.default(), true);
1161
- const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
1161
+ const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
1162
1162
  if (!child) return;
1163
1163
  const rawProps = (0, _vue_reactivity.toRaw)(props);
1164
1164
  const { mode } = rawProps;
1165
1165
  checkTransitionMode(mode);
1166
- if (state.isLeaving) return emptyPlaceholder(child);
1167
- const innerChild = getInnerChild$1(child);
1168
- if (!innerChild) return emptyPlaceholder(child);
1169
- let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
1170
- if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
1171
- let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
1172
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
1173
- let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
1174
- setTransitionHooks(oldInnerChild, leavingHooks);
1175
- if (mode === "out-in" && innerChild.type !== Comment) {
1176
- state.isLeaving = true;
1177
- leavingHooks.afterLeave = () => {
1178
- state.isLeaving = false;
1179
- if (!(instance.job.flags & 4)) instance.update();
1180
- delete leavingHooks.afterLeave;
1181
- oldInnerChild = void 0;
1182
- };
1183
- return emptyPlaceholder(child);
1184
- } else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
1185
- const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
1186
- leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
1187
- el[leaveCbKey] = () => {
1188
- earlyRemove();
1189
- el[leaveCbKey] = void 0;
1190
- delete enterHooks.delayedLeave;
1191
- oldInnerChild = void 0;
1192
- };
1193
- enterHooks.delayedLeave = () => {
1194
- delayedLeave();
1195
- delete enterHooks.delayedLeave;
1196
- oldInnerChild = void 0;
1197
- };
1198
- };
1199
- else oldInnerChild = void 0;
1200
- } else if (oldInnerChild) oldInnerChild = void 0;
1201
- return child;
1166
+ return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
1167
+ if (!(instance.job.flags & 4)) instance.update();
1168
+ }) : _vue_shared.NOOP);
1202
1169
  };
1203
1170
  }
1204
1171
  };
@@ -1340,16 +1307,91 @@ function getInnerChild$1(vnode) {
1340
1307
  if (shapeFlag & 32 && (0, _vue_shared.isFunction)(children.default)) return children.default();
1341
1308
  }
1342
1309
  }
1310
+ function resolveTransitionChild(children, renderEmpty = false) {
1311
+ const branches = children && getTransitionRawChildren(children, true);
1312
+ return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
1313
+ }
1314
+ /**
1315
+ * @internal
1316
+ */
1317
+ function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
1318
+ if (state.isLeaving) return emptyPlaceholder(next);
1319
+ const nextInner = getInnerChild$1(next);
1320
+ if (!nextInner) return emptyPlaceholder(next);
1321
+ let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
1322
+ if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
1323
+ enterHooks = hooks;
1324
+ });
1325
+ if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
1326
+ if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
1327
+ const mode = props.mode;
1328
+ const previousInner = previous && getInnerChild$1(previous);
1329
+ if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
1330
+ const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
1331
+ if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
1332
+ }
1333
+ return next;
1334
+ }
1335
+ function forwardDelayedLeave(hooks, source) {
1336
+ const delayedLeave = source && source.delayedLeave;
1337
+ if (!delayedLeave) return;
1338
+ hooks.delayedLeave = () => {
1339
+ if (source.delayedLeave === delayedLeave) delayedLeave();
1340
+ delete hooks.delayedLeave;
1341
+ };
1342
+ }
1343
+ function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
1344
+ return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
1345
+ }
1346
+ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
1347
+ if (props.mode === "out-in") {
1348
+ state.isLeaving = true;
1349
+ leavingHooks.afterLeave = () => {
1350
+ state.isLeaving = false;
1351
+ resumeAfterLeave();
1352
+ delete leavingHooks.afterLeave;
1353
+ };
1354
+ return true;
1355
+ } else if (props.mode === "in-out" && getEnterHooks) {
1356
+ let delayedLeavingVNode = leavingVNode;
1357
+ leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
1358
+ const enterHooks = getEnterHooks();
1359
+ if (!enterHooks) {
1360
+ delayedLeave();
1361
+ return;
1362
+ }
1363
+ const vnode = delayedLeavingVNode;
1364
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
1365
+ leavingVNodesCache[String(vnode.key)] = vnode;
1366
+ el[leaveCbKey] = () => {
1367
+ earlyRemove();
1368
+ el[leaveCbKey] = void 0;
1369
+ delete enterHooks.delayedLeave;
1370
+ delayedLeavingVNode = void 0;
1371
+ };
1372
+ enterHooks.delayedLeave = () => {
1373
+ delayedLeave();
1374
+ delete enterHooks.delayedLeave;
1375
+ delayedLeavingVNode = void 0;
1376
+ };
1377
+ };
1378
+ }
1379
+ return false;
1380
+ }
1343
1381
  function setTransitionHooks(vnode, hooks) {
1344
- if (vnode.shapeFlag & 6 && vnode.component) if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
1345
- else {
1382
+ if (vnode.shapeFlag & 6 && vnode.component) {
1346
1383
  vnode.transition = hooks;
1347
- setTransitionHooks(vnode.component.subTree, hooks);
1348
- }
1349
- else if (vnode.shapeFlag & 128) {
1350
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1351
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1384
+ if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
1385
+ else {
1386
+ const subTree = vnode.component.subTree;
1387
+ return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
1388
+ }
1389
+ } else if (vnode.shapeFlag & 128) {
1390
+ const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1391
+ const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1392
+ return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
1352
1393
  } else vnode.transition = hooks;
1394
+ return hooks;
1353
1395
  }
1354
1396
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
1355
1397
  let ret = [];
@@ -1701,7 +1743,10 @@ function createHydrationFunctions(rendererInternals) {
1701
1743
  const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
1702
1744
  for (const key in props) {
1703
1745
  if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
1704
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key)) patchProp(el, key, null, props[key], namespace, parentComponent);
1746
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key)) {
1747
+ if (isUnchangedResourceProp(el, key, props[key])) continue;
1748
+ patchProp(el, key, null, props[key], namespace, parentComponent);
1749
+ }
1705
1750
  }
1706
1751
  }
1707
1752
  let vnodeHooks;
@@ -1810,6 +1855,16 @@ const isTemplateNode = (node) => {
1810
1855
  /**
1811
1856
  * Dev only
1812
1857
  */
1858
+ const resourceProps = /* @__PURE__ */ new Set([
1859
+ "src",
1860
+ "srcset",
1861
+ "href",
1862
+ "poster"
1863
+ ]);
1864
+ function isUnchangedResourceProp(el, key, clientValue) {
1865
+ if (!resourceProps.has(key)) return false;
1866
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
1867
+ }
1813
1868
  function propHasMismatch(el, key, clientValue, vnode, instance) {
1814
1869
  let mismatchType;
1815
1870
  let mismatchKey;
@@ -1850,7 +1905,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
1850
1905
  function getAttributeMismatch(el, key, clientValue) {
1851
1906
  let actual;
1852
1907
  let expected;
1853
- if ((0, _vue_shared.isBooleanAttr)(key)) {
1908
+ if (key === "hidden") {
1909
+ actual = normalizeHiddenValue(el.getAttribute(key));
1910
+ expected = normalizeHiddenValue(clientValue);
1911
+ } else if ((0, _vue_shared.isBooleanAttr)(key)) {
1854
1912
  actual = el.hasAttribute(key);
1855
1913
  expected = (0, _vue_shared.includeBooleanAttr)(clientValue);
1856
1914
  } else if (clientValue == null) {
@@ -1878,6 +1936,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
1878
1936
  }
1879
1937
  return false;
1880
1938
  }
1939
+ function normalizeHiddenValue(value) {
1940
+ if (!(0, _vue_shared.isRenderableAttrValue)(value)) return false;
1941
+ if ((0, _vue_shared.isString)(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
1942
+ return (0, _vue_shared.includeBooleanAttr)(value) ? "" : false;
1943
+ }
1881
1944
  function toClassSet(str) {
1882
1945
  return new Set(str.trim().split(/\s+/));
1883
1946
  }
@@ -2413,7 +2476,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
2413
2476
  try {
2414
2477
  return callWithAsyncErrorHandling(hook, target, type, args);
2415
2478
  } finally {
2416
- setCurrentInstance(...prev);
2479
+ restoreCurrentInstance(prev);
2417
2480
  (0, _vue_reactivity.setActiveSub)(prevSub);
2418
2481
  }
2419
2482
  });
@@ -2542,7 +2605,8 @@ function createSlots(slots, dynamicSlots) {
2542
2605
  * Compiler runtime helper for rendering `<slot/>`
2543
2606
  * @private
2544
2607
  */
2545
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
2608
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
2609
+ if (props == null) props = {};
2546
2610
  let slot = slots[name];
2547
2611
  if (fallback) fallback.__vdom = true;
2548
2612
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
@@ -3596,8 +3660,9 @@ function renderComponentRoot(instance) {
3596
3660
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
3597
3661
  }
3598
3662
  if (vnode.transition) {
3599
- if (!isElementRoot(root)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
3600
- setTransitionHooks(root, vnode.transition);
3663
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
3664
+ if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
3665
+ setTransitionHooks(child, vnode.transition);
3601
3666
  }
3602
3667
  if (setRoot) setRoot(root);
3603
3668
  else result = root;
@@ -3657,9 +3722,10 @@ function filterSingleRoot(children, recurse = true) {
3657
3722
  }
3658
3723
  return singleRoot;
3659
3724
  }
3725
+ const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || (0, _vue_shared.isOn)(key);
3660
3726
  const getFunctionalFallthrough = (attrs) => {
3661
3727
  let res;
3662
- for (const key in attrs) if (key === "class" || key === "style" || (0, _vue_shared.isOn)(key)) (res || (res = {}))[key] = attrs[key];
3728
+ for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
3663
3729
  return res;
3664
3730
  };
3665
3731
  const filterModelListeners = (attrs, props) => {
@@ -3859,7 +3925,7 @@ function baseResolveDefault(factory, instance, key) {
3859
3925
  const prev = setCurrentInstance(instance);
3860
3926
  const props = (0, _vue_reactivity.toRaw)(instance.props);
3861
3927
  value = factory.call(null, props);
3862
- setCurrentInstance(...prev);
3928
+ restoreCurrentInstance(prev);
3863
3929
  return value;
3864
3930
  }
3865
3931
  const mixinPropsCache = /* @__PURE__ */ new WeakMap();
@@ -4419,7 +4485,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4419
4485
  };
4420
4486
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4421
4487
  n2.slotScopeIds = slotScopeIds;
4422
- if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
4488
+ if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
4423
4489
  else {
4424
4490
  const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
4425
4491
  getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
@@ -4762,7 +4828,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4762
4828
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
4763
4829
  const { el, type, transition, children, shapeFlag } = vnode;
4764
4830
  if (isVaporComponent(type) || type === VaporSlot) {
4765
- getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
4831
+ getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
4766
4832
  return;
4767
4833
  }
4768
4834
  if (shapeFlag & 6) {
@@ -4818,7 +4884,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4818
4884
  }
4819
4885
  if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
4820
4886
  if (shapeFlag & 256) {
4821
- if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
4887
+ if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
4822
4888
  else parentComponent.ctx.deactivate(vnode);
4823
4889
  return;
4824
4890
  }
@@ -4828,7 +4894,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4828
4894
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
4829
4895
  if (shapeFlag & 6) if (isVaporComponent(type)) {
4830
4896
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
4831
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
4897
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
4832
4898
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
4833
4899
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
4834
4900
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -4845,7 +4911,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4845
4911
  else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
4846
4912
  else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
4847
4913
  if (type === VaporSlot) {
4848
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
4914
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
4849
4915
  return;
4850
4916
  }
4851
4917
  if (doRemove) remove(vnode);
@@ -5144,6 +5210,10 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
5144
5210
  suspense.activeBranch = pendingBranch;
5145
5211
  } else unmount(pendingBranch, parentComponent, suspense);
5146
5212
  suspense.deps = 0;
5213
+ for (let i = 0; i < suspense.effects.length; i++) {
5214
+ const effect = suspense.effects[i];
5215
+ if (effect.flags & 8) queuePostFlushCb(effect);
5216
+ }
5147
5217
  suspense.effects.length = 0;
5148
5218
  suspense.hiddenContainer = createElement("div");
5149
5219
  if (isInFallback) {
@@ -5251,7 +5321,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5251
5321
  let hasUnresolvedAncestor = false;
5252
5322
  while (parent) {
5253
5323
  if (parent.pendingBranch) {
5254
- parent.effects.push(...effects);
5324
+ for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
5255
5325
  hasUnresolvedAncestor = true;
5256
5326
  break;
5257
5327
  }
@@ -5521,9 +5591,24 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
5521
5591
  if (shapeFlag & 128) type.normalize(vnode);
5522
5592
  } else if (children) vnode.shapeFlag |= (0, _vue_shared.isString)(children) ? 8 : 16;
5523
5593
  if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
5594
+ if (props && vnode.shapeFlag & 1) {
5595
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
5596
+ if (overwritingProp && hasContentChildren(vnode.children)) warn$1(`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`);
5597
+ }
5524
5598
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
5525
5599
  return vnode;
5526
5600
  }
5601
+ /**
5602
+ * dev only
5603
+ * Whether children would actually render something. Empty text and empty
5604
+ * arrays are ignored, mirroring the compiler's `node.children.length` check
5605
+ * for `v-html` / `v-text`.
5606
+ */
5607
+ function hasContentChildren(children) {
5608
+ if ((0, _vue_shared.isString)(children)) return children !== "";
5609
+ if ((0, _vue_shared.isArray)(children)) return children.length > 0;
5610
+ return false;
5611
+ }
5527
5612
  const createVNode = createVNodeWithArgsTransform;
5528
5613
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
5529
5614
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -5752,6 +5837,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
5752
5837
  simpleSetCurrentInstance(instance);
5753
5838
  }
5754
5839
  };
5840
+ /**
5841
+ * Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
5842
+ * `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
5843
+ * verbatim instead of re-triggering the `instance.scope` default.
5844
+ * @internal
5845
+ */
5846
+ const restoreCurrentInstance = (prev) => {
5847
+ (0, _vue_reactivity.setCurrentScope)(prev[1]);
5848
+ simpleSetCurrentInstance(prev[0]);
5849
+ };
5755
5850
  const internalOptions = [
5756
5851
  "ce",
5757
5852
  "type",
@@ -5903,7 +5998,7 @@ function setupStatefulComponent(instance, isSSR) {
5903
5998
  const setupResult = callWithErrorHandling(setup, instance, 0, [(0, _vue_reactivity.shallowReadonly)(instance.props), setupContext]);
5904
5999
  const isAsyncSetup = (0, _vue_shared.isPromise)(setupResult);
5905
6000
  (0, _vue_reactivity.setActiveSub)(prevSub);
5906
- setCurrentInstance(...prev);
6001
+ restoreCurrentInstance(prev);
5907
6002
  if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
5908
6003
  if (isAsyncSetup) {
5909
6004
  const unsetCurrentInstance = () => {
@@ -5911,7 +6006,12 @@ function setupStatefulComponent(instance, isSSR) {
5911
6006
  };
5912
6007
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
5913
6008
  if (isSSR) return setupResult.then((resolvedResult) => {
5914
- handleSetupResult(instance, resolvedResult, isSSR);
6009
+ setInSSRSetupState(true);
6010
+ try {
6011
+ handleSetupResult(instance, resolvedResult, isSSR);
6012
+ } finally {
6013
+ setInSSRSetupState(false);
6014
+ }
5915
6015
  }).catch((e) => {
5916
6016
  handleError(e, instance, 0);
5917
6017
  });
@@ -5973,7 +6073,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
5973
6073
  applyOptions(instance);
5974
6074
  } finally {
5975
6075
  (0, _vue_reactivity.setActiveSub)(prevSub);
5976
- setCurrentInstance(...prevInstance);
6076
+ restoreCurrentInstance(prevInstance);
5977
6077
  }
5978
6078
  }
5979
6079
  if (!Component.render && instance.render === _vue_shared.NOOP && !isSSR) if (!compile && Component.template)
@@ -6283,7 +6383,7 @@ function isMemoSame(cached, memo) {
6283
6383
  }
6284
6384
  //#endregion
6285
6385
  //#region packages/runtime-core/src/index.ts
6286
- const version = "3.6.0-rc.1";
6386
+ const version = "3.6.0-rc.3";
6287
6387
  const warn = warn$1;
6288
6388
  /**
6289
6389
  * Runtime error messages. Only exposed in dev or esm builds.