@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
  **/
@@ -213,7 +213,7 @@ const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
213
213
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
214
214
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
215
215
  const isBooleanAttr = /* @__PURE__ */ makeMap(
216
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
216
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
217
217
  );
218
218
  function includeBooleanAttr(value) {
219
219
  return !!value || value === "";
@@ -276,6 +276,23 @@ function looseCompareArrays(a, b) {
276
276
  }
277
277
  return equal;
278
278
  }
279
+ function looseCompareCollections(a, b) {
280
+ if (a.size !== b.size) return false;
281
+ const candidates = Array.from(b);
282
+ const matched = new Uint8Array(candidates.length);
283
+ for (const item of a) {
284
+ let index = -1;
285
+ for (let i = 0; i < candidates.length; i++) {
286
+ if (!matched[i] && looseEqual(item, candidates[i])) {
287
+ index = i;
288
+ break;
289
+ }
290
+ }
291
+ if (index < 0) return false;
292
+ matched[index] = 1;
293
+ }
294
+ return true;
295
+ }
279
296
  function looseEqual(a, b) {
280
297
  if (a === b) return true;
281
298
  let aValidType = isDate(a);
@@ -299,6 +316,16 @@ function looseEqual(a, b) {
299
316
  if (!aValidType || !bValidType) {
300
317
  return false;
301
318
  }
319
+ aValidType = isMap(a);
320
+ bValidType = isMap(b);
321
+ if (aValidType || bValidType) {
322
+ return aValidType && bValidType ? looseCompareCollections(a, b) : false;
323
+ }
324
+ aValidType = isSet(a);
325
+ bValidType = isSet(b);
326
+ if (aValidType || bValidType) {
327
+ return aValidType && bValidType ? looseCompareCollections(a, b) : false;
328
+ }
302
329
  const aKeysCount = Object.keys(a).length;
303
330
  const bKeysCount = Object.keys(b).length;
304
331
  if (aKeysCount !== bKeysCount) {
@@ -2345,7 +2372,9 @@ function queuePostFlushCb(cb) {
2345
2372
  cb.flags |= 1;
2346
2373
  }
2347
2374
  } else {
2348
- pendingPostFlushCbs.push(...cb);
2375
+ for (let i = 0; i < cb.length; i++) {
2376
+ pendingPostFlushCbs.push(cb[i]);
2377
+ }
2349
2378
  }
2350
2379
  queueFlush();
2351
2380
  }
@@ -2375,7 +2404,9 @@ function flushPostFlushCbs(seen) {
2375
2404
  );
2376
2405
  pendingPostFlushCbs.length = 0;
2377
2406
  if (activePostFlushCbs) {
2378
- activePostFlushCbs.push(...deduped);
2407
+ for (let i = 0; i < deduped.length; i++) {
2408
+ activePostFlushCbs.push(deduped[i]);
2409
+ }
2379
2410
  return;
2380
2411
  }
2381
2412
  activePostFlushCbs = deduped;
@@ -3542,7 +3573,11 @@ function getInnerChild$1(vnode) {
3542
3573
  function setTransitionHooks(vnode, hooks) {
3543
3574
  if (vnode.shapeFlag & 6 && vnode.component) {
3544
3575
  vnode.transition = hooks;
3545
- setTransitionHooks(vnode.component.subTree, hooks);
3576
+ const subTree = vnode.component.subTree;
3577
+ setTransitionHooks(
3578
+ isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
3579
+ hooks
3580
+ );
3546
3581
  } else if (vnode.shapeFlag & 128) {
3547
3582
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3548
3583
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -3892,10 +3927,10 @@ function createHydrationFunctions(rendererInternals) {
3892
3927
  getContainerType(container),
3893
3928
  optimized
3894
3929
  );
3895
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
3930
+ if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
3896
3931
  let subTree;
3897
3932
  if (isFragmentStart) {
3898
- subTree = createVNode(Fragment);
3933
+ subTree = createVNode(Static);
3899
3934
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
3900
3935
  } else {
3901
3936
  subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
@@ -4010,6 +4045,9 @@ function createHydrationFunctions(rendererInternals) {
4010
4045
  for (const key in props) {
4011
4046
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4012
4047
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4048
+ if (isUnchangedResourceProp(el, key, props[key])) {
4049
+ continue;
4050
+ }
4013
4051
  patchProp(el, key, null, props[key], namespace, parentComponent);
4014
4052
  }
4015
4053
  }
@@ -4188,6 +4226,13 @@ function createHydrationFunctions(rendererInternals) {
4188
4226
  };
4189
4227
  return [hydrate, hydrateNode];
4190
4228
  }
4229
+ const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
4230
+ function isUnchangedResourceProp(el, key, clientValue) {
4231
+ if (!resourceProps.has(key)) {
4232
+ return false;
4233
+ }
4234
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
4235
+ }
4191
4236
  const allowMismatchAttr = "data-allow-mismatch";
4192
4237
  const MismatchTypeString = {
4193
4238
  [0 /* TEXT */]: "text",
@@ -4611,7 +4656,10 @@ const KeepAliveImpl = {
4611
4656
  if (pendingCacheKey != null) {
4612
4657
  if (isSuspense(instance.subTree.type)) {
4613
4658
  queuePostRenderEffect(() => {
4614
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
4659
+ const vnode = getInnerChild(instance.subTree);
4660
+ if (vnode.component) {
4661
+ cache.set(pendingCacheKey, vnode);
4662
+ }
4615
4663
  }, instance.subTree.suspense);
4616
4664
  } else {
4617
4665
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
@@ -5201,7 +5249,8 @@ function createSlots(slots, dynamicSlots) {
5201
5249
  return slots;
5202
5250
  }
5203
5251
 
5204
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
5252
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
5253
+ if (props == null) props = {};
5205
5254
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
5206
5255
  const slotProps = branchKey != null && props.key == null ? extend$1({}, props, { key: branchKey }) : props;
5207
5256
  const hasProps = Object.keys(slotProps).length > 0;
@@ -6169,7 +6218,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6169
6218
  return vm;
6170
6219
  }
6171
6220
  }
6172
- Vue.version = `2.6.14-compat:${"3.5.40"}`;
6221
+ Vue.version = `2.6.14-compat:${"3.5.42"}`;
6173
6222
  Vue.config = singletonApp.config;
6174
6223
  Vue.use = (plugin, ...options) => {
6175
6224
  if (plugin && isFunction(plugin.install)) {
@@ -6766,7 +6815,7 @@ function emit(instance, event, ...rawArgs) {
6766
6815
  args = rawArgs.map((a) => isString(a) ? a.trim() : a);
6767
6816
  }
6768
6817
  if (modifiers.number) {
6769
- args = rawArgs.map(looseToNumber);
6818
+ args = args.map(looseToNumber);
6770
6819
  }
6771
6820
  }
6772
6821
  let handlerName;
@@ -6968,7 +7017,8 @@ function renderComponentRoot(instance) {
6968
7017
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
6969
7018
  }
6970
7019
  if (vnode.transition) {
6971
- setTransitionHooks(root, vnode.transition);
7020
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
7021
+ setTransitionHooks(child, vnode.transition);
6972
7022
  }
6973
7023
  {
6974
7024
  result = root;
@@ -9107,7 +9157,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9107
9157
  if (suspense.deps <= 0) {
9108
9158
  suspense.resolve();
9109
9159
  } else if (isInFallback) {
9110
- if (!isHydrating) {
9160
+ if (!isHydrating && !suspense.isFallbackMountPending) {
9111
9161
  patch(
9112
9162
  activeBranch,
9113
9163
  newFallback,
@@ -9148,7 +9198,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9148
9198
  );
9149
9199
  if (suspense.deps <= 0) {
9150
9200
  suspense.resolve();
9151
- } else {
9201
+ } else if (!suspense.isFallbackMountPending) {
9152
9202
  patch(
9153
9203
  activeBranch,
9154
9204
  newFallback,
@@ -9333,7 +9383,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9333
9383
  let hasUnresolvedAncestor = false;
9334
9384
  while (parent) {
9335
9385
  if (parent.pendingBranch) {
9336
- parent.effects.push(...effects);
9386
+ for (let i = 0; i < effects.length; i++) {
9387
+ parent.effects.push(effects[i]);
9388
+ }
9337
9389
  hasUnresolvedAncestor = true;
9338
9390
  break;
9339
9391
  }
@@ -9365,9 +9417,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9365
9417
  if (!suspense.isInFallback) {
9366
9418
  return;
9367
9419
  }
9420
+ const latestFallback = suspense.vnode.ssFallback;
9368
9421
  patch(
9369
9422
  null,
9370
- fallbackVNode,
9423
+ latestFallback,
9371
9424
  container2,
9372
9425
  anchor2,
9373
9426
  parentComponent2,
@@ -9377,7 +9430,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9377
9430
  slotScopeIds,
9378
9431
  optimized
9379
9432
  );
9380
- setActiveBranch(suspense, fallbackVNode);
9433
+ setActiveBranch(suspense, latestFallback);
9381
9434
  };
9382
9435
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
9383
9436
  if (delayEnter) {
@@ -10147,7 +10200,12 @@ function setupStatefulComponent(instance, isSSR) {
10147
10200
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
10148
10201
  if (isSSR) {
10149
10202
  return setupResult.then((resolvedResult) => {
10150
- handleSetupResult(instance, resolvedResult, isSSR);
10203
+ setInSSRSetupState(true);
10204
+ try {
10205
+ handleSetupResult(instance, resolvedResult, isSSR);
10206
+ } finally {
10207
+ setInSSRSetupState(false);
10208
+ }
10151
10209
  }).catch((e) => {
10152
10210
  handleError(e, instance, 0);
10153
10211
  });
@@ -10337,7 +10395,7 @@ function isMemoSame(cached, memo) {
10337
10395
  return true;
10338
10396
  }
10339
10397
 
10340
- const version = "3.5.40";
10398
+ const version = "3.5.42";
10341
10399
  const warn$1 = NOOP;
10342
10400
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10343
10401
  const devtools = void 0;
@@ -10898,7 +10956,11 @@ function setStyle(style, name, val) {
10898
10956
  } else {
10899
10957
  if (val == null) val = "";
10900
10958
  if (name.startsWith("--")) {
10901
- style.setProperty(name, val);
10959
+ if (importantRE.test(val)) {
10960
+ style.setProperty(name, val.replace(importantRE, ""), "important");
10961
+ } else {
10962
+ style.setProperty(name, val);
10963
+ }
10902
10964
  } else {
10903
10965
  const prefixed = autoPrefix(style, name);
10904
10966
  if (importantRE.test(val)) {
@@ -11289,7 +11351,9 @@ class VueElement extends BaseClass {
11289
11351
  if (parent && parent._pendingResolve) {
11290
11352
  this._pendingResolve = parent._pendingResolve.then(() => {
11291
11353
  this._pendingResolve = void 0;
11292
- this._resolveDef();
11354
+ if (this.isConnected) {
11355
+ return this._resolveDef();
11356
+ }
11293
11357
  });
11294
11358
  } else {
11295
11359
  this._resolveDef();
@@ -11339,7 +11403,7 @@ class VueElement extends BaseClass {
11339
11403
  */
11340
11404
  _resolveDef() {
11341
11405
  if (this._pendingResolve) {
11342
- return;
11406
+ return this._pendingResolve;
11343
11407
  }
11344
11408
  for (let i = 0; i < this.attributes.length; i++) {
11345
11409
  this._setAttr(this.attributes[i].name);
@@ -11375,6 +11439,7 @@ class VueElement extends BaseClass {
11375
11439
  def.configureApp = this._def.configureApp;
11376
11440
  resolve(this._def = def, true);
11377
11441
  });
11442
+ return this._pendingResolve;
11378
11443
  } else {
11379
11444
  resolve(this._def);
11380
11445
  }
@@ -11848,6 +11913,7 @@ function onCompositionEnd(e) {
11848
11913
  }
11849
11914
  }
11850
11915
  const assignKey = /* @__PURE__ */ Symbol("_assign");
11916
+ const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
11851
11917
  function castValue(value, trim, number) {
11852
11918
  if (trim) value = value.trim();
11853
11919
  if (number) value = looseToNumber(value);
@@ -11855,6 +11921,13 @@ function castValue(value, trim, number) {
11855
11921
  }
11856
11922
  const vModelText = {
11857
11923
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
11924
+ if (el.parentNode) {
11925
+ if (el.type === "text") {
11926
+ el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
11927
+ } else if (el.type === "textarea") {
11928
+ el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
11929
+ }
11930
+ }
11858
11931
  el[assignKey] = getModelAssigner(vnode);
11859
11932
  const castToNumber = number || vnode.props && vnode.props.type === "number";
11860
11933
  addEventListener(el, lazy ? "change" : "input", (e) => {
@@ -11873,8 +11946,15 @@ const vModelText = {
11873
11946
  }
11874
11947
  },
11875
11948
  // set value on mounted so it's after min/max for type="range"
11876
- mounted(el, { value }) {
11877
- el.value = value == null ? "" : value;
11949
+ mounted(el, { value, modifiers: { trim, number } }) {
11950
+ const newValue = value == null ? "" : value;
11951
+ const initialValue = el[initialValueKey];
11952
+ delete el[initialValueKey];
11953
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
11954
+ el[assignKey](castValue(el.value, trim, number));
11955
+ } else {
11956
+ el.value = newValue;
11957
+ }
11878
11958
  },
11879
11959
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
11880
11960
  el[assignKey] = getModelAssigner(vnode);
@@ -11975,13 +12055,21 @@ const vModelSelect = {
11975
12055
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
11976
12056
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
11977
12057
  );
11978
- el[assignKey](
11979
- el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]
11980
- );
11981
- el._assigning = true;
11982
- nextTick(() => {
11983
- el._assigning = false;
11984
- });
12058
+ const multiple = el.multiple;
12059
+ const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
12060
+ const pending = el._pendingValue = [
12061
+ multiple,
12062
+ multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue
12063
+ ];
12064
+ try {
12065
+ el[assignKey](assignedValue);
12066
+ } finally {
12067
+ nextTick(() => {
12068
+ if (el._pendingValue === pending) {
12069
+ el._pendingValue = void 0;
12070
+ }
12071
+ });
12072
+ }
11985
12073
  });
11986
12074
  el[assignKey] = getModelAssigner(vnode);
11987
12075
  },
@@ -11995,11 +12083,25 @@ const vModelSelect = {
11995
12083
  el[assignKey] = getModelAssigner(vnode);
11996
12084
  },
11997
12085
  updated(el, { value }) {
11998
- if (!el._assigning) {
12086
+ const pending = el._pendingValue;
12087
+ el._pendingValue = void 0;
12088
+ if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
11999
12089
  setSelected(el, value);
12000
12090
  }
12001
12091
  }
12002
12092
  };
12093
+ function isSameSelectValue(value, assignedValue, multiple) {
12094
+ if (!multiple) return looseEqual(value, assignedValue);
12095
+ if (isArray(value)) return looseEqual(value, assignedValue);
12096
+ if (isSet(value)) {
12097
+ if (value.size !== assignedValue.length) return false;
12098
+ for (const item of assignedValue) {
12099
+ if (!value.has(item)) return false;
12100
+ }
12101
+ return true;
12102
+ }
12103
+ return false;
12104
+ }
12003
12105
  function setSelected(el, value) {
12004
12106
  const isMultiple = el.multiple;
12005
12107
  const isArrayValue = isArray(value);
@@ -16951,6 +17053,7 @@ const transformFor = createStructuralDirectiveTransform(
16951
17053
  node.loc
16952
17054
  );
16953
17055
  return () => {
17056
+ var _a;
16954
17057
  let childBlock;
16955
17058
  const { children } = forNode;
16956
17059
  if (isTemplate) {
@@ -16994,7 +17097,8 @@ const transformFor = createStructuralDirectiveTransform(
16994
17097
  if (isTemplate && keyProperty) {
16995
17098
  injectProp(childBlock, keyProperty, context);
16996
17099
  }
16997
- if (childBlock.isBlock !== !isStableFragment) {
17100
+ const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
17101
+ if (childBlock.isBlock !== shouldUseBlock) {
16998
17102
  if (childBlock.isBlock) {
16999
17103
  removeHelper(OPEN_BLOCK);
17000
17104
  removeHelper(
@@ -17006,12 +17110,15 @@ const transformFor = createStructuralDirectiveTransform(
17006
17110
  );
17007
17111
  }
17008
17112
  }
17009
- childBlock.isBlock = !isStableFragment;
17113
+ childBlock.isBlock = shouldUseBlock;
17010
17114
  if (childBlock.isBlock) {
17011
17115
  helper(OPEN_BLOCK);
17012
17116
  helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
17013
17117
  } else {
17014
17118
  helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
17119
+ if (childBlock.needsPatch) {
17120
+ childBlock.patchFlag = ((_a = childBlock.patchFlag) != null ? _a : 0) | 512;
17121
+ }
17015
17122
  }
17016
17123
  }
17017
17124
  if (memo) {
@@ -17433,6 +17540,8 @@ const transformElement = (node, context) => {
17433
17540
  let vnodeDynamicProps;
17434
17541
  let dynamicPropNames;
17435
17542
  let vnodeDirectives;
17543
+ let needsPatch = false;
17544
+ let isBlockRequired = false;
17436
17545
  let shouldUseBlock = (
17437
17546
  // dynamic component may resolve to plain elements
17438
17547
  isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
@@ -17452,6 +17561,8 @@ const transformElement = (node, context) => {
17452
17561
  vnodeProps = propsBuildResult.props;
17453
17562
  patchFlag = propsBuildResult.patchFlag;
17454
17563
  dynamicPropNames = propsBuildResult.dynamicPropNames;
17564
+ needsPatch = propsBuildResult.needsPatch;
17565
+ isBlockRequired = propsBuildResult.isBlockRequired;
17455
17566
  const directives = propsBuildResult.directives;
17456
17567
  vnodeDirectives = directives && directives.length ? createArrayExpression(
17457
17568
  directives.map((dir) => buildDirectiveArgs(dir, context))
@@ -17493,7 +17604,7 @@ const transformElement = (node, context) => {
17493
17604
  if (dynamicPropNames && dynamicPropNames.length) {
17494
17605
  vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
17495
17606
  }
17496
- node.codegenNode = createVNodeCall(
17607
+ const vnodeCall = node.codegenNode = createVNodeCall(
17497
17608
  context,
17498
17609
  vnodeTag,
17499
17610
  vnodeProps,
@@ -17506,6 +17617,13 @@ const transformElement = (node, context) => {
17506
17617
  isComponent,
17507
17618
  node.loc
17508
17619
  );
17620
+ needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
17621
+ if (needsPatch) {
17622
+ vnodeCall.needsPatch = true;
17623
+ }
17624
+ if (isBlockRequired) {
17625
+ vnodeCall.isBlockRequired = true;
17626
+ }
17509
17627
  };
17510
17628
  };
17511
17629
  function resolveComponentType(node, context, ssr = false) {
@@ -17615,6 +17733,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17615
17733
  const runtimeDirectives = [];
17616
17734
  const hasChildren = children.length > 0;
17617
17735
  let shouldUseBlock = false;
17736
+ let isBlockRequired = false;
17618
17737
  let patchFlag = 0;
17619
17738
  let hasRef = false;
17620
17739
  let hasClassBinding = false;
@@ -17656,19 +17775,20 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17656
17775
  if (isEventHandler && isReservedProp(name)) {
17657
17776
  hasVnodeHook = true;
17658
17777
  }
17778
+ if (name === "ref") {
17779
+ hasRef = true;
17780
+ }
17659
17781
  if (isEventHandler && value.type === 14) {
17660
17782
  value = value.arguments[0];
17661
17783
  }
17662
17784
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
17663
17785
  return;
17664
17786
  }
17665
- if (name === "ref") {
17666
- hasRef = true;
17667
- } else if (name === "class") {
17787
+ if (name === "class") {
17668
17788
  hasClassBinding = true;
17669
17789
  } else if (name === "style") {
17670
17790
  hasStyleBinding = true;
17671
- } else if (name !== "key" && !dynamicPropNames.includes(name)) {
17791
+ } else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) {
17672
17792
  dynamicPropNames.push(name);
17673
17793
  }
17674
17794
  if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
@@ -17739,14 +17859,13 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17739
17859
  if (isVOn && ssr) {
17740
17860
  continue;
17741
17861
  }
17742
- if (
17743
- // #938: elements with dynamic keys should be forced into blocks
17744
- isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked
17745
- // before children
17746
- isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
17747
- ) {
17862
+ if (isVBind && isStaticArgOf(arg, "key")) {
17748
17863
  shouldUseBlock = true;
17749
17864
  }
17865
+ if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
17866
+ shouldUseBlock = true;
17867
+ isBlockRequired = true;
17868
+ }
17750
17869
  if (isVBind && isStaticArgOf(arg, "ref")) {
17751
17870
  pushRefVForMarker();
17752
17871
  }
@@ -17807,6 +17926,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17807
17926
  runtimeDirectives.push(prop);
17808
17927
  if (hasChildren) {
17809
17928
  shouldUseBlock = true;
17929
+ isBlockRequired = true;
17810
17930
  }
17811
17931
  }
17812
17932
  }
@@ -17845,7 +17965,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17845
17965
  patchFlag |= 32;
17846
17966
  }
17847
17967
  }
17848
- if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
17968
+ const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
17969
+ if (!shouldUseBlock && needsPatch) {
17849
17970
  patchFlag |= 512;
17850
17971
  }
17851
17972
  if (!context.inSSR && propsExpression) {
@@ -17911,7 +18032,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17911
18032
  directives: runtimeDirectives,
17912
18033
  patchFlag,
17913
18034
  dynamicPropNames,
17914
- shouldUseBlock
18035
+ shouldUseBlock,
18036
+ needsPatch,
18037
+ isBlockRequired
17915
18038
  };
17916
18039
  }
17917
18040
  function dedupeProperties(properties) {
@@ -19216,12 +19339,15 @@ function stringifyElement(node, context) {
19216
19339
  res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
19217
19340
  continue;
19218
19341
  }
19219
- if (isBooleanAttr(p.arg.content) && exp.content === "false") {
19342
+ if ((isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && exp.content === "false") {
19220
19343
  continue;
19221
19344
  }
19222
19345
  let evaluated = evaluateConstant(exp);
19223
19346
  if (evaluated != null) {
19224
19347
  const arg = p.arg && p.arg.content;
19348
+ if (arg === "hidden" && typeof evaluated === "number" && !includeBooleanAttr(evaluated)) {
19349
+ continue;
19350
+ }
19225
19351
  if (arg === "class") {
19226
19352
  evaluated = normalizeClass(evaluated);
19227
19353
  } else if (arg === "style") {