@vue/compat 3.5.39 → 3.5.41

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.5.39
2
+ * @vue/compat v3.5.41
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -267,7 +267,7 @@ const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
267
267
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
268
268
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
269
269
  const isBooleanAttr = /* @__PURE__ */ makeMap(
270
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
270
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
271
271
  );
272
272
  function includeBooleanAttr(value) {
273
273
  return !!value || value === "";
@@ -449,8 +449,9 @@ class EffectScope {
449
449
  this._isPaused = true;
450
450
  let i, l;
451
451
  if (this.scopes) {
452
- for (i = 0, l = this.scopes.length; i < l; i++) {
453
- this.scopes[i].pause();
452
+ const scopes = this.scopes.slice();
453
+ for (i = 0, l = scopes.length; i < l; i++) {
454
+ scopes[i].pause();
454
455
  }
455
456
  }
456
457
  for (i = 0, l = this.effects.length; i < l; i++) {
@@ -467,12 +468,14 @@ class EffectScope {
467
468
  this._isPaused = false;
468
469
  let i, l;
469
470
  if (this.scopes) {
470
- for (i = 0, l = this.scopes.length; i < l; i++) {
471
- this.scopes[i].resume();
471
+ const scopes = this.scopes.slice();
472
+ for (i = 0, l = scopes.length; i < l; i++) {
473
+ scopes[i].resume();
472
474
  }
473
475
  }
474
- for (i = 0, l = this.effects.length; i < l; i++) {
475
- this.effects[i].resume();
476
+ const effects = this.effects.slice();
477
+ for (i = 0, l = effects.length; i < l; i++) {
478
+ effects[i].resume();
476
479
  }
477
480
  }
478
481
  }
@@ -534,8 +537,9 @@ class EffectScope {
534
537
  }
535
538
  this.cleanups.length = 0;
536
539
  if (this.scopes) {
537
- for (i = 0, l = this.scopes.length; i < l; i++) {
538
- this.scopes[i].stop(true);
540
+ const scopes = this.scopes.slice();
541
+ for (i = 0, l = scopes.length; i < l; i++) {
542
+ scopes[i].stop(true);
539
543
  }
540
544
  this.scopes.length = 0;
541
545
  }
@@ -2681,7 +2685,9 @@ function queuePostFlushCb(cb) {
2681
2685
  cb.flags |= 1;
2682
2686
  }
2683
2687
  } else {
2684
- pendingPostFlushCbs.push(...cb);
2688
+ for (let i = 0; i < cb.length; i++) {
2689
+ pendingPostFlushCbs.push(cb[i]);
2690
+ }
2685
2691
  }
2686
2692
  queueFlush();
2687
2693
  }
@@ -2717,7 +2723,9 @@ function flushPostFlushCbs(seen) {
2717
2723
  );
2718
2724
  pendingPostFlushCbs.length = 0;
2719
2725
  if (activePostFlushCbs) {
2720
- activePostFlushCbs.push(...deduped);
2726
+ for (let i = 0; i < deduped.length; i++) {
2727
+ activePostFlushCbs.push(deduped[i]);
2728
+ }
2721
2729
  return;
2722
2730
  }
2723
2731
  activePostFlushCbs = deduped;
@@ -3475,10 +3483,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
3475
3483
  setBlockTracking(-1);
3476
3484
  }
3477
3485
  const prevInstance = setCurrentRenderingInstance(ctx);
3486
+ const prevStackSize = blockStack.length;
3478
3487
  let res;
3479
3488
  try {
3480
3489
  res = fn(...args);
3481
3490
  } finally {
3491
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
3482
3492
  setCurrentRenderingInstance(prevInstance);
3483
3493
  if (renderFnWithContext._d) {
3484
3494
  setBlockTracking(1);
@@ -4480,7 +4490,11 @@ function getInnerChild$1(vnode) {
4480
4490
  function setTransitionHooks(vnode, hooks) {
4481
4491
  if (vnode.shapeFlag & 6 && vnode.component) {
4482
4492
  vnode.transition = hooks;
4483
- setTransitionHooks(vnode.component.subTree, hooks);
4493
+ const subTree = vnode.component.subTree;
4494
+ setTransitionHooks(
4495
+ isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
4496
+ hooks
4497
+ );
4484
4498
  } else if (vnode.shapeFlag & 128) {
4485
4499
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4486
4500
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -4640,12 +4654,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4640
4654
  }
4641
4655
  }
4642
4656
  if (isFunction(ref)) {
4643
- pauseTracking();
4644
- try {
4645
- callWithErrorHandling(ref, owner, 12, [value, refs]);
4646
- } finally {
4647
- resetTracking();
4648
- }
4657
+ callWithErrorHandling(ref, owner, 12, [value, refs]);
4649
4658
  } else {
4650
4659
  const _isString = isString(ref);
4651
4660
  const _isRef = isRef(ref);
@@ -5017,6 +5026,7 @@ Server rendered element contains more child nodes than client vdom.`
5017
5026
  if (props) {
5018
5027
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || hasDynamicProps || !optimized || patchFlag & (16 | 32)) {
5019
5028
  const isCustomElement = el.tagName.includes("-");
5029
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
5020
5030
  for (const key in props) {
5021
5031
  if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks
5022
5032
  // as it could have mutated the DOM in any possible way
@@ -5025,7 +5035,10 @@ Server rendered element contains more child nodes than client vdom.`
5025
5035
  }
5026
5036
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
5027
5037
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
5028
- patchProp(el, key, null, props[key], void 0, parentComponent);
5038
+ if (isUnchangedResourceProp(el, key, props[key])) {
5039
+ continue;
5040
+ }
5041
+ patchProp(el, key, null, props[key], namespace, parentComponent);
5029
5042
  }
5030
5043
  }
5031
5044
  } else if (props.onClick) {
@@ -5218,6 +5231,13 @@ Server rendered element contains fewer child nodes than client vdom.`
5218
5231
  };
5219
5232
  return [hydrate, hydrateNode];
5220
5233
  }
5234
+ const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
5235
+ function isUnchangedResourceProp(el, key, clientValue) {
5236
+ if (!resourceProps.has(key)) {
5237
+ return false;
5238
+ }
5239
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
5240
+ }
5221
5241
  function propHasMismatch(el, key, clientValue, vnode, instance) {
5222
5242
  let mismatchType;
5223
5243
  let mismatchKey;
@@ -5255,7 +5275,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
5255
5275
  mismatchKey = "style";
5256
5276
  }
5257
5277
  } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
5258
- if (isBooleanAttr(key)) {
5278
+ if (key === "hidden") {
5279
+ actual = normalizeHiddenValue(el.getAttribute(key));
5280
+ expected = normalizeHiddenValue(clientValue);
5281
+ } else if (isBooleanAttr(key)) {
5259
5282
  actual = el.hasAttribute(key);
5260
5283
  expected = includeBooleanAttr(clientValue);
5261
5284
  } else if (clientValue == null) {
@@ -5291,6 +5314,15 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
5291
5314
  }
5292
5315
  return false;
5293
5316
  }
5317
+ function normalizeHiddenValue(value) {
5318
+ if (!isRenderableAttrValue(value)) {
5319
+ return false;
5320
+ }
5321
+ if (isString(value)) {
5322
+ return value.toLowerCase() === "until-found" ? "until-found" : "";
5323
+ }
5324
+ return includeBooleanAttr(value) ? "" : false;
5325
+ }
5294
5326
  function toClassSet(str) {
5295
5327
  return new Set(str.trim().split(/\s+/));
5296
5328
  }
@@ -5539,6 +5571,7 @@ function defineAsyncComponent(source) {
5539
5571
  name: "AsyncComponentWrapper",
5540
5572
  __asyncLoader: load,
5541
5573
  __asyncHydrate(el, instance, hydrate) {
5574
+ const wasConnected = el.isConnected;
5542
5575
  let patched = false;
5543
5576
  (instance.bu || (instance.bu = [])).push(() => patched = true);
5544
5577
  const performHydrate = () => {
@@ -5550,6 +5583,7 @@ function defineAsyncComponent(source) {
5550
5583
  }
5551
5584
  return;
5552
5585
  }
5586
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
5553
5587
  hydrate();
5554
5588
  };
5555
5589
  const doHydrate = hydrateStrategy ? () => {
@@ -6399,14 +6433,16 @@ function createSlots(slots, dynamicSlots) {
6399
6433
  return slots;
6400
6434
  }
6401
6435
 
6402
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
6436
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
6437
+ if (props == null) props = {};
6403
6438
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
6404
- const hasProps = Object.keys(props).length > 0;
6405
- if (name !== "default") props.name = name;
6439
+ const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
6440
+ const hasProps = Object.keys(slotProps).length > 0;
6441
+ if (name !== "default") slotProps.name = name;
6406
6442
  return openBlock(), createBlock(
6407
6443
  Fragment,
6408
6444
  null,
6409
- [createVNode("slot", props, fallback && fallback())],
6445
+ [createVNode("slot", slotProps, fallback && fallback())],
6410
6446
  hasProps ? -2 : 64
6411
6447
  );
6412
6448
  }
@@ -6420,26 +6456,34 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
6420
6456
  if (slot && slot._c) {
6421
6457
  slot._d = false;
6422
6458
  }
6459
+ const prevStackSize = blockStack.length;
6423
6460
  openBlock();
6424
- const validSlotContent = slot && ensureValidVNode(slot(props));
6425
- const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
6426
- // key attached in the `createSlots` helper, respect that
6427
- validSlotContent && validSlotContent.key;
6428
- const rendered = createBlock(
6429
- Fragment,
6430
- {
6431
- key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
6432
- (!validSlotContent && fallback ? "_fb" : "")
6433
- },
6434
- validSlotContent || (fallback ? fallback() : []),
6435
- validSlotContent && slots._ === 1 ? 64 : -2
6436
- );
6461
+ let rendered;
6462
+ try {
6463
+ const validSlotContent = slot && ensureValidVNode(slot(props));
6464
+ const slotKey = props.key || branchKey || // slot content array of a dynamic conditional slot may have a branch
6465
+ // key attached in the `createSlots` helper, respect that
6466
+ validSlotContent && validSlotContent.key;
6467
+ rendered = createBlock(
6468
+ Fragment,
6469
+ {
6470
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
6471
+ (!validSlotContent && fallback ? "_fb" : "")
6472
+ },
6473
+ validSlotContent || (fallback ? fallback() : []),
6474
+ validSlotContent && slots._ === 1 ? 64 : -2
6475
+ );
6476
+ } catch (err) {
6477
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
6478
+ throw err;
6479
+ } finally {
6480
+ if (slot && slot._c) {
6481
+ slot._d = true;
6482
+ }
6483
+ }
6437
6484
  if (!noSlotted && rendered.scopeId) {
6438
6485
  rendered.slotScopeIds = [rendered.scopeId + "-s"];
6439
6486
  }
6440
- if (slot && slot._c) {
6441
- slot._d = true;
6442
- }
6443
6487
  return rendered;
6444
6488
  }
6445
6489
  function ensureValidVNode(vnodes) {
@@ -7619,7 +7663,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7619
7663
  return vm;
7620
7664
  }
7621
7665
  }
7622
- Vue.version = `2.6.14-compat:${"3.5.39"}`;
7666
+ Vue.version = `2.6.14-compat:${"3.5.41"}`;
7623
7667
  Vue.config = singletonApp.config;
7624
7668
  Vue.use = (plugin, ...options) => {
7625
7669
  if (plugin && isFunction(plugin.install)) {
@@ -8643,12 +8687,13 @@ function renderComponentRoot(instance) {
8643
8687
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
8644
8688
  }
8645
8689
  if (vnode.transition) {
8646
- if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) {
8690
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
8691
+ if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(child)) {
8647
8692
  warn$1(
8648
8693
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8649
8694
  );
8650
8695
  }
8651
- setTransitionHooks(root, vnode.transition);
8696
+ setTransitionHooks(child, vnode.transition);
8652
8697
  }
8653
8698
  if (!!(process.env.NODE_ENV !== "production") && setRoot) {
8654
8699
  setRoot(root);
@@ -11440,7 +11485,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11440
11485
  let hasUnresolvedAncestor = false;
11441
11486
  while (parent) {
11442
11487
  if (parent.pendingBranch) {
11443
- parent.effects.push(...effects);
11488
+ for (let i = 0; i < effects.length; i++) {
11489
+ parent.effects.push(effects[i]);
11490
+ }
11444
11491
  hasUnresolvedAncestor = true;
11445
11492
  break;
11446
11493
  }
@@ -11862,6 +11909,14 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
11862
11909
  if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) {
11863
11910
  warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
11864
11911
  }
11912
+ if (!!(process.env.NODE_ENV !== "production") && props && vnode.shapeFlag & 1) {
11913
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
11914
+ if (overwritingProp && hasContentChildren(vnode.children)) {
11915
+ warn$1(
11916
+ `The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`
11917
+ );
11918
+ }
11919
+ }
11865
11920
  if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
11866
11921
  !isBlockNode && // has current parent block
11867
11922
  currentBlock && // presence of a patch flag indicates this node needs patching on updates.
@@ -11879,6 +11934,11 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
11879
11934
  }
11880
11935
  return vnode;
11881
11936
  }
11937
+ function hasContentChildren(children) {
11938
+ if (isString(children)) return children !== "";
11939
+ if (isArray(children)) return children.length > 0;
11940
+ return false;
11941
+ }
11882
11942
  const createVNode = !!(process.env.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode;
11883
11943
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
11884
11944
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -12335,7 +12395,12 @@ function setupStatefulComponent(instance, isSSR) {
12335
12395
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
12336
12396
  if (isSSR) {
12337
12397
  return setupResult.then((resolvedResult) => {
12338
- handleSetupResult(instance, resolvedResult, isSSR);
12398
+ setInSSRSetupState(true);
12399
+ try {
12400
+ handleSetupResult(instance, resolvedResult, isSSR);
12401
+ } finally {
12402
+ setInSSRSetupState(false);
12403
+ }
12339
12404
  }).catch((e) => {
12340
12405
  handleError(e, instance, 0);
12341
12406
  });
@@ -12825,7 +12890,7 @@ function isMemoSame(cached, memo) {
12825
12890
  return true;
12826
12891
  }
12827
12892
 
12828
- const version = "3.5.39";
12893
+ const version = "3.5.41";
12829
12894
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12830
12895
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12831
12896
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -13883,7 +13948,9 @@ class VueElement extends BaseClass {
13883
13948
  if (parent && parent._pendingResolve) {
13884
13949
  this._pendingResolve = parent._pendingResolve.then(() => {
13885
13950
  this._pendingResolve = void 0;
13886
- this._resolveDef();
13951
+ if (this.isConnected) {
13952
+ return this._resolveDef();
13953
+ }
13887
13954
  });
13888
13955
  } else {
13889
13956
  this._resolveDef();
@@ -13933,7 +14000,7 @@ class VueElement extends BaseClass {
13933
14000
  */
13934
14001
  _resolveDef() {
13935
14002
  if (this._pendingResolve) {
13936
- return;
14003
+ return this._pendingResolve;
13937
14004
  }
13938
14005
  for (let i = 0; i < this.attributes.length; i++) {
13939
14006
  this._setAttr(this.attributes[i].name);
@@ -13973,6 +14040,7 @@ class VueElement extends BaseClass {
13973
14040
  def.configureApp = this._def.configureApp;
13974
14041
  resolve(this._def = def, true);
13975
14042
  });
14043
+ return this._pendingResolve;
13976
14044
  } else {
13977
14045
  resolve(this._def);
13978
14046
  }
@@ -14010,6 +14078,11 @@ class VueElement extends BaseClass {
14010
14078
  }
14011
14079
  }
14012
14080
  for (const key of declaredPropKeys.map(camelize)) {
14081
+ if (!!(process.env.NODE_ENV !== "production") && key in Object.getPrototypeOf(this)) {
14082
+ warn(
14083
+ `Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`
14084
+ );
14085
+ }
14013
14086
  Object.defineProperty(this, key, {
14014
14087
  get() {
14015
14088
  return this._getProp(key);
@@ -14503,6 +14576,7 @@ function onCompositionEnd(e) {
14503
14576
  }
14504
14577
  }
14505
14578
  const assignKey = /* @__PURE__ */ Symbol("_assign");
14579
+ const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
14506
14580
  function castValue(value, trim, number) {
14507
14581
  if (trim) value = value.trim();
14508
14582
  if (number) value = looseToNumber(value);
@@ -14510,6 +14584,13 @@ function castValue(value, trim, number) {
14510
14584
  }
14511
14585
  const vModelText = {
14512
14586
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
14587
+ if (el.parentNode) {
14588
+ if (el.type === "text") {
14589
+ el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
14590
+ } else if (el.type === "textarea") {
14591
+ el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
14592
+ }
14593
+ }
14513
14594
  el[assignKey] = getModelAssigner(vnode);
14514
14595
  const castToNumber = number || vnode.props && vnode.props.type === "number";
14515
14596
  addEventListener(el, lazy ? "change" : "input", (e) => {
@@ -14528,8 +14609,15 @@ const vModelText = {
14528
14609
  }
14529
14610
  },
14530
14611
  // set value on mounted so it's after min/max for type="range"
14531
- mounted(el, { value }) {
14532
- el.value = value == null ? "" : value;
14612
+ mounted(el, { value, modifiers: { trim, number } }) {
14613
+ const newValue = value == null ? "" : value;
14614
+ const initialValue = el[initialValueKey];
14615
+ delete el[initialValueKey];
14616
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
14617
+ el[assignKey](castValue(el.value, trim, number));
14618
+ } else {
14619
+ el.value = newValue;
14620
+ }
14533
14621
  },
14534
14622
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
14535
14623
  el[assignKey] = getModelAssigner(vnode);
@@ -14625,13 +14713,13 @@ const vModelSelect = {
14625
14713
  // <select multiple> value need to be deep traversed
14626
14714
  deep: true,
14627
14715
  created(el, { value, modifiers: { number } }, vnode) {
14628
- const isSetModel = isSet(value);
14716
+ el._modelValue = value;
14629
14717
  addEventListener(el, "change", () => {
14630
14718
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
14631
14719
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
14632
14720
  );
14633
14721
  el[assignKey](
14634
- el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
14722
+ el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]
14635
14723
  );
14636
14724
  el._assigning = true;
14637
14725
  nextTick(() => {
@@ -14645,7 +14733,8 @@ const vModelSelect = {
14645
14733
  mounted(el, { value }) {
14646
14734
  setSelected(el, value);
14647
14735
  },
14648
- beforeUpdate(el, _binding, vnode) {
14736
+ beforeUpdate(el, { value }, vnode) {
14737
+ el._modelValue = value;
14649
14738
  el[assignKey] = getModelAssigner(vnode);
14650
14739
  },
14651
14740
  updated(el, { value }) {
@@ -16578,6 +16667,9 @@ function getUnnormalizedProps(props, callPath = []) {
16578
16667
  return [props, callPath];
16579
16668
  }
16580
16669
  function injectProp(node, prop, context) {
16670
+ if (node.type !== 13 && injectSlotKey(node, prop)) {
16671
+ return;
16672
+ }
16581
16673
  let propsWithInjection;
16582
16674
  let props = node.type === 13 ? node.props : node.arguments[2];
16583
16675
  let callPath = [];
@@ -16635,6 +16727,24 @@ function injectProp(node, prop, context) {
16635
16727
  }
16636
16728
  }
16637
16729
  }
16730
+ function injectSlotKey(node, prop) {
16731
+ var _a, _b, _c;
16732
+ if (prop.key.type !== 4 || prop.key.content !== "key") {
16733
+ return false;
16734
+ }
16735
+ const props = node.arguments[2];
16736
+ if (props && !isString(props)) {
16737
+ const [unnormalizedProps] = getUnnormalizedProps(props);
16738
+ if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) {
16739
+ return true;
16740
+ }
16741
+ }
16742
+ (_a = node.arguments)[2] || (_a[2] = "{}");
16743
+ (_b = node.arguments)[3] || (_b[3] = "undefined");
16744
+ (_c = node.arguments)[4] || (_c[4] = "undefined");
16745
+ node.arguments[5] = prop.value;
16746
+ return true;
16747
+ }
16638
16748
  function hasProp(prop, props) {
16639
16749
  let result = false;
16640
16750
  if (prop.key.type === 4) {
@@ -18904,6 +19014,7 @@ const transformFor = createStructuralDirectiveTransform(
18904
19014
  node.loc
18905
19015
  );
18906
19016
  return () => {
19017
+ var _a;
18907
19018
  let childBlock;
18908
19019
  const { children } = forNode;
18909
19020
  if ((!!(process.env.NODE_ENV !== "production") || false) && isTemplate) {
@@ -18947,7 +19058,8 @@ const transformFor = createStructuralDirectiveTransform(
18947
19058
  if (isTemplate && keyProperty) {
18948
19059
  injectProp(childBlock, keyProperty, context);
18949
19060
  }
18950
- if (childBlock.isBlock !== !isStableFragment) {
19061
+ const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
19062
+ if (childBlock.isBlock !== shouldUseBlock) {
18951
19063
  if (childBlock.isBlock) {
18952
19064
  removeHelper(OPEN_BLOCK);
18953
19065
  removeHelper(
@@ -18959,12 +19071,15 @@ const transformFor = createStructuralDirectiveTransform(
18959
19071
  );
18960
19072
  }
18961
19073
  }
18962
- childBlock.isBlock = !isStableFragment;
19074
+ childBlock.isBlock = shouldUseBlock;
18963
19075
  if (childBlock.isBlock) {
18964
19076
  helper(OPEN_BLOCK);
18965
19077
  helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
18966
19078
  } else {
18967
19079
  helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
19080
+ if (childBlock.needsPatch) {
19081
+ childBlock.patchFlag = ((_a = childBlock.patchFlag) != null ? _a : 0) | 512;
19082
+ }
18968
19083
  }
18969
19084
  }
18970
19085
  if (memo) {
@@ -19343,6 +19458,8 @@ const transformElement = (node, context) => {
19343
19458
  let vnodeDynamicProps;
19344
19459
  let dynamicPropNames;
19345
19460
  let vnodeDirectives;
19461
+ let needsPatch = false;
19462
+ let isBlockRequired = false;
19346
19463
  let shouldUseBlock = (
19347
19464
  // dynamic component may resolve to plain elements
19348
19465
  isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
@@ -19362,6 +19479,8 @@ const transformElement = (node, context) => {
19362
19479
  vnodeProps = propsBuildResult.props;
19363
19480
  patchFlag = propsBuildResult.patchFlag;
19364
19481
  dynamicPropNames = propsBuildResult.dynamicPropNames;
19482
+ needsPatch = propsBuildResult.needsPatch;
19483
+ isBlockRequired = propsBuildResult.isBlockRequired;
19365
19484
  const directives = propsBuildResult.directives;
19366
19485
  vnodeDirectives = directives && directives.length ? createArrayExpression(
19367
19486
  directives.map((dir) => buildDirectiveArgs(dir, context))
@@ -19412,7 +19531,7 @@ const transformElement = (node, context) => {
19412
19531
  if (dynamicPropNames && dynamicPropNames.length) {
19413
19532
  vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
19414
19533
  }
19415
- node.codegenNode = createVNodeCall(
19534
+ const vnodeCall = node.codegenNode = createVNodeCall(
19416
19535
  context,
19417
19536
  vnodeTag,
19418
19537
  vnodeProps,
@@ -19425,6 +19544,13 @@ const transformElement = (node, context) => {
19425
19544
  isComponent,
19426
19545
  node.loc
19427
19546
  );
19547
+ needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
19548
+ if (needsPatch) {
19549
+ vnodeCall.needsPatch = true;
19550
+ }
19551
+ if (isBlockRequired) {
19552
+ vnodeCall.isBlockRequired = true;
19553
+ }
19428
19554
  };
19429
19555
  };
19430
19556
  function resolveComponentType(node, context, ssr = false) {
@@ -19476,6 +19602,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19476
19602
  const runtimeDirectives = [];
19477
19603
  const hasChildren = children.length > 0;
19478
19604
  let shouldUseBlock = false;
19605
+ let isBlockRequired = false;
19479
19606
  let patchFlag = 0;
19480
19607
  let hasRef = false;
19481
19608
  let hasClassBinding = false;
@@ -19517,19 +19644,20 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19517
19644
  if (isEventHandler && isReservedProp(name)) {
19518
19645
  hasVnodeHook = true;
19519
19646
  }
19647
+ if (name === "ref") {
19648
+ hasRef = true;
19649
+ }
19520
19650
  if (isEventHandler && value.type === 14) {
19521
19651
  value = value.arguments[0];
19522
19652
  }
19523
19653
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
19524
19654
  return;
19525
19655
  }
19526
- if (name === "ref") {
19527
- hasRef = true;
19528
- } else if (name === "class") {
19656
+ if (name === "class") {
19529
19657
  hasClassBinding = true;
19530
19658
  } else if (name === "style") {
19531
19659
  hasStyleBinding = true;
19532
- } else if (name !== "key" && !dynamicPropNames.includes(name)) {
19660
+ } else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) {
19533
19661
  dynamicPropNames.push(name);
19534
19662
  }
19535
19663
  if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
@@ -19588,13 +19716,12 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19588
19716
  if (isVOn && ssr) {
19589
19717
  continue;
19590
19718
  }
19591
- if (
19592
- // #938: elements with dynamic keys should be forced into blocks
19593
- isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked
19594
- // before children
19595
- isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
19596
- ) {
19719
+ if (isVBind && isStaticArgOf(arg, "key")) {
19720
+ shouldUseBlock = true;
19721
+ }
19722
+ if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
19597
19723
  shouldUseBlock = true;
19724
+ isBlockRequired = true;
19598
19725
  }
19599
19726
  if (isVBind && isStaticArgOf(arg, "ref")) {
19600
19727
  pushRefVForMarker();
@@ -19677,6 +19804,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19677
19804
  runtimeDirectives.push(prop);
19678
19805
  if (hasChildren) {
19679
19806
  shouldUseBlock = true;
19807
+ isBlockRequired = true;
19680
19808
  }
19681
19809
  }
19682
19810
  }
@@ -19715,7 +19843,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19715
19843
  patchFlag |= 32;
19716
19844
  }
19717
19845
  }
19718
- if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
19846
+ const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
19847
+ if (!shouldUseBlock && needsPatch) {
19719
19848
  patchFlag |= 512;
19720
19849
  }
19721
19850
  if (!context.inSSR && propsExpression) {
@@ -19781,7 +19910,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19781
19910
  directives: runtimeDirectives,
19782
19911
  patchFlag,
19783
19912
  dynamicPropNames,
19784
- shouldUseBlock
19913
+ shouldUseBlock,
19914
+ needsPatch,
19915
+ isBlockRequired
19785
19916
  };
19786
19917
  }
19787
19918
  function dedupeProperties(properties) {