@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.
package/dist/vue.cjs.js CHANGED
@@ -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
  **/
@@ -278,7 +278,7 @@ const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
278
278
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
279
279
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
280
280
  const isBooleanAttr = /* @__PURE__ */ makeMap(
281
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
281
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
282
282
  );
283
283
  function includeBooleanAttr(value) {
284
284
  return !!value || value === "";
@@ -355,6 +355,23 @@ function looseCompareArrays(a, b) {
355
355
  }
356
356
  return equal;
357
357
  }
358
+ function looseCompareCollections(a, b) {
359
+ if (a.size !== b.size) return false;
360
+ const candidates = Array.from(b);
361
+ const matched = new Uint8Array(candidates.length);
362
+ for (const item of a) {
363
+ let index = -1;
364
+ for (let i = 0; i < candidates.length; i++) {
365
+ if (!matched[i] && looseEqual(item, candidates[i])) {
366
+ index = i;
367
+ break;
368
+ }
369
+ }
370
+ if (index < 0) return false;
371
+ matched[index] = 1;
372
+ }
373
+ return true;
374
+ }
358
375
  function looseEqual(a, b) {
359
376
  if (a === b) return true;
360
377
  let aValidType = isDate(a);
@@ -378,6 +395,16 @@ function looseEqual(a, b) {
378
395
  if (!aValidType || !bValidType) {
379
396
  return false;
380
397
  }
398
+ aValidType = isMap(a);
399
+ bValidType = isMap(b);
400
+ if (aValidType || bValidType) {
401
+ return aValidType && bValidType ? looseCompareCollections(a, b) : false;
402
+ }
403
+ aValidType = isSet(a);
404
+ bValidType = isSet(b);
405
+ if (aValidType || bValidType) {
406
+ return aValidType && bValidType ? looseCompareCollections(a, b) : false;
407
+ }
381
408
  const aKeysCount = Object.keys(a).length;
382
409
  const bKeysCount = Object.keys(b).length;
383
410
  if (aKeysCount !== bKeysCount) {
@@ -2723,7 +2750,9 @@ function queuePostFlushCb(cb) {
2723
2750
  cb.flags |= 1;
2724
2751
  }
2725
2752
  } else {
2726
- pendingPostFlushCbs.push(...cb);
2753
+ for (let i = 0; i < cb.length; i++) {
2754
+ pendingPostFlushCbs.push(cb[i]);
2755
+ }
2727
2756
  }
2728
2757
  queueFlush();
2729
2758
  }
@@ -2759,7 +2788,9 @@ function flushPostFlushCbs(seen) {
2759
2788
  );
2760
2789
  pendingPostFlushCbs.length = 0;
2761
2790
  if (activePostFlushCbs) {
2762
- activePostFlushCbs.push(...deduped);
2791
+ for (let i = 0; i < deduped.length; i++) {
2792
+ activePostFlushCbs.push(deduped[i]);
2793
+ }
2763
2794
  return;
2764
2795
  }
2765
2796
  activePostFlushCbs = deduped;
@@ -4520,7 +4551,11 @@ function getInnerChild$1(vnode) {
4520
4551
  function setTransitionHooks(vnode, hooks) {
4521
4552
  if (vnode.shapeFlag & 6 && vnode.component) {
4522
4553
  vnode.transition = hooks;
4523
- setTransitionHooks(vnode.component.subTree, hooks);
4554
+ const subTree = vnode.component.subTree;
4555
+ setTransitionHooks(
4556
+ isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
4557
+ hooks
4558
+ );
4524
4559
  } else if (vnode.shapeFlag & 128) {
4525
4560
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4526
4561
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -4923,10 +4958,10 @@ function createHydrationFunctions(rendererInternals) {
4923
4958
  getContainerType(container),
4924
4959
  optimized
4925
4960
  );
4926
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4961
+ if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
4927
4962
  let subTree;
4928
4963
  if (isFragmentStart) {
4929
- subTree = createVNode(Fragment);
4964
+ subTree = createVNode(Static);
4930
4965
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4931
4966
  } else {
4932
4967
  subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
@@ -5060,6 +5095,9 @@ Server rendered element contains more child nodes than client vdom.`
5060
5095
  }
5061
5096
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
5062
5097
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
5098
+ if (isUnchangedResourceProp(el, key, props[key])) {
5099
+ continue;
5100
+ }
5063
5101
  patchProp(el, key, null, props[key], namespace, parentComponent);
5064
5102
  }
5065
5103
  }
@@ -5242,6 +5280,13 @@ Server rendered element contains fewer child nodes than client vdom.`
5242
5280
  };
5243
5281
  return [hydrate, hydrateNode];
5244
5282
  }
5283
+ const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
5284
+ function isUnchangedResourceProp(el, key, clientValue) {
5285
+ if (!resourceProps.has(key)) {
5286
+ return false;
5287
+ }
5288
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
5289
+ }
5245
5290
  function propHasMismatch(el, key, clientValue, vnode, instance) {
5246
5291
  let mismatchType;
5247
5292
  let mismatchKey;
@@ -5279,7 +5324,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
5279
5324
  mismatchKey = "style";
5280
5325
  }
5281
5326
  } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
5282
- if (isBooleanAttr(key)) {
5327
+ if (key === "hidden") {
5328
+ actual = normalizeHiddenValue(el.getAttribute(key));
5329
+ expected = normalizeHiddenValue(clientValue);
5330
+ } else if (isBooleanAttr(key)) {
5283
5331
  actual = el.hasAttribute(key);
5284
5332
  expected = includeBooleanAttr(clientValue);
5285
5333
  } else if (clientValue == null) {
@@ -5315,6 +5363,15 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
5315
5363
  }
5316
5364
  return false;
5317
5365
  }
5366
+ function normalizeHiddenValue(value) {
5367
+ if (!isRenderableAttrValue(value)) {
5368
+ return false;
5369
+ }
5370
+ if (isString(value)) {
5371
+ return value.toLowerCase() === "until-found" ? "until-found" : "";
5372
+ }
5373
+ return includeBooleanAttr(value) ? "" : false;
5374
+ }
5318
5375
  function toClassSet(str) {
5319
5376
  return new Set(str.trim().split(/\s+/));
5320
5377
  }
@@ -5810,7 +5867,10 @@ const KeepAliveImpl = {
5810
5867
  if (pendingCacheKey != null) {
5811
5868
  if (isSuspense(instance.subTree.type)) {
5812
5869
  queuePostRenderEffect(() => {
5813
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5870
+ const vnode = getInnerChild(instance.subTree);
5871
+ if (vnode.component) {
5872
+ cache.set(pendingCacheKey, vnode);
5873
+ }
5814
5874
  }, instance.subTree.suspense);
5815
5875
  } else {
5816
5876
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
@@ -6422,7 +6482,8 @@ function createSlots(slots, dynamicSlots) {
6422
6482
  return slots;
6423
6483
  }
6424
6484
 
6425
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
6485
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
6486
+ if (props == null) props = {};
6426
6487
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
6427
6488
  const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
6428
6489
  const hasProps = Object.keys(slotProps).length > 0;
@@ -6730,12 +6791,41 @@ const getPublicInstance = (i) => {
6730
6791
  if (isStatefulComponent(i)) return getComponentPublicInstance(i);
6731
6792
  return getPublicInstance(i.parent);
6732
6793
  };
6794
+ const resolveDevRootEl = (vnode) => {
6795
+ let found = false;
6796
+ while (true) {
6797
+ if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
6798
+ const root = filterSingleRoot(vnode.children);
6799
+ if (!root) {
6800
+ return;
6801
+ }
6802
+ vnode = root;
6803
+ found = true;
6804
+ continue;
6805
+ }
6806
+ const component = vnode.component;
6807
+ if (component && component.subTree) {
6808
+ vnode = component.subTree;
6809
+ continue;
6810
+ }
6811
+ const suspense = vnode.suspense;
6812
+ if (suspense && suspense.activeBranch) {
6813
+ vnode = suspense.activeBranch;
6814
+ continue;
6815
+ }
6816
+ return found ? vnode.el : void 0;
6817
+ }
6818
+ };
6819
+ const getDevRootFragmentEl = (i) => {
6820
+ const el = i.subTree && resolveDevRootEl(i.subTree);
6821
+ return el === void 0 ? i.vnode.el : el;
6822
+ };
6733
6823
  const publicPropertiesMap = (
6734
6824
  // Move PURE marker to new line to workaround compiler discarding it
6735
6825
  // due to type annotation
6736
6826
  /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
6737
6827
  $: (i) => i,
6738
- $el: (i) => i.vnode.el,
6828
+ $el: (i) => getDevRootFragmentEl(i) ,
6739
6829
  $data: (i) => i.data,
6740
6830
  $props: (i) => shallowReadonly(i.props) ,
6741
6831
  $attrs: (i) => shallowReadonly(i.attrs) ,
@@ -7649,7 +7739,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7649
7739
  return vm;
7650
7740
  }
7651
7741
  }
7652
- Vue.version = `2.6.14-compat:${"3.5.40"}`;
7742
+ Vue.version = `2.6.14-compat:${"3.5.42"}`;
7653
7743
  Vue.config = singletonApp.config;
7654
7744
  Vue.use = (plugin, ...options) => {
7655
7745
  if (plugin && isFunction(plugin.install)) {
@@ -8406,7 +8496,7 @@ function emit(instance, event, ...rawArgs) {
8406
8496
  args = rawArgs.map((a) => isString(a) ? a.trim() : a);
8407
8497
  }
8408
8498
  if (modifiers.number) {
8409
- args = rawArgs.map(looseToNumber);
8499
+ args = args.map(looseToNumber);
8410
8500
  }
8411
8501
  }
8412
8502
  {
@@ -8671,12 +8761,13 @@ function renderComponentRoot(instance) {
8671
8761
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
8672
8762
  }
8673
8763
  if (vnode.transition) {
8674
- if (!isElementRoot(root)) {
8764
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
8765
+ if (!isElementRoot(child)) {
8675
8766
  warn$1(
8676
8767
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8677
8768
  );
8678
8769
  }
8679
- setTransitionHooks(root, vnode.transition);
8770
+ setTransitionHooks(child, vnode.transition);
8680
8771
  }
8681
8772
  if (setRoot) {
8682
8773
  setRoot(root);
@@ -11182,7 +11273,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11182
11273
  if (suspense.deps <= 0) {
11183
11274
  suspense.resolve();
11184
11275
  } else if (isInFallback) {
11185
- if (!isHydrating) {
11276
+ if (!isHydrating && !suspense.isFallbackMountPending) {
11186
11277
  patch(
11187
11278
  activeBranch,
11188
11279
  newFallback,
@@ -11223,7 +11314,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11223
11314
  );
11224
11315
  if (suspense.deps <= 0) {
11225
11316
  suspense.resolve();
11226
- } else {
11317
+ } else if (!suspense.isFallbackMountPending) {
11227
11318
  patch(
11228
11319
  activeBranch,
11229
11320
  newFallback,
@@ -11430,7 +11521,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11430
11521
  let hasUnresolvedAncestor = false;
11431
11522
  while (parent) {
11432
11523
  if (parent.pendingBranch) {
11433
- parent.effects.push(...effects);
11524
+ for (let i = 0; i < effects.length; i++) {
11525
+ parent.effects.push(effects[i]);
11526
+ }
11434
11527
  hasUnresolvedAncestor = true;
11435
11528
  break;
11436
11529
  }
@@ -11462,9 +11555,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11462
11555
  if (!suspense.isInFallback) {
11463
11556
  return;
11464
11557
  }
11558
+ const latestFallback = suspense.vnode.ssFallback;
11465
11559
  patch(
11466
11560
  null,
11467
- fallbackVNode,
11561
+ latestFallback,
11468
11562
  container2,
11469
11563
  anchor2,
11470
11564
  parentComponent2,
@@ -11474,7 +11568,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11474
11568
  slotScopeIds,
11475
11569
  optimized
11476
11570
  );
11477
- setActiveBranch(suspense, fallbackVNode);
11571
+ setActiveBranch(suspense, latestFallback);
11478
11572
  };
11479
11573
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
11480
11574
  if (delayEnter) {
@@ -11852,6 +11946,14 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
11852
11946
  if (vnode.key !== vnode.key) {
11853
11947
  warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
11854
11948
  }
11949
+ if (props && vnode.shapeFlag & 1) {
11950
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
11951
+ if (overwritingProp && hasContentChildren(vnode.children)) {
11952
+ warn$1(
11953
+ `The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`
11954
+ );
11955
+ }
11956
+ }
11855
11957
  if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
11856
11958
  !isBlockNode && // has current parent block
11857
11959
  currentBlock && // presence of a patch flag indicates this node needs patching on updates.
@@ -11869,6 +11971,11 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
11869
11971
  }
11870
11972
  return vnode;
11871
11973
  }
11974
+ function hasContentChildren(children) {
11975
+ if (isString(children)) return children !== "";
11976
+ if (isArray(children)) return children.length > 0;
11977
+ return false;
11978
+ }
11872
11979
  const createVNode = createVNodeWithArgsTransform ;
11873
11980
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
11874
11981
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -12323,7 +12430,12 @@ function setupStatefulComponent(instance, isSSR) {
12323
12430
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
12324
12431
  if (isSSR) {
12325
12432
  return setupResult.then((resolvedResult) => {
12326
- handleSetupResult(instance, resolvedResult, isSSR);
12433
+ setInSSRSetupState(true);
12434
+ try {
12435
+ handleSetupResult(instance, resolvedResult, isSSR);
12436
+ } finally {
12437
+ setInSSRSetupState(false);
12438
+ }
12327
12439
  }).catch((e) => {
12328
12440
  handleError(e, instance, 0);
12329
12441
  });
@@ -12801,7 +12913,7 @@ function isMemoSame(cached, memo) {
12801
12913
  return true;
12802
12914
  }
12803
12915
 
12804
- const version = "3.5.40";
12916
+ const version = "3.5.42";
12805
12917
  const warn = warn$1 ;
12806
12918
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12807
12919
  const devtools = devtools$1 ;
@@ -13374,7 +13486,11 @@ function setStyle(style, name, val) {
13374
13486
  }
13375
13487
  }
13376
13488
  if (name.startsWith("--")) {
13377
- style.setProperty(name, val);
13489
+ if (importantRE.test(val)) {
13490
+ style.setProperty(name, val.replace(importantRE, ""), "important");
13491
+ } else {
13492
+ style.setProperty(name, val);
13493
+ }
13378
13494
  } else {
13379
13495
  const prefixed = autoPrefix(style, name);
13380
13496
  if (importantRE.test(val)) {
@@ -13791,7 +13907,9 @@ class VueElement extends BaseClass {
13791
13907
  if (parent && parent._pendingResolve) {
13792
13908
  this._pendingResolve = parent._pendingResolve.then(() => {
13793
13909
  this._pendingResolve = void 0;
13794
- this._resolveDef();
13910
+ if (this.isConnected) {
13911
+ return this._resolveDef();
13912
+ }
13795
13913
  });
13796
13914
  } else {
13797
13915
  this._resolveDef();
@@ -13841,7 +13959,7 @@ class VueElement extends BaseClass {
13841
13959
  */
13842
13960
  _resolveDef() {
13843
13961
  if (this._pendingResolve) {
13844
- return;
13962
+ return this._pendingResolve;
13845
13963
  }
13846
13964
  for (let i = 0; i < this.attributes.length; i++) {
13847
13965
  this._setAttr(this.attributes[i].name);
@@ -13881,6 +13999,7 @@ class VueElement extends BaseClass {
13881
13999
  def.configureApp = this._def.configureApp;
13882
14000
  resolve(this._def = def, true);
13883
14001
  });
14002
+ return this._pendingResolve;
13884
14003
  } else {
13885
14004
  resolve(this._def);
13886
14005
  }
@@ -13918,6 +14037,11 @@ class VueElement extends BaseClass {
13918
14037
  }
13919
14038
  }
13920
14039
  for (const key of declaredPropKeys.map(camelize)) {
14040
+ if (key in Object.getPrototypeOf(this)) {
14041
+ warn(
14042
+ `Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`
14043
+ );
14044
+ }
13921
14045
  Object.defineProperty(this, key, {
13922
14046
  get() {
13923
14047
  return this._getProp(key);
@@ -14411,6 +14535,7 @@ function onCompositionEnd(e) {
14411
14535
  }
14412
14536
  }
14413
14537
  const assignKey = /* @__PURE__ */ Symbol("_assign");
14538
+ const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
14414
14539
  function castValue(value, trim, number) {
14415
14540
  if (trim) value = value.trim();
14416
14541
  if (number) value = looseToNumber(value);
@@ -14418,6 +14543,13 @@ function castValue(value, trim, number) {
14418
14543
  }
14419
14544
  const vModelText = {
14420
14545
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
14546
+ if (el.parentNode) {
14547
+ if (el.type === "text") {
14548
+ el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
14549
+ } else if (el.type === "textarea") {
14550
+ el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
14551
+ }
14552
+ }
14421
14553
  el[assignKey] = getModelAssigner(vnode);
14422
14554
  const castToNumber = number || vnode.props && vnode.props.type === "number";
14423
14555
  addEventListener(el, lazy ? "change" : "input", (e) => {
@@ -14436,8 +14568,15 @@ const vModelText = {
14436
14568
  }
14437
14569
  },
14438
14570
  // set value on mounted so it's after min/max for type="range"
14439
- mounted(el, { value }) {
14440
- el.value = value == null ? "" : value;
14571
+ mounted(el, { value, modifiers: { trim, number } }) {
14572
+ const newValue = value == null ? "" : value;
14573
+ const initialValue = el[initialValueKey];
14574
+ delete el[initialValueKey];
14575
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
14576
+ el[assignKey](castValue(el.value, trim, number));
14577
+ } else {
14578
+ el.value = newValue;
14579
+ }
14441
14580
  },
14442
14581
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
14443
14582
  el[assignKey] = getModelAssigner(vnode);
@@ -14538,13 +14677,21 @@ const vModelSelect = {
14538
14677
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
14539
14678
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
14540
14679
  );
14541
- el[assignKey](
14542
- el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]
14543
- );
14544
- el._assigning = true;
14545
- nextTick(() => {
14546
- el._assigning = false;
14547
- });
14680
+ const multiple = el.multiple;
14681
+ const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
14682
+ const pending = el._pendingValue = [
14683
+ multiple,
14684
+ multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue
14685
+ ];
14686
+ try {
14687
+ el[assignKey](assignedValue);
14688
+ } finally {
14689
+ nextTick(() => {
14690
+ if (el._pendingValue === pending) {
14691
+ el._pendingValue = void 0;
14692
+ }
14693
+ });
14694
+ }
14548
14695
  });
14549
14696
  el[assignKey] = getModelAssigner(vnode);
14550
14697
  },
@@ -14558,11 +14705,25 @@ const vModelSelect = {
14558
14705
  el[assignKey] = getModelAssigner(vnode);
14559
14706
  },
14560
14707
  updated(el, { value }) {
14561
- if (!el._assigning) {
14708
+ const pending = el._pendingValue;
14709
+ el._pendingValue = void 0;
14710
+ if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
14562
14711
  setSelected(el, value);
14563
14712
  }
14564
14713
  }
14565
14714
  };
14715
+ function isSameSelectValue(value, assignedValue, multiple) {
14716
+ if (!multiple) return looseEqual(value, assignedValue);
14717
+ if (isArray(value)) return looseEqual(value, assignedValue);
14718
+ if (isSet(value)) {
14719
+ if (value.size !== assignedValue.length) return false;
14720
+ for (const item of assignedValue) {
14721
+ if (!value.has(item)) return false;
14722
+ }
14723
+ return true;
14724
+ }
14725
+ return false;
14726
+ }
14566
14727
  function setSelected(el, value) {
14567
14728
  const isMultiple = el.multiple;
14568
14729
  const isArrayValue = isArray(value);
@@ -19726,6 +19887,7 @@ const transformFor = createStructuralDirectiveTransform(
19726
19887
  node.loc
19727
19888
  );
19728
19889
  return () => {
19890
+ var _a;
19729
19891
  let childBlock;
19730
19892
  const { children } = forNode;
19731
19893
  if (isTemplate) {
@@ -19769,7 +19931,8 @@ const transformFor = createStructuralDirectiveTransform(
19769
19931
  if (isTemplate && keyProperty) {
19770
19932
  injectProp(childBlock, keyProperty, context);
19771
19933
  }
19772
- if (childBlock.isBlock !== !isStableFragment) {
19934
+ const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
19935
+ if (childBlock.isBlock !== shouldUseBlock) {
19773
19936
  if (childBlock.isBlock) {
19774
19937
  removeHelper(OPEN_BLOCK);
19775
19938
  removeHelper(
@@ -19781,12 +19944,15 @@ const transformFor = createStructuralDirectiveTransform(
19781
19944
  );
19782
19945
  }
19783
19946
  }
19784
- childBlock.isBlock = !isStableFragment;
19947
+ childBlock.isBlock = shouldUseBlock;
19785
19948
  if (childBlock.isBlock) {
19786
19949
  helper(OPEN_BLOCK);
19787
19950
  helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
19788
19951
  } else {
19789
19952
  helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
19953
+ if (childBlock.needsPatch) {
19954
+ childBlock.patchFlag = ((_a = childBlock.patchFlag) != null ? _a : 0) | 512;
19955
+ }
19790
19956
  }
19791
19957
  }
19792
19958
  if (memo) {
@@ -20208,6 +20374,8 @@ const transformElement = (node, context) => {
20208
20374
  let vnodeDynamicProps;
20209
20375
  let dynamicPropNames;
20210
20376
  let vnodeDirectives;
20377
+ let needsPatch = false;
20378
+ let isBlockRequired = false;
20211
20379
  let shouldUseBlock = (
20212
20380
  // dynamic component may resolve to plain elements
20213
20381
  isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
@@ -20227,6 +20395,8 @@ const transformElement = (node, context) => {
20227
20395
  vnodeProps = propsBuildResult.props;
20228
20396
  patchFlag = propsBuildResult.patchFlag;
20229
20397
  dynamicPropNames = propsBuildResult.dynamicPropNames;
20398
+ needsPatch = propsBuildResult.needsPatch;
20399
+ isBlockRequired = propsBuildResult.isBlockRequired;
20230
20400
  const directives = propsBuildResult.directives;
20231
20401
  vnodeDirectives = directives && directives.length ? createArrayExpression(
20232
20402
  directives.map((dir) => buildDirectiveArgs(dir, context))
@@ -20277,7 +20447,7 @@ const transformElement = (node, context) => {
20277
20447
  if (dynamicPropNames && dynamicPropNames.length) {
20278
20448
  vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
20279
20449
  }
20280
- node.codegenNode = createVNodeCall(
20450
+ const vnodeCall = node.codegenNode = createVNodeCall(
20281
20451
  context,
20282
20452
  vnodeTag,
20283
20453
  vnodeProps,
@@ -20290,6 +20460,13 @@ const transformElement = (node, context) => {
20290
20460
  isComponent,
20291
20461
  node.loc
20292
20462
  );
20463
+ needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
20464
+ if (needsPatch) {
20465
+ vnodeCall.needsPatch = true;
20466
+ }
20467
+ if (isBlockRequired) {
20468
+ vnodeCall.isBlockRequired = true;
20469
+ }
20293
20470
  };
20294
20471
  };
20295
20472
  function resolveComponentType(node, context, ssr = false) {
@@ -20399,6 +20576,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
20399
20576
  const runtimeDirectives = [];
20400
20577
  const hasChildren = children.length > 0;
20401
20578
  let shouldUseBlock = false;
20579
+ let isBlockRequired = false;
20402
20580
  let patchFlag = 0;
20403
20581
  let hasRef = false;
20404
20582
  let hasClassBinding = false;
@@ -20440,19 +20618,20 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
20440
20618
  if (isEventHandler && isReservedProp(name)) {
20441
20619
  hasVnodeHook = true;
20442
20620
  }
20621
+ if (name === "ref") {
20622
+ hasRef = true;
20623
+ }
20443
20624
  if (isEventHandler && value.type === 14) {
20444
20625
  value = value.arguments[0];
20445
20626
  }
20446
20627
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
20447
20628
  return;
20448
20629
  }
20449
- if (name === "ref") {
20450
- hasRef = true;
20451
- } else if (name === "class") {
20630
+ if (name === "class") {
20452
20631
  hasClassBinding = true;
20453
20632
  } else if (name === "style") {
20454
20633
  hasStyleBinding = true;
20455
- } else if (name !== "key" && !dynamicPropNames.includes(name)) {
20634
+ } else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) {
20456
20635
  dynamicPropNames.push(name);
20457
20636
  }
20458
20637
  if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
@@ -20523,13 +20702,12 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
20523
20702
  if (isVOn && ssr) {
20524
20703
  continue;
20525
20704
  }
20526
- if (
20527
- // #938: elements with dynamic keys should be forced into blocks
20528
- isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked
20529
- // before children
20530
- isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
20531
- ) {
20705
+ if (isVBind && isStaticArgOf(arg, "key")) {
20706
+ shouldUseBlock = true;
20707
+ }
20708
+ if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
20532
20709
  shouldUseBlock = true;
20710
+ isBlockRequired = true;
20533
20711
  }
20534
20712
  if (isVBind && isStaticArgOf(arg, "ref")) {
20535
20713
  pushRefVForMarker();
@@ -20612,6 +20790,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
20612
20790
  runtimeDirectives.push(prop);
20613
20791
  if (hasChildren) {
20614
20792
  shouldUseBlock = true;
20793
+ isBlockRequired = true;
20615
20794
  }
20616
20795
  }
20617
20796
  }
@@ -20650,7 +20829,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
20650
20829
  patchFlag |= 32;
20651
20830
  }
20652
20831
  }
20653
- if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
20832
+ const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
20833
+ if (!shouldUseBlock && needsPatch) {
20654
20834
  patchFlag |= 512;
20655
20835
  }
20656
20836
  if (!context.inSSR && propsExpression) {
@@ -20716,7 +20896,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
20716
20896
  directives: runtimeDirectives,
20717
20897
  patchFlag,
20718
20898
  dynamicPropNames,
20719
- shouldUseBlock
20899
+ shouldUseBlock,
20900
+ needsPatch,
20901
+ isBlockRequired
20720
20902
  };
20721
20903
  }
20722
20904
  function dedupeProperties(properties) {
@@ -22095,12 +22277,15 @@ function stringifyElement(node, context) {
22095
22277
  res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
22096
22278
  continue;
22097
22279
  }
22098
- if (isBooleanAttr(p.arg.content) && exp.content === "false") {
22280
+ if ((isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && exp.content === "false") {
22099
22281
  continue;
22100
22282
  }
22101
22283
  let evaluated = evaluateConstant(exp);
22102
22284
  if (evaluated != null) {
22103
22285
  const arg = p.arg && p.arg.content;
22286
+ if (arg === "hidden" && typeof evaluated === "number" && !includeBooleanAttr(evaluated)) {
22287
+ continue;
22288
+ }
22104
22289
  if (arg === "class") {
22105
22290
  evaluated = normalizeClass(evaluated);
22106
22291
  } else if (arg === "style") {