@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
  **/
@@ -253,7 +253,9 @@ const SchedulerJobFlags = {
253
253
  "ALLOW_RECURSE": 2,
254
254
  "2": "ALLOW_RECURSE",
255
255
  "DISPOSED": 4,
256
- "4": "DISPOSED"
256
+ "4": "DISPOSED",
257
+ "REQUEUE_ON_SUSPENSE_DISCARD": 8,
258
+ "8": "REQUEUE_ON_SUSPENSE_DISCARD"
257
259
  };
258
260
  const jobs = [];
259
261
  let postJobs = [];
@@ -310,7 +312,7 @@ function queueFlush() {
310
312
  function queuePostFlushCb(jobs, id = Infinity) {
311
313
  if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
312
314
  else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
313
- else for (const job of jobs) queueJobWorker(job, id, postJobs, postJobs.length, 0);
315
+ else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
314
316
  queueFlush();
315
317
  }
316
318
  function flushPreFlushCbs(instance, seen) {
@@ -331,7 +333,7 @@ function flushPreFlushCbs(instance, seen) {
331
333
  function flushPostFlushCbs(seen) {
332
334
  if (postJobs.length) {
333
335
  if (activePostJobs) {
334
- activePostJobs.push(...postJobs);
336
+ for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
335
337
  postJobs.length = 0;
336
338
  return;
337
339
  }
@@ -891,7 +893,7 @@ function instanceWatch(source, value, options) {
891
893
  }
892
894
  const prev = setCurrentInstance(this);
893
895
  const res = doWatch(getter, cb.bind(publicThis), options);
894
- setCurrentInstance(...prev);
896
+ restoreCurrentInstance(prev);
895
897
  return res;
896
898
  }
897
899
  function createPathGetter(ctx, path) {
@@ -1164,49 +1166,16 @@ const BaseTransitionImpl = {
1164
1166
  setup(props, { slots }) {
1165
1167
  const instance = getCurrentInstance();
1166
1168
  const state = useTransitionState();
1169
+ let resumeAfterLeave;
1167
1170
  return () => {
1168
- const children = slots.default && getTransitionRawChildren(slots.default(), true);
1169
- const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
1171
+ const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
1170
1172
  if (!child) return;
1171
1173
  const rawProps = toRaw$1(props);
1172
1174
  const { mode } = rawProps;
1173
1175
  checkTransitionMode(mode);
1174
- if (state.isLeaving) return emptyPlaceholder(child);
1175
- const innerChild = getInnerChild$1(child);
1176
- if (!innerChild) return emptyPlaceholder(child);
1177
- let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
1178
- if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
1179
- let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
1180
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
1181
- let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
1182
- setTransitionHooks(oldInnerChild, leavingHooks);
1183
- if (mode === "out-in" && innerChild.type !== Comment) {
1184
- state.isLeaving = true;
1185
- leavingHooks.afterLeave = () => {
1186
- state.isLeaving = false;
1187
- if (!(instance.job.flags & 4)) instance.update();
1188
- delete leavingHooks.afterLeave;
1189
- oldInnerChild = void 0;
1190
- };
1191
- return emptyPlaceholder(child);
1192
- } else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
1193
- const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
1194
- leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
1195
- el[leaveCbKey] = () => {
1196
- earlyRemove();
1197
- el[leaveCbKey] = void 0;
1198
- delete enterHooks.delayedLeave;
1199
- oldInnerChild = void 0;
1200
- };
1201
- enterHooks.delayedLeave = () => {
1202
- delayedLeave();
1203
- delete enterHooks.delayedLeave;
1204
- oldInnerChild = void 0;
1205
- };
1206
- };
1207
- else oldInnerChild = void 0;
1208
- } else if (oldInnerChild) oldInnerChild = void 0;
1209
- return child;
1176
+ return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
1177
+ if (!(instance.job.flags & 4)) instance.update();
1178
+ }) : NOOP);
1210
1179
  };
1211
1180
  }
1212
1181
  };
@@ -1349,16 +1318,102 @@ function getInnerChild$1(vnode) {
1349
1318
  if (shapeFlag & 32 && isFunction(children.default)) return children.default();
1350
1319
  }
1351
1320
  }
1321
+ function resolveTransitionChild(children, renderEmpty = false) {
1322
+ const branches = children && getTransitionRawChildren(children, true);
1323
+ return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
1324
+ }
1325
+ /**
1326
+ * @internal
1327
+ */
1328
+ function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
1329
+ if (state.isLeaving) return emptyPlaceholder(next);
1330
+ const nextInner = getInnerChild$1(next);
1331
+ if (!nextInner) return emptyPlaceholder(next);
1332
+ let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
1333
+ if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
1334
+ enterHooks = hooks;
1335
+ });
1336
+ if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
1337
+ if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
1338
+ const mode = props.mode;
1339
+ const previousInner = previous && getInnerChild$1(previous);
1340
+ if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
1341
+ const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
1342
+ 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);
1343
+ }
1344
+ return next;
1345
+ }
1346
+ function forwardDelayedLeave(hooks, source) {
1347
+ const delayedLeave = source && source.delayedLeave;
1348
+ if (!delayedLeave) return;
1349
+ hooks.delayedLeave = () => {
1350
+ if (source.delayedLeave === delayedLeave) delayedLeave();
1351
+ delete hooks.delayedLeave;
1352
+ };
1353
+ }
1354
+ /**
1355
+ * Prepares an outgoing VNode when the incoming branch belongs to another
1356
+ * renderer. Returns true when out-in must defer the incoming branch.
1357
+ *
1358
+ * @internal
1359
+ */
1360
+ function prepareTransitionLeave(previous, enterHooks, props, state, instance, resumeAfterLeave) {
1361
+ const previousInner = getInnerChild$1(previous);
1362
+ if (!previousInner || previousInner.type === Comment || previous.component && recursiveGetSubtree(previous.component).type === Comment) return false;
1363
+ return applyTransitionModeSwitch(previousInner, prepareLeavingTransitionHooks(previousInner, props, state, instance), enterHooks ? () => enterHooks : void 0, props, state, resumeAfterLeave);
1364
+ }
1365
+ function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
1366
+ return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
1367
+ }
1368
+ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
1369
+ if (props.mode === "out-in") {
1370
+ state.isLeaving = true;
1371
+ leavingHooks.afterLeave = () => {
1372
+ state.isLeaving = false;
1373
+ resumeAfterLeave();
1374
+ delete leavingHooks.afterLeave;
1375
+ };
1376
+ return true;
1377
+ } else if (props.mode === "in-out" && getEnterHooks) {
1378
+ let delayedLeavingVNode = leavingVNode;
1379
+ leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
1380
+ const enterHooks = getEnterHooks();
1381
+ if (!enterHooks) {
1382
+ delayedLeave();
1383
+ return;
1384
+ }
1385
+ const vnode = delayedLeavingVNode;
1386
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
1387
+ leavingVNodesCache[String(vnode.key)] = vnode;
1388
+ el[leaveCbKey] = () => {
1389
+ earlyRemove();
1390
+ el[leaveCbKey] = void 0;
1391
+ delete enterHooks.delayedLeave;
1392
+ delayedLeavingVNode = void 0;
1393
+ };
1394
+ enterHooks.delayedLeave = () => {
1395
+ delayedLeave();
1396
+ delete enterHooks.delayedLeave;
1397
+ delayedLeavingVNode = void 0;
1398
+ };
1399
+ };
1400
+ }
1401
+ return false;
1402
+ }
1352
1403
  function setTransitionHooks(vnode, hooks) {
1353
- if (vnode.shapeFlag & 6 && vnode.component) if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
1354
- else {
1404
+ if (vnode.shapeFlag & 6 && vnode.component) {
1355
1405
  vnode.transition = hooks;
1356
- setTransitionHooks(vnode.component.subTree, hooks);
1357
- }
1358
- else if (vnode.shapeFlag & 128) {
1359
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1360
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1406
+ if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
1407
+ else {
1408
+ const subTree = vnode.component.subTree;
1409
+ return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
1410
+ }
1411
+ } else if (vnode.shapeFlag & 128) {
1412
+ const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1413
+ const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1414
+ return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
1361
1415
  } else vnode.transition = hooks;
1416
+ return hooks;
1362
1417
  }
1363
1418
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
1364
1419
  let ret = [];
@@ -1725,7 +1780,10 @@ function createHydrationFunctions(rendererInternals) {
1725
1780
  const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
1726
1781
  for (const key in props) {
1727
1782
  if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
1728
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) patchProp(el, key, null, props[key], namespace, parentComponent);
1783
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
1784
+ if (isUnchangedResourceProp(el, key, props[key])) continue;
1785
+ patchProp(el, key, null, props[key], namespace, parentComponent);
1786
+ }
1729
1787
  }
1730
1788
  } else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
1731
1789
  else if (patchFlag & 4 && isReactive$1(props.style)) for (const key in props.style) props.style[key];
@@ -1836,6 +1894,16 @@ const isTemplateNode = (node) => {
1836
1894
  /**
1837
1895
  * Dev only
1838
1896
  */
1897
+ const resourceProps = /* @__PURE__ */ new Set([
1898
+ "src",
1899
+ "srcset",
1900
+ "href",
1901
+ "poster"
1902
+ ]);
1903
+ function isUnchangedResourceProp(el, key, clientValue) {
1904
+ if (!resourceProps.has(key)) return false;
1905
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
1906
+ }
1839
1907
  function propHasMismatch(el, key, clientValue, vnode, instance) {
1840
1908
  let mismatchType;
1841
1909
  let mismatchKey;
@@ -1876,7 +1944,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
1876
1944
  function getAttributeMismatch(el, key, clientValue) {
1877
1945
  let actual;
1878
1946
  let expected;
1879
- if (isBooleanAttr(key)) {
1947
+ if (key === "hidden") {
1948
+ actual = normalizeHiddenValue(el.getAttribute(key));
1949
+ expected = normalizeHiddenValue(clientValue);
1950
+ } else if (isBooleanAttr(key)) {
1880
1951
  actual = el.hasAttribute(key);
1881
1952
  expected = includeBooleanAttr(clientValue);
1882
1953
  } else if (clientValue == null) {
@@ -1904,6 +1975,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
1904
1975
  }
1905
1976
  return false;
1906
1977
  }
1978
+ function normalizeHiddenValue(value) {
1979
+ if (!isRenderableAttrValue(value)) return false;
1980
+ if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
1981
+ return includeBooleanAttr(value) ? "" : false;
1982
+ }
1907
1983
  function toClassSet(str) {
1908
1984
  return new Set(str.trim().split(/\s+/));
1909
1985
  }
@@ -2451,7 +2527,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
2451
2527
  try {
2452
2528
  return callWithAsyncErrorHandling(hook, target, type, args);
2453
2529
  } finally {
2454
- setCurrentInstance(...prev);
2530
+ restoreCurrentInstance(prev);
2455
2531
  setActiveSub(prevSub);
2456
2532
  }
2457
2533
  });
@@ -2580,7 +2656,8 @@ function createSlots(slots, dynamicSlots) {
2580
2656
  * Compiler runtime helper for rendering `<slot/>`
2581
2657
  * @private
2582
2658
  */
2583
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
2659
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
2660
+ if (props == null) props = {};
2584
2661
  let slot = slots[name];
2585
2662
  if (fallback) fallback.__vdom = true;
2586
2663
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
@@ -3645,8 +3722,9 @@ function renderComponentRoot(instance) {
3645
3722
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
3646
3723
  }
3647
3724
  if (vnode.transition) {
3648
- if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
3649
- setTransitionHooks(root, vnode.transition);
3725
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
3726
+ if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
3727
+ setTransitionHooks(child, vnode.transition);
3650
3728
  }
3651
3729
  if (!!(process.env.NODE_ENV !== "production") && setRoot) setRoot(root);
3652
3730
  else result = root;
@@ -3706,9 +3784,10 @@ function filterSingleRoot(children, recurse = true) {
3706
3784
  }
3707
3785
  return singleRoot;
3708
3786
  }
3787
+ const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
3709
3788
  const getFunctionalFallthrough = (attrs) => {
3710
3789
  let res;
3711
- for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
3790
+ for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
3712
3791
  return res;
3713
3792
  };
3714
3793
  const filterModelListeners = (attrs, props) => {
@@ -3908,7 +3987,7 @@ function baseResolveDefault(factory, instance, key) {
3908
3987
  const prev = setCurrentInstance(instance);
3909
3988
  const props = toRaw$1(instance.props);
3910
3989
  value = factory.call(null, props);
3911
- setCurrentInstance(...prev);
3990
+ restoreCurrentInstance(prev);
3912
3991
  return value;
3913
3992
  }
3914
3993
  const mixinPropsCache = /* @__PURE__ */ new WeakMap();
@@ -4501,7 +4580,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4501
4580
  };
4502
4581
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
4503
4582
  n2.slotScopeIds = slotScopeIds;
4504
- if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
4583
+ if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
4505
4584
  else {
4506
4585
  const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
4507
4586
  getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
@@ -4850,7 +4929,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4850
4929
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
4851
4930
  const { el, type, transition, children, shapeFlag } = vnode;
4852
4931
  if (isVaporComponent(type) || type === VaporSlot) {
4853
- getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
4932
+ getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
4854
4933
  return;
4855
4934
  }
4856
4935
  if (shapeFlag & 6) {
@@ -4906,7 +4985,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4906
4985
  }
4907
4986
  if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
4908
4987
  if (shapeFlag & 256) {
4909
- if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
4988
+ if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
4910
4989
  else parentComponent.ctx.deactivate(vnode);
4911
4990
  return;
4912
4991
  }
@@ -4916,7 +4995,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4916
4995
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
4917
4996
  if (shapeFlag & 6) if (isVaporComponent(type)) {
4918
4997
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
4919
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
4998
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
4920
4999
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
4921
5000
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
4922
5001
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -4933,7 +5012,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4933
5012
  else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
4934
5013
  else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
4935
5014
  if (type === VaporSlot) {
4936
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
5015
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
4937
5016
  return;
4938
5017
  }
4939
5018
  if (doRemove) remove(vnode);
@@ -5232,6 +5311,10 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
5232
5311
  suspense.activeBranch = pendingBranch;
5233
5312
  } else unmount(pendingBranch, parentComponent, suspense);
5234
5313
  suspense.deps = 0;
5314
+ for (let i = 0; i < suspense.effects.length; i++) {
5315
+ const effect = suspense.effects[i];
5316
+ if (effect.flags & 8) queuePostFlushCb(effect);
5317
+ }
5235
5318
  suspense.effects.length = 0;
5236
5319
  suspense.hiddenContainer = createElement("div");
5237
5320
  if (isInFallback) {
@@ -5341,7 +5424,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5341
5424
  let hasUnresolvedAncestor = false;
5342
5425
  while (parent) {
5343
5426
  if (parent.pendingBranch) {
5344
- parent.effects.push(...effects);
5427
+ for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
5345
5428
  hasUnresolvedAncestor = true;
5346
5429
  break;
5347
5430
  }
@@ -5611,9 +5694,24 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
5611
5694
  if (shapeFlag & 128) type.normalize(vnode);
5612
5695
  } else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
5613
5696
  if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
5697
+ if (!!(process.env.NODE_ENV !== "production") && props && vnode.shapeFlag & 1) {
5698
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
5699
+ 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.`);
5700
+ }
5614
5701
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
5615
5702
  return vnode;
5616
5703
  }
5704
+ /**
5705
+ * dev only
5706
+ * Whether children would actually render something. Empty text and empty
5707
+ * arrays are ignored, mirroring the compiler's `node.children.length` check
5708
+ * for `v-html` / `v-text`.
5709
+ */
5710
+ function hasContentChildren(children) {
5711
+ if (isString(children)) return children !== "";
5712
+ if (isArray(children)) return children.length > 0;
5713
+ return false;
5714
+ }
5617
5715
  const createVNode = !!(process.env.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode;
5618
5716
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
5619
5717
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -5842,6 +5940,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
5842
5940
  simpleSetCurrentInstance(instance);
5843
5941
  }
5844
5942
  };
5943
+ /**
5944
+ * Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
5945
+ * `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
5946
+ * verbatim instead of re-triggering the `instance.scope` default.
5947
+ * @internal
5948
+ */
5949
+ const restoreCurrentInstance = (prev) => {
5950
+ setCurrentScope(prev[1]);
5951
+ simpleSetCurrentInstance(prev[0]);
5952
+ };
5845
5953
  const internalOptions = [
5846
5954
  "ce",
5847
5955
  "type",
@@ -6002,7 +6110,7 @@ function setupStatefulComponent(instance, isSSR) {
6002
6110
  const setupResult = callWithErrorHandling(setup, instance, 0, [!!(process.env.NODE_ENV !== "production") ? shallowReadonly$1(instance.props) : instance.props, setupContext]);
6003
6111
  const isAsyncSetup = isPromise(setupResult);
6004
6112
  setActiveSub(prevSub);
6005
- setCurrentInstance(...prev);
6113
+ restoreCurrentInstance(prev);
6006
6114
  if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
6007
6115
  if (isAsyncSetup) {
6008
6116
  const unsetCurrentInstance = () => {
@@ -6010,7 +6118,12 @@ function setupStatefulComponent(instance, isSSR) {
6010
6118
  };
6011
6119
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
6012
6120
  if (isSSR) return setupResult.then((resolvedResult) => {
6013
- handleSetupResult(instance, resolvedResult, isSSR);
6121
+ setInSSRSetupState(true);
6122
+ try {
6123
+ handleSetupResult(instance, resolvedResult, isSSR);
6124
+ } finally {
6125
+ setInSSRSetupState(false);
6126
+ }
6014
6127
  }).catch((e) => {
6015
6128
  handleError(e, instance, 0);
6016
6129
  });
@@ -6072,7 +6185,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
6072
6185
  applyOptions(instance);
6073
6186
  } finally {
6074
6187
  setActiveSub(prevSub);
6075
- setCurrentInstance(...prevInstance);
6188
+ restoreCurrentInstance(prevInstance);
6076
6189
  }
6077
6190
  }
6078
6191
  if (!!(process.env.NODE_ENV !== "production") && !Component.render && instance.render === NOOP && !isSSR) if (!compile && Component.template)
@@ -6392,7 +6505,7 @@ function isMemoSame(cached, memo) {
6392
6505
  }
6393
6506
  //#endregion
6394
6507
  //#region packages/runtime-core/src/index.ts
6395
- const version = "3.6.0-rc.1";
6508
+ const version = "3.6.0-rc.3";
6396
6509
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
6397
6510
  /**
6398
6511
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -6427,4 +6540,4 @@ const resolveFilter = null;
6427
6540
  const compatUtils = null;
6428
6541
  const DeprecationTypes = null;
6429
6542
  //#endregion
6430
- 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, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, 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, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, 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, withMemo, withScopeId };
6543
+ 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, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, 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, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, 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, withMemo, withScopeId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.6.0-rc.1",
3
+ "version": "3.6.0-rc.3",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
48
48
  "dependencies": {
49
- "@vue/shared": "3.6.0-rc.1",
50
- "@vue/reactivity": "3.6.0-rc.1"
49
+ "@vue/shared": "3.6.0-rc.3",
50
+ "@vue/reactivity": "3.6.0-rc.3"
51
51
  }
52
52
  }