@vue/compat 3.5.40 → 3.5.42

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.40
2
+ * @vue/compat v3.5.42
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 === "";
@@ -302,6 +302,23 @@ function looseCompareArrays(a, b) {
302
302
  }
303
303
  return equal;
304
304
  }
305
+ function looseCompareCollections(a, b) {
306
+ if (a.size !== b.size) return false;
307
+ const candidates = Array.from(b);
308
+ const matched = new Uint8Array(candidates.length);
309
+ for (const item of a) {
310
+ let index = -1;
311
+ for (let i = 0; i < candidates.length; i++) {
312
+ if (!matched[i] && looseEqual(item, candidates[i])) {
313
+ index = i;
314
+ break;
315
+ }
316
+ }
317
+ if (index < 0) return false;
318
+ matched[index] = 1;
319
+ }
320
+ return true;
321
+ }
305
322
  function looseEqual(a, b) {
306
323
  if (a === b) return true;
307
324
  let aValidType = isDate(a);
@@ -325,6 +342,16 @@ function looseEqual(a, b) {
325
342
  if (!aValidType || !bValidType) {
326
343
  return false;
327
344
  }
345
+ aValidType = isMap(a);
346
+ bValidType = isMap(b);
347
+ if (aValidType || bValidType) {
348
+ return aValidType && bValidType ? looseCompareCollections(a, b) : false;
349
+ }
350
+ aValidType = isSet(a);
351
+ bValidType = isSet(b);
352
+ if (aValidType || bValidType) {
353
+ return aValidType && bValidType ? looseCompareCollections(a, b) : false;
354
+ }
328
355
  const aKeysCount = Object.keys(a).length;
329
356
  const bKeysCount = Object.keys(b).length;
330
357
  if (aKeysCount !== bKeysCount) {
@@ -2685,7 +2712,9 @@ function queuePostFlushCb(cb) {
2685
2712
  cb.flags |= 1;
2686
2713
  }
2687
2714
  } else {
2688
- pendingPostFlushCbs.push(...cb);
2715
+ for (let i = 0; i < cb.length; i++) {
2716
+ pendingPostFlushCbs.push(cb[i]);
2717
+ }
2689
2718
  }
2690
2719
  queueFlush();
2691
2720
  }
@@ -2721,7 +2750,9 @@ function flushPostFlushCbs(seen) {
2721
2750
  );
2722
2751
  pendingPostFlushCbs.length = 0;
2723
2752
  if (activePostFlushCbs) {
2724
- activePostFlushCbs.push(...deduped);
2753
+ for (let i = 0; i < deduped.length; i++) {
2754
+ activePostFlushCbs.push(deduped[i]);
2755
+ }
2725
2756
  return;
2726
2757
  }
2727
2758
  activePostFlushCbs = deduped;
@@ -4486,7 +4517,11 @@ function getInnerChild$1(vnode) {
4486
4517
  function setTransitionHooks(vnode, hooks) {
4487
4518
  if (vnode.shapeFlag & 6 && vnode.component) {
4488
4519
  vnode.transition = hooks;
4489
- setTransitionHooks(vnode.component.subTree, hooks);
4520
+ const subTree = vnode.component.subTree;
4521
+ setTransitionHooks(
4522
+ isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
4523
+ hooks
4524
+ );
4490
4525
  } else if (vnode.shapeFlag & 128) {
4491
4526
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4492
4527
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -4889,10 +4924,10 @@ function createHydrationFunctions(rendererInternals) {
4889
4924
  getContainerType(container),
4890
4925
  optimized
4891
4926
  );
4892
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4927
+ if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
4893
4928
  let subTree;
4894
4929
  if (isFragmentStart) {
4895
- subTree = createVNode(Fragment);
4930
+ subTree = createVNode(Static);
4896
4931
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4897
4932
  } else {
4898
4933
  subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
@@ -5027,6 +5062,9 @@ Server rendered element contains more child nodes than client vdom.`
5027
5062
  }
5028
5063
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
5029
5064
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
5065
+ if (isUnchangedResourceProp(el, key, props[key])) {
5066
+ continue;
5067
+ }
5030
5068
  patchProp(el, key, null, props[key], namespace, parentComponent);
5031
5069
  }
5032
5070
  }
@@ -5220,6 +5258,13 @@ Server rendered element contains fewer child nodes than client vdom.`
5220
5258
  };
5221
5259
  return [hydrate, hydrateNode];
5222
5260
  }
5261
+ const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
5262
+ function isUnchangedResourceProp(el, key, clientValue) {
5263
+ if (!resourceProps.has(key)) {
5264
+ return false;
5265
+ }
5266
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
5267
+ }
5223
5268
  function propHasMismatch(el, key, clientValue, vnode, instance) {
5224
5269
  let mismatchType;
5225
5270
  let mismatchKey;
@@ -5257,7 +5302,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
5257
5302
  mismatchKey = "style";
5258
5303
  }
5259
5304
  } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
5260
- if (isBooleanAttr(key)) {
5305
+ if (key === "hidden") {
5306
+ actual = normalizeHiddenValue(el.getAttribute(key));
5307
+ expected = normalizeHiddenValue(clientValue);
5308
+ } else if (isBooleanAttr(key)) {
5261
5309
  actual = el.hasAttribute(key);
5262
5310
  expected = includeBooleanAttr(clientValue);
5263
5311
  } else if (clientValue == null) {
@@ -5293,6 +5341,15 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
5293
5341
  }
5294
5342
  return false;
5295
5343
  }
5344
+ function normalizeHiddenValue(value) {
5345
+ if (!isRenderableAttrValue(value)) {
5346
+ return false;
5347
+ }
5348
+ if (isString(value)) {
5349
+ return value.toLowerCase() === "until-found" ? "until-found" : "";
5350
+ }
5351
+ return includeBooleanAttr(value) ? "" : false;
5352
+ }
5296
5353
  function toClassSet(str) {
5297
5354
  return new Set(str.trim().split(/\s+/));
5298
5355
  }
@@ -5791,7 +5848,10 @@ const KeepAliveImpl = {
5791
5848
  if (pendingCacheKey != null) {
5792
5849
  if (isSuspense(instance.subTree.type)) {
5793
5850
  queuePostRenderEffect(() => {
5794
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5851
+ const vnode = getInnerChild(instance.subTree);
5852
+ if (vnode.component) {
5853
+ cache.set(pendingCacheKey, vnode);
5854
+ }
5795
5855
  }, instance.subTree.suspense);
5796
5856
  } else {
5797
5857
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
@@ -6403,7 +6463,8 @@ function createSlots(slots, dynamicSlots) {
6403
6463
  return slots;
6404
6464
  }
6405
6465
 
6406
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
6466
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
6467
+ if (props == null) props = {};
6407
6468
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
6408
6469
  const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
6409
6470
  const hasProps = Object.keys(slotProps).length > 0;
@@ -6711,12 +6772,41 @@ const getPublicInstance = (i) => {
6711
6772
  if (isStatefulComponent(i)) return getComponentPublicInstance(i);
6712
6773
  return getPublicInstance(i.parent);
6713
6774
  };
6775
+ const resolveDevRootEl = (vnode) => {
6776
+ let found = false;
6777
+ while (true) {
6778
+ if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
6779
+ const root = filterSingleRoot(vnode.children);
6780
+ if (!root) {
6781
+ return;
6782
+ }
6783
+ vnode = root;
6784
+ found = true;
6785
+ continue;
6786
+ }
6787
+ const component = vnode.component;
6788
+ if (component && component.subTree) {
6789
+ vnode = component.subTree;
6790
+ continue;
6791
+ }
6792
+ const suspense = vnode.suspense;
6793
+ if (suspense && suspense.activeBranch) {
6794
+ vnode = suspense.activeBranch;
6795
+ continue;
6796
+ }
6797
+ return found ? vnode.el : void 0;
6798
+ }
6799
+ };
6800
+ const getDevRootFragmentEl = (i) => {
6801
+ const el = i.subTree && resolveDevRootEl(i.subTree);
6802
+ return el === void 0 ? i.vnode.el : el;
6803
+ };
6714
6804
  const publicPropertiesMap = (
6715
6805
  // Move PURE marker to new line to workaround compiler discarding it
6716
6806
  // due to type annotation
6717
6807
  /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
6718
6808
  $: (i) => i,
6719
- $el: (i) => i.vnode.el,
6809
+ $el: (i) => !!(process.env.NODE_ENV !== "production") ? getDevRootFragmentEl(i) : i.vnode.el,
6720
6810
  $data: (i) => i.data,
6721
6811
  $props: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.props) : i.props,
6722
6812
  $attrs: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.attrs) : i.attrs,
@@ -7632,7 +7722,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7632
7722
  return vm;
7633
7723
  }
7634
7724
  }
7635
- Vue.version = `2.6.14-compat:${"3.5.40"}`;
7725
+ Vue.version = `2.6.14-compat:${"3.5.42"}`;
7636
7726
  Vue.config = singletonApp.config;
7637
7727
  Vue.use = (plugin, ...options) => {
7638
7728
  if (plugin && isFunction(plugin.install)) {
@@ -8391,7 +8481,7 @@ function emit(instance, event, ...rawArgs) {
8391
8481
  args = rawArgs.map((a) => isString(a) ? a.trim() : a);
8392
8482
  }
8393
8483
  if (modifiers.number) {
8394
- args = rawArgs.map(looseToNumber);
8484
+ args = args.map(looseToNumber);
8395
8485
  }
8396
8486
  }
8397
8487
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
@@ -8656,12 +8746,13 @@ function renderComponentRoot(instance) {
8656
8746
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
8657
8747
  }
8658
8748
  if (vnode.transition) {
8659
- if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) {
8749
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
8750
+ if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(child)) {
8660
8751
  warn$1(
8661
8752
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8662
8753
  );
8663
8754
  }
8664
- setTransitionHooks(root, vnode.transition);
8755
+ setTransitionHooks(child, vnode.transition);
8665
8756
  }
8666
8757
  if (!!(process.env.NODE_ENV !== "production") && setRoot) {
8667
8758
  setRoot(root);
@@ -11205,7 +11296,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11205
11296
  if (suspense.deps <= 0) {
11206
11297
  suspense.resolve();
11207
11298
  } else if (isInFallback) {
11208
- if (!isHydrating) {
11299
+ if (!isHydrating && !suspense.isFallbackMountPending) {
11209
11300
  patch(
11210
11301
  activeBranch,
11211
11302
  newFallback,
@@ -11246,7 +11337,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11246
11337
  );
11247
11338
  if (suspense.deps <= 0) {
11248
11339
  suspense.resolve();
11249
- } else {
11340
+ } else if (!suspense.isFallbackMountPending) {
11250
11341
  patch(
11251
11342
  activeBranch,
11252
11343
  newFallback,
@@ -11453,7 +11544,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11453
11544
  let hasUnresolvedAncestor = false;
11454
11545
  while (parent) {
11455
11546
  if (parent.pendingBranch) {
11456
- parent.effects.push(...effects);
11547
+ for (let i = 0; i < effects.length; i++) {
11548
+ parent.effects.push(effects[i]);
11549
+ }
11457
11550
  hasUnresolvedAncestor = true;
11458
11551
  break;
11459
11552
  }
@@ -11485,9 +11578,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11485
11578
  if (!suspense.isInFallback) {
11486
11579
  return;
11487
11580
  }
11581
+ const latestFallback = suspense.vnode.ssFallback;
11488
11582
  patch(
11489
11583
  null,
11490
- fallbackVNode,
11584
+ latestFallback,
11491
11585
  container2,
11492
11586
  anchor2,
11493
11587
  parentComponent2,
@@ -11497,7 +11591,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11497
11591
  slotScopeIds,
11498
11592
  optimized
11499
11593
  );
11500
- setActiveBranch(suspense, fallbackVNode);
11594
+ setActiveBranch(suspense, latestFallback);
11501
11595
  };
11502
11596
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
11503
11597
  if (delayEnter) {
@@ -11875,6 +11969,14 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
11875
11969
  if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) {
11876
11970
  warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
11877
11971
  }
11972
+ if (!!(process.env.NODE_ENV !== "production") && props && vnode.shapeFlag & 1) {
11973
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
11974
+ if (overwritingProp && hasContentChildren(vnode.children)) {
11975
+ warn$1(
11976
+ `The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`
11977
+ );
11978
+ }
11979
+ }
11878
11980
  if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
11879
11981
  !isBlockNode && // has current parent block
11880
11982
  currentBlock && // presence of a patch flag indicates this node needs patching on updates.
@@ -11892,6 +11994,11 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
11892
11994
  }
11893
11995
  return vnode;
11894
11996
  }
11997
+ function hasContentChildren(children) {
11998
+ if (isString(children)) return children !== "";
11999
+ if (isArray(children)) return children.length > 0;
12000
+ return false;
12001
+ }
11895
12002
  const createVNode = !!(process.env.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode;
11896
12003
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
11897
12004
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -12348,7 +12455,12 @@ function setupStatefulComponent(instance, isSSR) {
12348
12455
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
12349
12456
  if (isSSR) {
12350
12457
  return setupResult.then((resolvedResult) => {
12351
- handleSetupResult(instance, resolvedResult, isSSR);
12458
+ setInSSRSetupState(true);
12459
+ try {
12460
+ handleSetupResult(instance, resolvedResult, isSSR);
12461
+ } finally {
12462
+ setInSSRSetupState(false);
12463
+ }
12352
12464
  }).catch((e) => {
12353
12465
  handleError(e, instance, 0);
12354
12466
  });
@@ -12838,7 +12950,7 @@ function isMemoSame(cached, memo) {
12838
12950
  return true;
12839
12951
  }
12840
12952
 
12841
- const version = "3.5.40";
12953
+ const version = "3.5.42";
12842
12954
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12843
12955
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12844
12956
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -13479,7 +13591,11 @@ function setStyle(style, name, val) {
13479
13591
  }
13480
13592
  }
13481
13593
  if (name.startsWith("--")) {
13482
- style.setProperty(name, val);
13594
+ if (importantRE.test(val)) {
13595
+ style.setProperty(name, val.replace(importantRE, ""), "important");
13596
+ } else {
13597
+ style.setProperty(name, val);
13598
+ }
13483
13599
  } else {
13484
13600
  const prefixed = autoPrefix(style, name);
13485
13601
  if (importantRE.test(val)) {
@@ -13896,7 +14012,9 @@ class VueElement extends BaseClass {
13896
14012
  if (parent && parent._pendingResolve) {
13897
14013
  this._pendingResolve = parent._pendingResolve.then(() => {
13898
14014
  this._pendingResolve = void 0;
13899
- this._resolveDef();
14015
+ if (this.isConnected) {
14016
+ return this._resolveDef();
14017
+ }
13900
14018
  });
13901
14019
  } else {
13902
14020
  this._resolveDef();
@@ -13946,7 +14064,7 @@ class VueElement extends BaseClass {
13946
14064
  */
13947
14065
  _resolveDef() {
13948
14066
  if (this._pendingResolve) {
13949
- return;
14067
+ return this._pendingResolve;
13950
14068
  }
13951
14069
  for (let i = 0; i < this.attributes.length; i++) {
13952
14070
  this._setAttr(this.attributes[i].name);
@@ -13986,6 +14104,7 @@ class VueElement extends BaseClass {
13986
14104
  def.configureApp = this._def.configureApp;
13987
14105
  resolve(this._def = def, true);
13988
14106
  });
14107
+ return this._pendingResolve;
13989
14108
  } else {
13990
14109
  resolve(this._def);
13991
14110
  }
@@ -14023,6 +14142,11 @@ class VueElement extends BaseClass {
14023
14142
  }
14024
14143
  }
14025
14144
  for (const key of declaredPropKeys.map(camelize)) {
14145
+ if (!!(process.env.NODE_ENV !== "production") && key in Object.getPrototypeOf(this)) {
14146
+ warn(
14147
+ `Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`
14148
+ );
14149
+ }
14026
14150
  Object.defineProperty(this, key, {
14027
14151
  get() {
14028
14152
  return this._getProp(key);
@@ -14516,6 +14640,7 @@ function onCompositionEnd(e) {
14516
14640
  }
14517
14641
  }
14518
14642
  const assignKey = /* @__PURE__ */ Symbol("_assign");
14643
+ const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
14519
14644
  function castValue(value, trim, number) {
14520
14645
  if (trim) value = value.trim();
14521
14646
  if (number) value = looseToNumber(value);
@@ -14523,6 +14648,13 @@ function castValue(value, trim, number) {
14523
14648
  }
14524
14649
  const vModelText = {
14525
14650
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
14651
+ if (el.parentNode) {
14652
+ if (el.type === "text") {
14653
+ el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
14654
+ } else if (el.type === "textarea") {
14655
+ el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
14656
+ }
14657
+ }
14526
14658
  el[assignKey] = getModelAssigner(vnode);
14527
14659
  const castToNumber = number || vnode.props && vnode.props.type === "number";
14528
14660
  addEventListener(el, lazy ? "change" : "input", (e) => {
@@ -14541,8 +14673,15 @@ const vModelText = {
14541
14673
  }
14542
14674
  },
14543
14675
  // set value on mounted so it's after min/max for type="range"
14544
- mounted(el, { value }) {
14545
- el.value = value == null ? "" : value;
14676
+ mounted(el, { value, modifiers: { trim, number } }) {
14677
+ const newValue = value == null ? "" : value;
14678
+ const initialValue = el[initialValueKey];
14679
+ delete el[initialValueKey];
14680
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
14681
+ el[assignKey](castValue(el.value, trim, number));
14682
+ } else {
14683
+ el.value = newValue;
14684
+ }
14546
14685
  },
14547
14686
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
14548
14687
  el[assignKey] = getModelAssigner(vnode);
@@ -14643,13 +14782,21 @@ const vModelSelect = {
14643
14782
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
14644
14783
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
14645
14784
  );
14646
- el[assignKey](
14647
- el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]
14648
- );
14649
- el._assigning = true;
14650
- nextTick(() => {
14651
- el._assigning = false;
14652
- });
14785
+ const multiple = el.multiple;
14786
+ const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
14787
+ const pending = el._pendingValue = [
14788
+ multiple,
14789
+ multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue
14790
+ ];
14791
+ try {
14792
+ el[assignKey](assignedValue);
14793
+ } finally {
14794
+ nextTick(() => {
14795
+ if (el._pendingValue === pending) {
14796
+ el._pendingValue = void 0;
14797
+ }
14798
+ });
14799
+ }
14653
14800
  });
14654
14801
  el[assignKey] = getModelAssigner(vnode);
14655
14802
  },
@@ -14663,11 +14810,25 @@ const vModelSelect = {
14663
14810
  el[assignKey] = getModelAssigner(vnode);
14664
14811
  },
14665
14812
  updated(el, { value }) {
14666
- if (!el._assigning) {
14813
+ const pending = el._pendingValue;
14814
+ el._pendingValue = void 0;
14815
+ if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
14667
14816
  setSelected(el, value);
14668
14817
  }
14669
14818
  }
14670
14819
  };
14820
+ function isSameSelectValue(value, assignedValue, multiple) {
14821
+ if (!multiple) return looseEqual(value, assignedValue);
14822
+ if (isArray(value)) return looseEqual(value, assignedValue);
14823
+ if (isSet(value)) {
14824
+ if (value.size !== assignedValue.length) return false;
14825
+ for (const item of assignedValue) {
14826
+ if (!value.has(item)) return false;
14827
+ }
14828
+ return true;
14829
+ }
14830
+ return false;
14831
+ }
14671
14832
  function setSelected(el, value) {
14672
14833
  const isMultiple = el.multiple;
14673
14834
  const isArrayValue = isArray(value);
@@ -18939,6 +19100,7 @@ const transformFor = createStructuralDirectiveTransform(
18939
19100
  node.loc
18940
19101
  );
18941
19102
  return () => {
19103
+ var _a;
18942
19104
  let childBlock;
18943
19105
  const { children } = forNode;
18944
19106
  if ((!!(process.env.NODE_ENV !== "production") || false) && isTemplate) {
@@ -18982,7 +19144,8 @@ const transformFor = createStructuralDirectiveTransform(
18982
19144
  if (isTemplate && keyProperty) {
18983
19145
  injectProp(childBlock, keyProperty, context);
18984
19146
  }
18985
- if (childBlock.isBlock !== !isStableFragment) {
19147
+ const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
19148
+ if (childBlock.isBlock !== shouldUseBlock) {
18986
19149
  if (childBlock.isBlock) {
18987
19150
  removeHelper(OPEN_BLOCK);
18988
19151
  removeHelper(
@@ -18994,12 +19157,15 @@ const transformFor = createStructuralDirectiveTransform(
18994
19157
  );
18995
19158
  }
18996
19159
  }
18997
- childBlock.isBlock = !isStableFragment;
19160
+ childBlock.isBlock = shouldUseBlock;
18998
19161
  if (childBlock.isBlock) {
18999
19162
  helper(OPEN_BLOCK);
19000
19163
  helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
19001
19164
  } else {
19002
19165
  helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
19166
+ if (childBlock.needsPatch) {
19167
+ childBlock.patchFlag = ((_a = childBlock.patchFlag) != null ? _a : 0) | 512;
19168
+ }
19003
19169
  }
19004
19170
  }
19005
19171
  if (memo) {
@@ -19378,6 +19544,8 @@ const transformElement = (node, context) => {
19378
19544
  let vnodeDynamicProps;
19379
19545
  let dynamicPropNames;
19380
19546
  let vnodeDirectives;
19547
+ let needsPatch = false;
19548
+ let isBlockRequired = false;
19381
19549
  let shouldUseBlock = (
19382
19550
  // dynamic component may resolve to plain elements
19383
19551
  isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
@@ -19397,6 +19565,8 @@ const transformElement = (node, context) => {
19397
19565
  vnodeProps = propsBuildResult.props;
19398
19566
  patchFlag = propsBuildResult.patchFlag;
19399
19567
  dynamicPropNames = propsBuildResult.dynamicPropNames;
19568
+ needsPatch = propsBuildResult.needsPatch;
19569
+ isBlockRequired = propsBuildResult.isBlockRequired;
19400
19570
  const directives = propsBuildResult.directives;
19401
19571
  vnodeDirectives = directives && directives.length ? createArrayExpression(
19402
19572
  directives.map((dir) => buildDirectiveArgs(dir, context))
@@ -19447,7 +19617,7 @@ const transformElement = (node, context) => {
19447
19617
  if (dynamicPropNames && dynamicPropNames.length) {
19448
19618
  vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
19449
19619
  }
19450
- node.codegenNode = createVNodeCall(
19620
+ const vnodeCall = node.codegenNode = createVNodeCall(
19451
19621
  context,
19452
19622
  vnodeTag,
19453
19623
  vnodeProps,
@@ -19460,6 +19630,13 @@ const transformElement = (node, context) => {
19460
19630
  isComponent,
19461
19631
  node.loc
19462
19632
  );
19633
+ needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
19634
+ if (needsPatch) {
19635
+ vnodeCall.needsPatch = true;
19636
+ }
19637
+ if (isBlockRequired) {
19638
+ vnodeCall.isBlockRequired = true;
19639
+ }
19463
19640
  };
19464
19641
  };
19465
19642
  function resolveComponentType(node, context, ssr = false) {
@@ -19511,6 +19688,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19511
19688
  const runtimeDirectives = [];
19512
19689
  const hasChildren = children.length > 0;
19513
19690
  let shouldUseBlock = false;
19691
+ let isBlockRequired = false;
19514
19692
  let patchFlag = 0;
19515
19693
  let hasRef = false;
19516
19694
  let hasClassBinding = false;
@@ -19552,19 +19730,20 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19552
19730
  if (isEventHandler && isReservedProp(name)) {
19553
19731
  hasVnodeHook = true;
19554
19732
  }
19733
+ if (name === "ref") {
19734
+ hasRef = true;
19735
+ }
19555
19736
  if (isEventHandler && value.type === 14) {
19556
19737
  value = value.arguments[0];
19557
19738
  }
19558
19739
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
19559
19740
  return;
19560
19741
  }
19561
- if (name === "ref") {
19562
- hasRef = true;
19563
- } else if (name === "class") {
19742
+ if (name === "class") {
19564
19743
  hasClassBinding = true;
19565
19744
  } else if (name === "style") {
19566
19745
  hasStyleBinding = true;
19567
- } else if (name !== "key" && !dynamicPropNames.includes(name)) {
19746
+ } else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) {
19568
19747
  dynamicPropNames.push(name);
19569
19748
  }
19570
19749
  if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
@@ -19623,13 +19802,12 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19623
19802
  if (isVOn && ssr) {
19624
19803
  continue;
19625
19804
  }
19626
- if (
19627
- // #938: elements with dynamic keys should be forced into blocks
19628
- isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked
19629
- // before children
19630
- isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
19631
- ) {
19805
+ if (isVBind && isStaticArgOf(arg, "key")) {
19806
+ shouldUseBlock = true;
19807
+ }
19808
+ if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
19632
19809
  shouldUseBlock = true;
19810
+ isBlockRequired = true;
19633
19811
  }
19634
19812
  if (isVBind && isStaticArgOf(arg, "ref")) {
19635
19813
  pushRefVForMarker();
@@ -19712,6 +19890,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19712
19890
  runtimeDirectives.push(prop);
19713
19891
  if (hasChildren) {
19714
19892
  shouldUseBlock = true;
19893
+ isBlockRequired = true;
19715
19894
  }
19716
19895
  }
19717
19896
  }
@@ -19750,7 +19929,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19750
19929
  patchFlag |= 32;
19751
19930
  }
19752
19931
  }
19753
- if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
19932
+ const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
19933
+ if (!shouldUseBlock && needsPatch) {
19754
19934
  patchFlag |= 512;
19755
19935
  }
19756
19936
  if (!context.inSSR && propsExpression) {
@@ -19816,7 +19996,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19816
19996
  directives: runtimeDirectives,
19817
19997
  patchFlag,
19818
19998
  dynamicPropNames,
19819
- shouldUseBlock
19999
+ shouldUseBlock,
20000
+ needsPatch,
20001
+ isBlockRequired
19820
20002
  };
19821
20003
  }
19822
20004
  function dedupeProperties(properties) {