@vue/compat 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/compat v3.6.0-rc.1
2
+ * @vue/compat v3.6.0-rc.3
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -319,7 +319,7 @@ var Vue = (function() {
319
319
  /**
320
320
  * The full list is needed during SSR to produce the correct initial markup.
321
321
  */
322
- const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
322
+ const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
323
323
  /**
324
324
  * Boolean attributes should be included if the value is truthy or ''.
325
325
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -2601,7 +2601,7 @@ var Vue = (function() {
2601
2601
  function queuePostFlushCb(jobs, id = Infinity) {
2602
2602
  if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2603
2603
  else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2604
- else for (const job of jobs) queueJobWorker(job, id, postJobs, postJobs.length, 0);
2604
+ else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2605
2605
  queueFlush();
2606
2606
  }
2607
2607
  function flushPreFlushCbs(instance, seen) {
@@ -2622,7 +2622,7 @@ var Vue = (function() {
2622
2622
  function flushPostFlushCbs(seen) {
2623
2623
  if (postJobs.length) {
2624
2624
  if (activePostJobs) {
2625
- activePostJobs.push(...postJobs);
2625
+ for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2626
2626
  postJobs.length = 0;
2627
2627
  return;
2628
2628
  }
@@ -3509,7 +3509,7 @@ var Vue = (function() {
3509
3509
  }
3510
3510
  const prev = setCurrentInstance(this);
3511
3511
  const res = doWatch(getter, cb.bind(publicThis), options);
3512
- setCurrentInstance(...prev);
3512
+ restoreCurrentInstance(prev);
3513
3513
  return res;
3514
3514
  }
3515
3515
  function createPathGetter(ctx, path) {
@@ -3782,49 +3782,16 @@ var Vue = (function() {
3782
3782
  setup(props, { slots }) {
3783
3783
  const instance = getCurrentInstance();
3784
3784
  const state = useTransitionState();
3785
+ let resumeAfterLeave;
3785
3786
  return () => {
3786
- const children = slots.default && getTransitionRawChildren(slots.default(), true);
3787
- const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3787
+ const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
3788
3788
  if (!child) return;
3789
3789
  const rawProps = /* @__PURE__ */ toRaw(props);
3790
3790
  const { mode } = rawProps;
3791
3791
  checkTransitionMode(mode);
3792
- if (state.isLeaving) return emptyPlaceholder(child);
3793
- const innerChild = getInnerChild$1(child);
3794
- if (!innerChild) return emptyPlaceholder(child);
3795
- let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
3796
- if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
3797
- let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3798
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3799
- let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
3800
- setTransitionHooks(oldInnerChild, leavingHooks);
3801
- if (mode === "out-in" && innerChild.type !== Comment) {
3802
- state.isLeaving = true;
3803
- leavingHooks.afterLeave = () => {
3804
- state.isLeaving = false;
3805
- if (!(instance.job.flags & 4)) instance.update();
3806
- delete leavingHooks.afterLeave;
3807
- oldInnerChild = void 0;
3808
- };
3809
- return emptyPlaceholder(child);
3810
- } else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3811
- const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
3812
- leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3813
- el[leaveCbKey] = () => {
3814
- earlyRemove();
3815
- el[leaveCbKey] = void 0;
3816
- delete enterHooks.delayedLeave;
3817
- oldInnerChild = void 0;
3818
- };
3819
- enterHooks.delayedLeave = () => {
3820
- delayedLeave();
3821
- delete enterHooks.delayedLeave;
3822
- oldInnerChild = void 0;
3823
- };
3824
- };
3825
- else oldInnerChild = void 0;
3826
- } else if (oldInnerChild) oldInnerChild = void 0;
3827
- return child;
3792
+ return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
3793
+ if (!(instance.job.flags & 4)) instance.update();
3794
+ }) : NOOP);
3828
3795
  };
3829
3796
  }
3830
3797
  };
@@ -3967,16 +3934,91 @@ var Vue = (function() {
3967
3934
  if (shapeFlag & 32 && isFunction(children.default)) return children.default();
3968
3935
  }
3969
3936
  }
3937
+ function resolveTransitionChild(children, renderEmpty = false) {
3938
+ const branches = children && getTransitionRawChildren(children, true);
3939
+ return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
3940
+ }
3941
+ /**
3942
+ * @internal
3943
+ */
3944
+ function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
3945
+ if (state.isLeaving) return emptyPlaceholder(next);
3946
+ const nextInner = getInnerChild$1(next);
3947
+ if (!nextInner) return emptyPlaceholder(next);
3948
+ let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
3949
+ if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
3950
+ enterHooks = hooks;
3951
+ });
3952
+ if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
3953
+ if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
3954
+ const mode = props.mode;
3955
+ const previousInner = previous && getInnerChild$1(previous);
3956
+ if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
3957
+ const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
3958
+ 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);
3959
+ }
3960
+ return next;
3961
+ }
3962
+ function forwardDelayedLeave(hooks, source) {
3963
+ const delayedLeave = source && source.delayedLeave;
3964
+ if (!delayedLeave) return;
3965
+ hooks.delayedLeave = () => {
3966
+ if (source.delayedLeave === delayedLeave) delayedLeave();
3967
+ delete hooks.delayedLeave;
3968
+ };
3969
+ }
3970
+ function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
3971
+ return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
3972
+ }
3973
+ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
3974
+ if (props.mode === "out-in") {
3975
+ state.isLeaving = true;
3976
+ leavingHooks.afterLeave = () => {
3977
+ state.isLeaving = false;
3978
+ resumeAfterLeave();
3979
+ delete leavingHooks.afterLeave;
3980
+ };
3981
+ return true;
3982
+ } else if (props.mode === "in-out" && getEnterHooks) {
3983
+ let delayedLeavingVNode = leavingVNode;
3984
+ leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3985
+ const enterHooks = getEnterHooks();
3986
+ if (!enterHooks) {
3987
+ delayedLeave();
3988
+ return;
3989
+ }
3990
+ const vnode = delayedLeavingVNode;
3991
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3992
+ leavingVNodesCache[String(vnode.key)] = vnode;
3993
+ el[leaveCbKey] = () => {
3994
+ earlyRemove();
3995
+ el[leaveCbKey] = void 0;
3996
+ delete enterHooks.delayedLeave;
3997
+ delayedLeavingVNode = void 0;
3998
+ };
3999
+ enterHooks.delayedLeave = () => {
4000
+ delayedLeave();
4001
+ delete enterHooks.delayedLeave;
4002
+ delayedLeavingVNode = void 0;
4003
+ };
4004
+ };
4005
+ }
4006
+ return false;
4007
+ }
3970
4008
  function setTransitionHooks(vnode, hooks) {
3971
- if (vnode.shapeFlag & 6 && vnode.component) if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3972
- else {
4009
+ if (vnode.shapeFlag & 6 && vnode.component) {
3973
4010
  vnode.transition = hooks;
3974
- setTransitionHooks(vnode.component.subTree, hooks);
3975
- }
3976
- else if (vnode.shapeFlag & 128) {
3977
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3978
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4011
+ if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
4012
+ else {
4013
+ const subTree = vnode.component.subTree;
4014
+ return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
4015
+ }
4016
+ } else if (vnode.shapeFlag & 128) {
4017
+ const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4018
+ const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4019
+ return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3979
4020
  } else vnode.transition = hooks;
4021
+ return hooks;
3980
4022
  }
3981
4023
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
3982
4024
  let ret = [];
@@ -4328,7 +4370,10 @@ var Vue = (function() {
4328
4370
  const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
4329
4371
  for (const key in props) {
4330
4372
  if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
4331
- 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);
4373
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4374
+ if (isUnchangedResourceProp(el, key, props[key])) continue;
4375
+ patchProp(el, key, null, props[key], namespace, parentComponent);
4376
+ }
4332
4377
  }
4333
4378
  }
4334
4379
  let vnodeHooks;
@@ -4437,6 +4482,16 @@ var Vue = (function() {
4437
4482
  /**
4438
4483
  * Dev only
4439
4484
  */
4485
+ const resourceProps = /* @__PURE__ */ new Set([
4486
+ "src",
4487
+ "srcset",
4488
+ "href",
4489
+ "poster"
4490
+ ]);
4491
+ function isUnchangedResourceProp(el, key, clientValue) {
4492
+ if (!resourceProps.has(key)) return false;
4493
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
4494
+ }
4440
4495
  function propHasMismatch(el, key, clientValue, vnode, instance) {
4441
4496
  let mismatchType;
4442
4497
  let mismatchKey;
@@ -4477,7 +4532,10 @@ var Vue = (function() {
4477
4532
  function getAttributeMismatch(el, key, clientValue) {
4478
4533
  let actual;
4479
4534
  let expected;
4480
- if (isBooleanAttr(key)) {
4535
+ if (key === "hidden") {
4536
+ actual = normalizeHiddenValue(el.getAttribute(key));
4537
+ expected = normalizeHiddenValue(clientValue);
4538
+ } else if (isBooleanAttr(key)) {
4481
4539
  actual = el.hasAttribute(key);
4482
4540
  expected = includeBooleanAttr(clientValue);
4483
4541
  } else if (clientValue == null) {
@@ -4505,6 +4563,11 @@ var Vue = (function() {
4505
4563
  }
4506
4564
  return false;
4507
4565
  }
4566
+ function normalizeHiddenValue(value) {
4567
+ if (!isRenderableAttrValue(value)) return false;
4568
+ if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
4569
+ return includeBooleanAttr(value) ? "" : false;
4570
+ }
4508
4571
  function toClassSet(str) {
4509
4572
  return new Set(str.trim().split(/\s+/));
4510
4573
  }
@@ -5041,7 +5104,7 @@ var Vue = (function() {
5041
5104
  try {
5042
5105
  return callWithAsyncErrorHandling(hook, target, type, args);
5043
5106
  } finally {
5044
- setCurrentInstance(...prev);
5107
+ restoreCurrentInstance(prev);
5045
5108
  setActiveSub(prevSub);
5046
5109
  }
5047
5110
  });
@@ -5380,7 +5443,8 @@ var Vue = (function() {
5380
5443
  * Compiler runtime helper for rendering `<slot/>`
5381
5444
  * @private
5382
5445
  */
5383
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
5446
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
5447
+ if (props == null) props = {};
5384
5448
  let slot = slots[name];
5385
5449
  if (fallback) fallback.__vdom = true;
5386
5450
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
@@ -6336,7 +6400,7 @@ var Vue = (function() {
6336
6400
  if (options.el) return vm.$mount(options.el);
6337
6401
  else return vm;
6338
6402
  }
6339
- Vue.version = `2.6.14-compat:3.6.0-rc.1`;
6403
+ Vue.version = `2.6.14-compat:3.6.0-rc.3`;
6340
6404
  Vue.config = singletonApp.config;
6341
6405
  Vue.use = (plugin, ...options) => {
6342
6406
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -7034,8 +7098,9 @@ var Vue = (function() {
7034
7098
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
7035
7099
  }
7036
7100
  if (vnode.transition) {
7037
- if (!isElementRoot(root)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
7038
- setTransitionHooks(root, vnode.transition);
7101
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
7102
+ if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
7103
+ setTransitionHooks(child, vnode.transition);
7039
7104
  }
7040
7105
  if (setRoot) setRoot(root);
7041
7106
  else result = root;
@@ -7095,9 +7160,10 @@ var Vue = (function() {
7095
7160
  }
7096
7161
  return singleRoot;
7097
7162
  }
7163
+ const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
7098
7164
  const getFunctionalFallthrough = (attrs) => {
7099
7165
  let res;
7100
- for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
7166
+ for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
7101
7167
  return res;
7102
7168
  };
7103
7169
  const filterModelListeners = (attrs, props) => {
@@ -7329,7 +7395,7 @@ var Vue = (function() {
7329
7395
  const prev = setCurrentInstance(instance);
7330
7396
  const props = /* @__PURE__ */ toRaw(instance.props);
7331
7397
  value = factory.call(isCompatEnabled$1("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null, props);
7332
- setCurrentInstance(...prev);
7398
+ restoreCurrentInstance(prev);
7333
7399
  return value;
7334
7400
  }
7335
7401
  const mixinPropsCache = /* @__PURE__ */ new WeakMap();
@@ -7890,7 +7956,7 @@ var Vue = (function() {
7890
7956
  };
7891
7957
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7892
7958
  n2.slotScopeIds = slotScopeIds;
7893
- if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
7959
+ if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
7894
7960
  else {
7895
7961
  const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
7896
7962
  getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
@@ -8243,7 +8309,7 @@ var Vue = (function() {
8243
8309
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
8244
8310
  const { el, type, transition, children, shapeFlag } = vnode;
8245
8311
  if (isVaporComponent(type) || type === VaporSlot) {
8246
- getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
8312
+ getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
8247
8313
  return;
8248
8314
  }
8249
8315
  if (shapeFlag & 6) {
@@ -8299,7 +8365,7 @@ var Vue = (function() {
8299
8365
  }
8300
8366
  if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
8301
8367
  if (shapeFlag & 256) {
8302
- if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
8368
+ if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
8303
8369
  else parentComponent.ctx.deactivate(vnode);
8304
8370
  return;
8305
8371
  }
@@ -8309,7 +8375,7 @@ var Vue = (function() {
8309
8375
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
8310
8376
  if (shapeFlag & 6) if (isVaporComponent(type)) {
8311
8377
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
8312
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
8378
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
8313
8379
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
8314
8380
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
8315
8381
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -8326,7 +8392,7 @@ var Vue = (function() {
8326
8392
  else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
8327
8393
  else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
8328
8394
  if (type === VaporSlot) {
8329
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
8395
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
8330
8396
  return;
8331
8397
  }
8332
8398
  if (doRemove) remove(vnode);
@@ -8627,6 +8693,10 @@ var Vue = (function() {
8627
8693
  suspense.activeBranch = pendingBranch;
8628
8694
  } else unmount(pendingBranch, parentComponent, suspense);
8629
8695
  suspense.deps = 0;
8696
+ for (let i = 0; i < suspense.effects.length; i++) {
8697
+ const effect = suspense.effects[i];
8698
+ if (effect.flags & 8) queuePostFlushCb(effect);
8699
+ }
8630
8700
  suspense.effects.length = 0;
8631
8701
  suspense.hiddenContainer = createElement("div");
8632
8702
  if (isInFallback) {
@@ -8734,7 +8804,7 @@ var Vue = (function() {
8734
8804
  let hasUnresolvedAncestor = false;
8735
8805
  while (parent) {
8736
8806
  if (parent.pendingBranch) {
8737
- parent.effects.push(...effects);
8807
+ for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
8738
8808
  hasUnresolvedAncestor = true;
8739
8809
  break;
8740
8810
  }
@@ -9044,11 +9114,26 @@ var Vue = (function() {
9044
9114
  if (shapeFlag & 128) type.normalize(vnode);
9045
9115
  } else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
9046
9116
  if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
9117
+ if (props && vnode.shapeFlag & 1) {
9118
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
9119
+ 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.`);
9120
+ }
9047
9121
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
9048
9122
  convertLegacyVModelProps(vnode);
9049
9123
  defineLegacyVNodeProperties(vnode);
9050
9124
  return vnode;
9051
9125
  }
9126
+ /**
9127
+ * dev only
9128
+ * Whether children would actually render something. Empty text and empty
9129
+ * arrays are ignored, mirroring the compiler's `node.children.length` check
9130
+ * for `v-html` / `v-text`.
9131
+ */
9132
+ function hasContentChildren(children) {
9133
+ if (isString(children)) return children !== "";
9134
+ if (isArray(children)) return children.length > 0;
9135
+ return false;
9136
+ }
9052
9137
  const createVNode = createVNodeWithArgsTransform;
9053
9138
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
9054
9139
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -9270,6 +9355,16 @@ var Vue = (function() {
9270
9355
  simpleSetCurrentInstance(instance);
9271
9356
  }
9272
9357
  };
9358
+ /**
9359
+ * Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
9360
+ * `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
9361
+ * verbatim instead of re-triggering the `instance.scope` default.
9362
+ * @internal
9363
+ */
9364
+ const restoreCurrentInstance = (prev) => {
9365
+ setCurrentScope(prev[1]);
9366
+ simpleSetCurrentInstance(prev[0]);
9367
+ };
9273
9368
  const internalOptions = [
9274
9369
  "ce",
9275
9370
  "type",
@@ -9421,7 +9516,7 @@ var Vue = (function() {
9421
9516
  const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
9422
9517
  const isAsyncSetup = isPromise(setupResult);
9423
9518
  setActiveSub(prevSub);
9424
- setCurrentInstance(...prev);
9519
+ restoreCurrentInstance(prev);
9425
9520
  if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
9426
9521
  if (isAsyncSetup) {
9427
9522
  const unsetCurrentInstance = () => {
@@ -9429,7 +9524,12 @@ var Vue = (function() {
9429
9524
  };
9430
9525
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
9431
9526
  if (isSSR) return setupResult.then((resolvedResult) => {
9432
- handleSetupResult(instance, resolvedResult, isSSR);
9527
+ setInSSRSetupState(true);
9528
+ try {
9529
+ handleSetupResult(instance, resolvedResult, isSSR);
9530
+ } finally {
9531
+ setInSSRSetupState(false);
9532
+ }
9433
9533
  }).catch((e) => {
9434
9534
  handleError(e, instance, 0);
9435
9535
  });
@@ -9494,7 +9594,7 @@ var Vue = (function() {
9494
9594
  applyOptions(instance);
9495
9595
  } finally {
9496
9596
  setActiveSub(prevSub);
9497
- setCurrentInstance(...prevInstance);
9597
+ restoreCurrentInstance(prevInstance);
9498
9598
  }
9499
9599
  }
9500
9600
  if (!Component.render && instance.render === NOOP && !isSSR) if (!compile$1 && Component.template)
@@ -9804,7 +9904,7 @@ var Vue = (function() {
9804
9904
  }
9805
9905
  //#endregion
9806
9906
  //#region packages/runtime-core/src/index.ts
9807
- const version = "3.6.0-rc.1";
9907
+ const version = "3.6.0-rc.3";
9808
9908
  const warn = warn$1;
9809
9909
  /**
9810
9910
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -10570,7 +10670,7 @@ var Vue = (function() {
10570
10670
  if (!this._instance) if (this._resolved) this._mountComponent(this._def);
10571
10671
  else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
10572
10672
  this._pendingResolve = void 0;
10573
- this._resolveDef();
10673
+ if (this.isConnected) return this._resolveDef();
10574
10674
  });
10575
10675
  else this._resolveDef();
10576
10676
  }
@@ -10606,7 +10706,7 @@ var Vue = (function() {
10606
10706
  * resolve inner component definition (handle possible async component)
10607
10707
  */
10608
10708
  _resolveDef() {
10609
- if (this._pendingResolve) return;
10709
+ if (this._pendingResolve) return this._pendingResolve;
10610
10710
  for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
10611
10711
  this._ob = new MutationObserver(this._processMutations.bind(this));
10612
10712
  this._ob.observe(this, { attributes: true });
@@ -10636,6 +10736,7 @@ var Vue = (function() {
10636
10736
  this._def = def;
10637
10737
  resolve(def);
10638
10738
  });
10739
+ return this._pendingResolve;
10639
10740
  } else resolve(this._def);
10640
10741
  }
10641
10742
  _mountComponent(def) {
@@ -10674,14 +10775,17 @@ var Vue = (function() {
10674
10775
  const { props } = def;
10675
10776
  const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
10676
10777
  for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
10677
- for (const key of declaredPropKeys.map(camelize)) Object.defineProperty(this, key, {
10678
- get() {
10679
- return this._getProp(key);
10680
- },
10681
- set(val) {
10682
- this._setProp(key, val, true, !this._patching);
10683
- }
10684
- });
10778
+ for (const key of declaredPropKeys.map(camelize)) {
10779
+ if (key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
10780
+ Object.defineProperty(this, key, {
10781
+ get() {
10782
+ return this._getProp(key);
10783
+ },
10784
+ set(val) {
10785
+ this._setProp(key, val, true, !this._patching);
10786
+ }
10787
+ });
10788
+ }
10685
10789
  }
10686
10790
  _setAttr(key) {
10687
10791
  if (key.startsWith("data-v-")) return;
@@ -11083,13 +11187,22 @@ var Vue = (function() {
11083
11187
  }
11084
11188
  }
11085
11189
  const assignKey = Symbol("_assign");
11190
+ const initialValueKey = Symbol("_initialValue");
11086
11191
  const vModelText = {
11087
11192
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
11193
+ if (el.parentNode) {
11194
+ if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
11195
+ else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
11196
+ }
11088
11197
  el[assignKey] = getModelAssigner(vnode);
11089
11198
  vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
11090
11199
  },
11091
- mounted(el, { value }) {
11092
- el.value = value == null ? "" : value;
11200
+ mounted(el, { value, modifiers: { trim, number } }) {
11201
+ const newValue = value == null ? "" : value;
11202
+ const initialValue = el[initialValueKey];
11203
+ delete el[initialValueKey];
11204
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
11205
+ else el.value = newValue;
11093
11206
  },
11094
11207
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
11095
11208
  el[assignKey] = getModelAssigner(vnode);
@@ -13715,7 +13828,7 @@ var Vue = (function() {
13715
13828
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
13716
13829
  return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
13717
13830
  }
13718
- function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
13831
+ function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
13719
13832
  const context = {
13720
13833
  filename,
13721
13834
  selfName: getSelfName(filename),
@@ -13737,7 +13850,6 @@ var Vue = (function() {
13737
13850
  bindingMetadata,
13738
13851
  inline,
13739
13852
  isTS,
13740
- eventDelegation,
13741
13853
  onError,
13742
13854
  onWarn,
13743
13855
  compatConfig,
@@ -14548,15 +14660,22 @@ var Vue = (function() {
14548
14660
  else {
14549
14661
  childBlock = children[0].codegenNode;
14550
14662
  if (isTemplate && keyProperty) injectProp(childBlock, keyProperty, context);
14551
- if (childBlock.isBlock !== !isStableFragment) if (childBlock.isBlock) {
14663
+ const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
14664
+ if (childBlock.isBlock !== shouldUseBlock) if (childBlock.isBlock) {
14552
14665
  removeHelper(OPEN_BLOCK);
14553
14666
  removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
14554
14667
  } else removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
14555
- childBlock.isBlock = !isStableFragment;
14668
+ childBlock.isBlock = shouldUseBlock;
14556
14669
  if (childBlock.isBlock) {
14557
14670
  helper(OPEN_BLOCK);
14558
14671
  helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
14559
- } else helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
14672
+ } else {
14673
+ helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
14674
+ if (childBlock.needsPatch) {
14675
+ var _childBlock$patchFlag;
14676
+ childBlock.patchFlag = ((_childBlock$patchFlag = childBlock.patchFlag) !== null && _childBlock$patchFlag !== void 0 ? _childBlock$patchFlag : 0) | 512;
14677
+ }
14678
+ }
14560
14679
  }
14561
14680
  if (memo) {
14562
14681
  const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [createSimpleExpression(`_cached`)]));
@@ -14780,12 +14899,16 @@ var Vue = (function() {
14780
14899
  let vnodeDynamicProps;
14781
14900
  let dynamicPropNames;
14782
14901
  let vnodeDirectives;
14902
+ let needsPatch = false;
14903
+ let isBlockRequired = false;
14783
14904
  let shouldUseBlock = isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && (tag === "svg" || tag === "foreignObject" || tag === "math");
14784
14905
  if (props.length > 0) {
14785
14906
  const propsBuildResult = buildProps(node, context, void 0, isComponent, isDynamicComponent);
14786
14907
  vnodeProps = propsBuildResult.props;
14787
14908
  patchFlag = propsBuildResult.patchFlag;
14788
14909
  dynamicPropNames = propsBuildResult.dynamicPropNames;
14910
+ needsPatch = propsBuildResult.needsPatch;
14911
+ isBlockRequired = propsBuildResult.isBlockRequired;
14789
14912
  const directives = propsBuildResult.directives;
14790
14913
  vnodeDirectives = directives && directives.length ? createArrayExpression(directives.map((dir) => buildDirectiveArgs(dir, context))) : void 0;
14791
14914
  if (propsBuildResult.shouldUseBlock) shouldUseBlock = true;
@@ -14814,7 +14937,10 @@ var Vue = (function() {
14814
14937
  } else vnodeChildren = node.children;
14815
14938
  }
14816
14939
  if (dynamicPropNames && dynamicPropNames.length) vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
14817
- node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
14940
+ const vnodeCall = node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
14941
+ needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
14942
+ if (needsPatch) vnodeCall.needsPatch = true;
14943
+ if (isBlockRequired) vnodeCall.isBlockRequired = true;
14818
14944
  };
14819
14945
  };
14820
14946
  function resolveComponentType(node, context, ssr = false) {
@@ -14848,6 +14974,7 @@ var Vue = (function() {
14848
14974
  const runtimeDirectives = [];
14849
14975
  const hasChildren = children.length > 0;
14850
14976
  let shouldUseBlock = false;
14977
+ let isBlockRequired = false;
14851
14978
  let patchFlag = 0;
14852
14979
  let hasRef = false;
14853
14980
  let hasClassBinding = false;
@@ -14872,12 +14999,12 @@ var Vue = (function() {
14872
14999
  const isEventHandler = isOn(name);
14873
15000
  if (isEventHandler && (!isComponent || isDynamicComponent) && name.toLowerCase() !== "onclick" && name !== "onUpdate:modelValue" && !isReservedProp(name)) hasHydrationEventBinding = true;
14874
15001
  if (isEventHandler && isReservedProp(name)) hasVnodeHook = true;
15002
+ if (name === "ref") hasRef = true;
14875
15003
  if (isEventHandler && value.type === 14) value = value.arguments[0];
14876
15004
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) return;
14877
- if (name === "ref") hasRef = true;
14878
- else if (name === "class") hasClassBinding = true;
15005
+ if (name === "class") hasClassBinding = true;
14879
15006
  else if (name === "style") hasStyleBinding = true;
14880
- else if (name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
15007
+ else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
14881
15008
  if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
14882
15009
  } else hasDynamicKeys = true;
14883
15010
  };
@@ -14903,7 +15030,11 @@ var Vue = (function() {
14903
15030
  if (name === "once" || name === "memo") continue;
14904
15031
  if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled("COMPILER_IS_ON_ELEMENT", context))) continue;
14905
15032
  if (isVOn && ssr) continue;
14906
- if (isVBind && isStaticArgOf(arg, "key") || isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")) shouldUseBlock = true;
15033
+ if (isVBind && isStaticArgOf(arg, "key")) shouldUseBlock = true;
15034
+ if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
15035
+ shouldUseBlock = true;
15036
+ isBlockRequired = true;
15037
+ }
14907
15038
  if (isVBind && isStaticArgOf(arg, "ref")) pushRefVForMarker();
14908
15039
  if (!arg && (isVBind || isVOn)) {
14909
15040
  hasDynamicKeys = true;
@@ -14945,7 +15076,10 @@ var Vue = (function() {
14945
15076
  }
14946
15077
  } else if (!isBuiltInDirective(name)) {
14947
15078
  runtimeDirectives.push(prop);
14948
- if (hasChildren) shouldUseBlock = true;
15079
+ if (hasChildren) {
15080
+ shouldUseBlock = true;
15081
+ isBlockRequired = true;
15082
+ }
14949
15083
  }
14950
15084
  }
14951
15085
  }
@@ -14962,7 +15096,8 @@ var Vue = (function() {
14962
15096
  if (dynamicPropNames.length) patchFlag |= 8;
14963
15097
  if (hasHydrationEventBinding) patchFlag |= 32;
14964
15098
  }
14965
- if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) patchFlag |= 512;
15099
+ const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
15100
+ if (!shouldUseBlock && needsPatch) patchFlag |= 512;
14966
15101
  if (!context.inSSR && propsExpression) switch (propsExpression.type) {
14967
15102
  case 15:
14968
15103
  let classKeyIndex = -1;
@@ -14992,7 +15127,9 @@ var Vue = (function() {
14992
15127
  directives: runtimeDirectives,
14993
15128
  patchFlag,
14994
15129
  dynamicPropNames,
14995
- shouldUseBlock
15130
+ shouldUseBlock,
15131
+ needsPatch,
15132
+ isBlockRequired
14996
15133
  };
14997
15134
  }
14998
15135
  function dedupeProperties(properties) {
@@ -15659,6 +15796,14 @@ var Vue = (function() {
15659
15796
  const eventOptionModifiers = [];
15660
15797
  for (let i = 0; i < modifiers.length; i++) {
15661
15798
  const modifier = modifiers[i].content;
15799
+ if (modifier === "delegate") {
15800
+ if (context) {
15801
+ const error = /* @__PURE__ */ new SyntaxError(`.delegate modifier is only supported in Vapor components.`);
15802
+ error.loc = modifiers[i].loc;
15803
+ context.onWarn(error);
15804
+ }
15805
+ continue;
15806
+ }
15662
15807
  if (modifier === "native" && context && checkCompatEnabled("COMPILER_V_ON_NATIVE", context, loc)) eventOptionModifiers.push(modifier);
15663
15808
  else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
15664
15809
  else {