@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) {
@@ -2670,7 +2697,9 @@ function queuePostFlushCb(cb) {
2670
2697
  cb.flags |= 1;
2671
2698
  }
2672
2699
  } else {
2673
- pendingPostFlushCbs.push(...cb);
2700
+ for (let i = 0; i < cb.length; i++) {
2701
+ pendingPostFlushCbs.push(cb[i]);
2702
+ }
2674
2703
  }
2675
2704
  queueFlush();
2676
2705
  }
@@ -2706,7 +2735,9 @@ function flushPostFlushCbs(seen) {
2706
2735
  );
2707
2736
  pendingPostFlushCbs.length = 0;
2708
2737
  if (activePostFlushCbs) {
2709
- activePostFlushCbs.push(...deduped);
2738
+ for (let i = 0; i < deduped.length; i++) {
2739
+ activePostFlushCbs.push(deduped[i]);
2740
+ }
2710
2741
  return;
2711
2742
  }
2712
2743
  activePostFlushCbs = deduped;
@@ -4467,7 +4498,11 @@ function getInnerChild$1(vnode) {
4467
4498
  function setTransitionHooks(vnode, hooks) {
4468
4499
  if (vnode.shapeFlag & 6 && vnode.component) {
4469
4500
  vnode.transition = hooks;
4470
- setTransitionHooks(vnode.component.subTree, hooks);
4501
+ const subTree = vnode.component.subTree;
4502
+ setTransitionHooks(
4503
+ isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
4504
+ hooks
4505
+ );
4471
4506
  } else if (vnode.shapeFlag & 128) {
4472
4507
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4473
4508
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -4870,10 +4905,10 @@ function createHydrationFunctions(rendererInternals) {
4870
4905
  getContainerType(container),
4871
4906
  optimized
4872
4907
  );
4873
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4908
+ if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
4874
4909
  let subTree;
4875
4910
  if (isFragmentStart) {
4876
- subTree = createVNode(Fragment);
4911
+ subTree = createVNode(Static);
4877
4912
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4878
4913
  } else {
4879
4914
  subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
@@ -5007,6 +5042,9 @@ Server rendered element contains more child nodes than client vdom.`
5007
5042
  }
5008
5043
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
5009
5044
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
5045
+ if (isUnchangedResourceProp(el, key, props[key])) {
5046
+ continue;
5047
+ }
5010
5048
  patchProp(el, key, null, props[key], namespace, parentComponent);
5011
5049
  }
5012
5050
  }
@@ -5189,6 +5227,13 @@ Server rendered element contains fewer child nodes than client vdom.`
5189
5227
  };
5190
5228
  return [hydrate, hydrateNode];
5191
5229
  }
5230
+ const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
5231
+ function isUnchangedResourceProp(el, key, clientValue) {
5232
+ if (!resourceProps.has(key)) {
5233
+ return false;
5234
+ }
5235
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
5236
+ }
5192
5237
  function propHasMismatch(el, key, clientValue, vnode, instance) {
5193
5238
  let mismatchType;
5194
5239
  let mismatchKey;
@@ -5226,7 +5271,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
5226
5271
  mismatchKey = "style";
5227
5272
  }
5228
5273
  } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
5229
- if (isBooleanAttr(key)) {
5274
+ if (key === "hidden") {
5275
+ actual = normalizeHiddenValue(el.getAttribute(key));
5276
+ expected = normalizeHiddenValue(clientValue);
5277
+ } else if (isBooleanAttr(key)) {
5230
5278
  actual = el.hasAttribute(key);
5231
5279
  expected = includeBooleanAttr(clientValue);
5232
5280
  } else if (clientValue == null) {
@@ -5262,6 +5310,15 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
5262
5310
  }
5263
5311
  return false;
5264
5312
  }
5313
+ function normalizeHiddenValue(value) {
5314
+ if (!isRenderableAttrValue(value)) {
5315
+ return false;
5316
+ }
5317
+ if (isString(value)) {
5318
+ return value.toLowerCase() === "until-found" ? "until-found" : "";
5319
+ }
5320
+ return includeBooleanAttr(value) ? "" : false;
5321
+ }
5265
5322
  function toClassSet(str) {
5266
5323
  return new Set(str.trim().split(/\s+/));
5267
5324
  }
@@ -5760,7 +5817,10 @@ const KeepAliveImpl = {
5760
5817
  if (pendingCacheKey != null) {
5761
5818
  if (isSuspense(instance.subTree.type)) {
5762
5819
  queuePostRenderEffect(() => {
5763
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5820
+ const vnode = getInnerChild(instance.subTree);
5821
+ if (vnode.component) {
5822
+ cache.set(pendingCacheKey, vnode);
5823
+ }
5764
5824
  }, instance.subTree.suspense);
5765
5825
  } else {
5766
5826
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
@@ -6372,7 +6432,8 @@ function createSlots(slots, dynamicSlots) {
6372
6432
  return slots;
6373
6433
  }
6374
6434
 
6375
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
6435
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
6436
+ if (props == null) props = {};
6376
6437
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
6377
6438
  const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
6378
6439
  const hasProps = Object.keys(slotProps).length > 0;
@@ -6680,12 +6741,41 @@ const getPublicInstance = (i) => {
6680
6741
  if (isStatefulComponent(i)) return getComponentPublicInstance(i);
6681
6742
  return getPublicInstance(i.parent);
6682
6743
  };
6744
+ const resolveDevRootEl = (vnode) => {
6745
+ let found = false;
6746
+ while (true) {
6747
+ if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
6748
+ const root = filterSingleRoot(vnode.children);
6749
+ if (!root) {
6750
+ return;
6751
+ }
6752
+ vnode = root;
6753
+ found = true;
6754
+ continue;
6755
+ }
6756
+ const component = vnode.component;
6757
+ if (component && component.subTree) {
6758
+ vnode = component.subTree;
6759
+ continue;
6760
+ }
6761
+ const suspense = vnode.suspense;
6762
+ if (suspense && suspense.activeBranch) {
6763
+ vnode = suspense.activeBranch;
6764
+ continue;
6765
+ }
6766
+ return found ? vnode.el : void 0;
6767
+ }
6768
+ };
6769
+ const getDevRootFragmentEl = (i) => {
6770
+ const el = i.subTree && resolveDevRootEl(i.subTree);
6771
+ return el === void 0 ? i.vnode.el : el;
6772
+ };
6683
6773
  const publicPropertiesMap = (
6684
6774
  // Move PURE marker to new line to workaround compiler discarding it
6685
6775
  // due to type annotation
6686
6776
  /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
6687
6777
  $: (i) => i,
6688
- $el: (i) => i.vnode.el,
6778
+ $el: (i) => getDevRootFragmentEl(i) ,
6689
6779
  $data: (i) => i.data,
6690
6780
  $props: (i) => shallowReadonly(i.props) ,
6691
6781
  $attrs: (i) => shallowReadonly(i.attrs) ,
@@ -7599,7 +7689,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7599
7689
  return vm;
7600
7690
  }
7601
7691
  }
7602
- Vue.version = `2.6.14-compat:${"3.5.40"}`;
7692
+ Vue.version = `2.6.14-compat:${"3.5.42"}`;
7603
7693
  Vue.config = singletonApp.config;
7604
7694
  Vue.use = (plugin, ...options) => {
7605
7695
  if (plugin && isFunction(plugin.install)) {
@@ -8356,7 +8446,7 @@ function emit(instance, event, ...rawArgs) {
8356
8446
  args = rawArgs.map((a) => isString(a) ? a.trim() : a);
8357
8447
  }
8358
8448
  if (modifiers.number) {
8359
- args = rawArgs.map(looseToNumber);
8449
+ args = args.map(looseToNumber);
8360
8450
  }
8361
8451
  }
8362
8452
  {
@@ -8621,12 +8711,13 @@ function renderComponentRoot(instance) {
8621
8711
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
8622
8712
  }
8623
8713
  if (vnode.transition) {
8624
- if (!isElementRoot(root)) {
8714
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
8715
+ if (!isElementRoot(child)) {
8625
8716
  warn$1(
8626
8717
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8627
8718
  );
8628
8719
  }
8629
- setTransitionHooks(root, vnode.transition);
8720
+ setTransitionHooks(child, vnode.transition);
8630
8721
  }
8631
8722
  if (setRoot) {
8632
8723
  setRoot(root);
@@ -11132,7 +11223,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11132
11223
  if (suspense.deps <= 0) {
11133
11224
  suspense.resolve();
11134
11225
  } else if (isInFallback) {
11135
- if (!isHydrating) {
11226
+ if (!isHydrating && !suspense.isFallbackMountPending) {
11136
11227
  patch(
11137
11228
  activeBranch,
11138
11229
  newFallback,
@@ -11173,7 +11264,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11173
11264
  );
11174
11265
  if (suspense.deps <= 0) {
11175
11266
  suspense.resolve();
11176
- } else {
11267
+ } else if (!suspense.isFallbackMountPending) {
11177
11268
  patch(
11178
11269
  activeBranch,
11179
11270
  newFallback,
@@ -11380,7 +11471,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11380
11471
  let hasUnresolvedAncestor = false;
11381
11472
  while (parent) {
11382
11473
  if (parent.pendingBranch) {
11383
- parent.effects.push(...effects);
11474
+ for (let i = 0; i < effects.length; i++) {
11475
+ parent.effects.push(effects[i]);
11476
+ }
11384
11477
  hasUnresolvedAncestor = true;
11385
11478
  break;
11386
11479
  }
@@ -11412,9 +11505,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11412
11505
  if (!suspense.isInFallback) {
11413
11506
  return;
11414
11507
  }
11508
+ const latestFallback = suspense.vnode.ssFallback;
11415
11509
  patch(
11416
11510
  null,
11417
- fallbackVNode,
11511
+ latestFallback,
11418
11512
  container2,
11419
11513
  anchor2,
11420
11514
  parentComponent2,
@@ -11424,7 +11518,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11424
11518
  slotScopeIds,
11425
11519
  optimized
11426
11520
  );
11427
- setActiveBranch(suspense, fallbackVNode);
11521
+ setActiveBranch(suspense, latestFallback);
11428
11522
  };
11429
11523
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
11430
11524
  if (delayEnter) {
@@ -11802,6 +11896,14 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
11802
11896
  if (vnode.key !== vnode.key) {
11803
11897
  warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
11804
11898
  }
11899
+ if (props && vnode.shapeFlag & 1) {
11900
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
11901
+ if (overwritingProp && hasContentChildren(vnode.children)) {
11902
+ warn$1(
11903
+ `The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`
11904
+ );
11905
+ }
11906
+ }
11805
11907
  if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
11806
11908
  !isBlockNode && // has current parent block
11807
11909
  currentBlock && // presence of a patch flag indicates this node needs patching on updates.
@@ -11819,6 +11921,11 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
11819
11921
  }
11820
11922
  return vnode;
11821
11923
  }
11924
+ function hasContentChildren(children) {
11925
+ if (isString(children)) return children !== "";
11926
+ if (isArray(children)) return children.length > 0;
11927
+ return false;
11928
+ }
11822
11929
  const createVNode = createVNodeWithArgsTransform ;
11823
11930
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
11824
11931
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -12273,7 +12380,12 @@ function setupStatefulComponent(instance, isSSR) {
12273
12380
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
12274
12381
  if (isSSR) {
12275
12382
  return setupResult.then((resolvedResult) => {
12276
- handleSetupResult(instance, resolvedResult, isSSR);
12383
+ setInSSRSetupState(true);
12384
+ try {
12385
+ handleSetupResult(instance, resolvedResult, isSSR);
12386
+ } finally {
12387
+ setInSSRSetupState(false);
12388
+ }
12277
12389
  }).catch((e) => {
12278
12390
  handleError(e, instance, 0);
12279
12391
  });
@@ -12751,7 +12863,7 @@ function isMemoSame(cached, memo) {
12751
12863
  return true;
12752
12864
  }
12753
12865
 
12754
- const version = "3.5.40";
12866
+ const version = "3.5.42";
12755
12867
  const warn = warn$1 ;
12756
12868
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12757
12869
  const devtools = devtools$1 ;
@@ -13392,7 +13504,11 @@ function setStyle(style, name, val) {
13392
13504
  }
13393
13505
  }
13394
13506
  if (name.startsWith("--")) {
13395
- style.setProperty(name, val);
13507
+ if (importantRE.test(val)) {
13508
+ style.setProperty(name, val.replace(importantRE, ""), "important");
13509
+ } else {
13510
+ style.setProperty(name, val);
13511
+ }
13396
13512
  } else {
13397
13513
  const prefixed = autoPrefix(style, name);
13398
13514
  if (importantRE.test(val)) {
@@ -13809,7 +13925,9 @@ class VueElement extends BaseClass {
13809
13925
  if (parent && parent._pendingResolve) {
13810
13926
  this._pendingResolve = parent._pendingResolve.then(() => {
13811
13927
  this._pendingResolve = void 0;
13812
- this._resolveDef();
13928
+ if (this.isConnected) {
13929
+ return this._resolveDef();
13930
+ }
13813
13931
  });
13814
13932
  } else {
13815
13933
  this._resolveDef();
@@ -13859,7 +13977,7 @@ class VueElement extends BaseClass {
13859
13977
  */
13860
13978
  _resolveDef() {
13861
13979
  if (this._pendingResolve) {
13862
- return;
13980
+ return this._pendingResolve;
13863
13981
  }
13864
13982
  for (let i = 0; i < this.attributes.length; i++) {
13865
13983
  this._setAttr(this.attributes[i].name);
@@ -13899,6 +14017,7 @@ class VueElement extends BaseClass {
13899
14017
  def.configureApp = this._def.configureApp;
13900
14018
  resolve(this._def = def, true);
13901
14019
  });
14020
+ return this._pendingResolve;
13902
14021
  } else {
13903
14022
  resolve(this._def);
13904
14023
  }
@@ -13936,6 +14055,11 @@ class VueElement extends BaseClass {
13936
14055
  }
13937
14056
  }
13938
14057
  for (const key of declaredPropKeys.map(camelize)) {
14058
+ if (key in Object.getPrototypeOf(this)) {
14059
+ warn(
14060
+ `Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`
14061
+ );
14062
+ }
13939
14063
  Object.defineProperty(this, key, {
13940
14064
  get() {
13941
14065
  return this._getProp(key);
@@ -14429,6 +14553,7 @@ function onCompositionEnd(e) {
14429
14553
  }
14430
14554
  }
14431
14555
  const assignKey = /* @__PURE__ */ Symbol("_assign");
14556
+ const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
14432
14557
  function castValue(value, trim, number) {
14433
14558
  if (trim) value = value.trim();
14434
14559
  if (number) value = looseToNumber(value);
@@ -14436,6 +14561,13 @@ function castValue(value, trim, number) {
14436
14561
  }
14437
14562
  const vModelText = {
14438
14563
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
14564
+ if (el.parentNode) {
14565
+ if (el.type === "text") {
14566
+ el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
14567
+ } else if (el.type === "textarea") {
14568
+ el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
14569
+ }
14570
+ }
14439
14571
  el[assignKey] = getModelAssigner(vnode);
14440
14572
  const castToNumber = number || vnode.props && vnode.props.type === "number";
14441
14573
  addEventListener(el, lazy ? "change" : "input", (e) => {
@@ -14454,8 +14586,15 @@ const vModelText = {
14454
14586
  }
14455
14587
  },
14456
14588
  // set value on mounted so it's after min/max for type="range"
14457
- mounted(el, { value }) {
14458
- el.value = value == null ? "" : value;
14589
+ mounted(el, { value, modifiers: { trim, number } }) {
14590
+ const newValue = value == null ? "" : value;
14591
+ const initialValue = el[initialValueKey];
14592
+ delete el[initialValueKey];
14593
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
14594
+ el[assignKey](castValue(el.value, trim, number));
14595
+ } else {
14596
+ el.value = newValue;
14597
+ }
14459
14598
  },
14460
14599
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
14461
14600
  el[assignKey] = getModelAssigner(vnode);
@@ -14556,13 +14695,21 @@ const vModelSelect = {
14556
14695
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
14557
14696
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
14558
14697
  );
14559
- el[assignKey](
14560
- el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]
14561
- );
14562
- el._assigning = true;
14563
- nextTick(() => {
14564
- el._assigning = false;
14565
- });
14698
+ const multiple = el.multiple;
14699
+ const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
14700
+ const pending = el._pendingValue = [
14701
+ multiple,
14702
+ multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue
14703
+ ];
14704
+ try {
14705
+ el[assignKey](assignedValue);
14706
+ } finally {
14707
+ nextTick(() => {
14708
+ if (el._pendingValue === pending) {
14709
+ el._pendingValue = void 0;
14710
+ }
14711
+ });
14712
+ }
14566
14713
  });
14567
14714
  el[assignKey] = getModelAssigner(vnode);
14568
14715
  },
@@ -14576,11 +14723,25 @@ const vModelSelect = {
14576
14723
  el[assignKey] = getModelAssigner(vnode);
14577
14724
  },
14578
14725
  updated(el, { value }) {
14579
- if (!el._assigning) {
14726
+ const pending = el._pendingValue;
14727
+ el._pendingValue = void 0;
14728
+ if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
14580
14729
  setSelected(el, value);
14581
14730
  }
14582
14731
  }
14583
14732
  };
14733
+ function isSameSelectValue(value, assignedValue, multiple) {
14734
+ if (!multiple) return looseEqual(value, assignedValue);
14735
+ if (isArray(value)) return looseEqual(value, assignedValue);
14736
+ if (isSet(value)) {
14737
+ if (value.size !== assignedValue.length) return false;
14738
+ for (const item of assignedValue) {
14739
+ if (!value.has(item)) return false;
14740
+ }
14741
+ return true;
14742
+ }
14743
+ return false;
14744
+ }
14584
14745
  function setSelected(el, value) {
14585
14746
  const isMultiple = el.multiple;
14586
14747
  const isArrayValue = isArray(value);
@@ -18855,6 +19016,7 @@ const transformFor = createStructuralDirectiveTransform(
18855
19016
  node.loc
18856
19017
  );
18857
19018
  return () => {
19019
+ var _a;
18858
19020
  let childBlock;
18859
19021
  const { children } = forNode;
18860
19022
  if (isTemplate) {
@@ -18898,7 +19060,8 @@ const transformFor = createStructuralDirectiveTransform(
18898
19060
  if (isTemplate && keyProperty) {
18899
19061
  injectProp(childBlock, keyProperty, context);
18900
19062
  }
18901
- if (childBlock.isBlock !== !isStableFragment) {
19063
+ const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
19064
+ if (childBlock.isBlock !== shouldUseBlock) {
18902
19065
  if (childBlock.isBlock) {
18903
19066
  removeHelper(OPEN_BLOCK);
18904
19067
  removeHelper(
@@ -18910,12 +19073,15 @@ const transformFor = createStructuralDirectiveTransform(
18910
19073
  );
18911
19074
  }
18912
19075
  }
18913
- childBlock.isBlock = !isStableFragment;
19076
+ childBlock.isBlock = shouldUseBlock;
18914
19077
  if (childBlock.isBlock) {
18915
19078
  helper(OPEN_BLOCK);
18916
19079
  helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
18917
19080
  } else {
18918
19081
  helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
19082
+ if (childBlock.needsPatch) {
19083
+ childBlock.patchFlag = ((_a = childBlock.patchFlag) != null ? _a : 0) | 512;
19084
+ }
18919
19085
  }
18920
19086
  }
18921
19087
  if (memo) {
@@ -19294,6 +19460,8 @@ const transformElement = (node, context) => {
19294
19460
  let vnodeDynamicProps;
19295
19461
  let dynamicPropNames;
19296
19462
  let vnodeDirectives;
19463
+ let needsPatch = false;
19464
+ let isBlockRequired = false;
19297
19465
  let shouldUseBlock = (
19298
19466
  // dynamic component may resolve to plain elements
19299
19467
  isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
@@ -19313,6 +19481,8 @@ const transformElement = (node, context) => {
19313
19481
  vnodeProps = propsBuildResult.props;
19314
19482
  patchFlag = propsBuildResult.patchFlag;
19315
19483
  dynamicPropNames = propsBuildResult.dynamicPropNames;
19484
+ needsPatch = propsBuildResult.needsPatch;
19485
+ isBlockRequired = propsBuildResult.isBlockRequired;
19316
19486
  const directives = propsBuildResult.directives;
19317
19487
  vnodeDirectives = directives && directives.length ? createArrayExpression(
19318
19488
  directives.map((dir) => buildDirectiveArgs(dir, context))
@@ -19363,7 +19533,7 @@ const transformElement = (node, context) => {
19363
19533
  if (dynamicPropNames && dynamicPropNames.length) {
19364
19534
  vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
19365
19535
  }
19366
- node.codegenNode = createVNodeCall(
19536
+ const vnodeCall = node.codegenNode = createVNodeCall(
19367
19537
  context,
19368
19538
  vnodeTag,
19369
19539
  vnodeProps,
@@ -19376,6 +19546,13 @@ const transformElement = (node, context) => {
19376
19546
  isComponent,
19377
19547
  node.loc
19378
19548
  );
19549
+ needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
19550
+ if (needsPatch) {
19551
+ vnodeCall.needsPatch = true;
19552
+ }
19553
+ if (isBlockRequired) {
19554
+ vnodeCall.isBlockRequired = true;
19555
+ }
19379
19556
  };
19380
19557
  };
19381
19558
  function resolveComponentType(node, context, ssr = false) {
@@ -19427,6 +19604,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19427
19604
  const runtimeDirectives = [];
19428
19605
  const hasChildren = children.length > 0;
19429
19606
  let shouldUseBlock = false;
19607
+ let isBlockRequired = false;
19430
19608
  let patchFlag = 0;
19431
19609
  let hasRef = false;
19432
19610
  let hasClassBinding = false;
@@ -19468,19 +19646,20 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19468
19646
  if (isEventHandler && isReservedProp(name)) {
19469
19647
  hasVnodeHook = true;
19470
19648
  }
19649
+ if (name === "ref") {
19650
+ hasRef = true;
19651
+ }
19471
19652
  if (isEventHandler && value.type === 14) {
19472
19653
  value = value.arguments[0];
19473
19654
  }
19474
19655
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
19475
19656
  return;
19476
19657
  }
19477
- if (name === "ref") {
19478
- hasRef = true;
19479
- } else if (name === "class") {
19658
+ if (name === "class") {
19480
19659
  hasClassBinding = true;
19481
19660
  } else if (name === "style") {
19482
19661
  hasStyleBinding = true;
19483
- } else if (name !== "key" && !dynamicPropNames.includes(name)) {
19662
+ } else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) {
19484
19663
  dynamicPropNames.push(name);
19485
19664
  }
19486
19665
  if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
@@ -19539,13 +19718,12 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19539
19718
  if (isVOn && ssr) {
19540
19719
  continue;
19541
19720
  }
19542
- if (
19543
- // #938: elements with dynamic keys should be forced into blocks
19544
- isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked
19545
- // before children
19546
- isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
19547
- ) {
19721
+ if (isVBind && isStaticArgOf(arg, "key")) {
19722
+ shouldUseBlock = true;
19723
+ }
19724
+ if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
19548
19725
  shouldUseBlock = true;
19726
+ isBlockRequired = true;
19549
19727
  }
19550
19728
  if (isVBind && isStaticArgOf(arg, "ref")) {
19551
19729
  pushRefVForMarker();
@@ -19628,6 +19806,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19628
19806
  runtimeDirectives.push(prop);
19629
19807
  if (hasChildren) {
19630
19808
  shouldUseBlock = true;
19809
+ isBlockRequired = true;
19631
19810
  }
19632
19811
  }
19633
19812
  }
@@ -19666,7 +19845,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19666
19845
  patchFlag |= 32;
19667
19846
  }
19668
19847
  }
19669
- if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
19848
+ const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
19849
+ if (!shouldUseBlock && needsPatch) {
19670
19850
  patchFlag |= 512;
19671
19851
  }
19672
19852
  if (!context.inSSR && propsExpression) {
@@ -19732,7 +19912,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
19732
19912
  directives: runtimeDirectives,
19733
19913
  patchFlag,
19734
19914
  dynamicPropNames,
19735
- shouldUseBlock
19915
+ shouldUseBlock,
19916
+ needsPatch,
19917
+ isBlockRequired
19736
19918
  };
19737
19919
  }
19738
19920
  function dedupeProperties(properties) {