@vue/compat 3.5.39 → 3.5.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.39
2
+ * @vue/compat v3.5.41
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -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 === "";
@@ -401,8 +401,9 @@ class EffectScope {
401
401
  this._isPaused = true;
402
402
  let i, l;
403
403
  if (this.scopes) {
404
- for (i = 0, l = this.scopes.length; i < l; i++) {
405
- this.scopes[i].pause();
404
+ const scopes = this.scopes.slice();
405
+ for (i = 0, l = scopes.length; i < l; i++) {
406
+ scopes[i].pause();
406
407
  }
407
408
  }
408
409
  for (i = 0, l = this.effects.length; i < l; i++) {
@@ -419,12 +420,14 @@ class EffectScope {
419
420
  this._isPaused = false;
420
421
  let i, l;
421
422
  if (this.scopes) {
422
- for (i = 0, l = this.scopes.length; i < l; i++) {
423
- this.scopes[i].resume();
423
+ const scopes = this.scopes.slice();
424
+ for (i = 0, l = scopes.length; i < l; i++) {
425
+ scopes[i].resume();
424
426
  }
425
427
  }
426
- for (i = 0, l = this.effects.length; i < l; i++) {
427
- this.effects[i].resume();
428
+ const effects = this.effects.slice();
429
+ for (i = 0, l = effects.length; i < l; i++) {
430
+ effects[i].resume();
428
431
  }
429
432
  }
430
433
  }
@@ -484,8 +487,9 @@ class EffectScope {
484
487
  }
485
488
  this.cleanups.length = 0;
486
489
  if (this.scopes) {
487
- for (i = 0, l = this.scopes.length; i < l; i++) {
488
- this.scopes[i].stop(true);
490
+ const scopes = this.scopes.slice();
491
+ for (i = 0, l = scopes.length; i < l; i++) {
492
+ scopes[i].stop(true);
489
493
  }
490
494
  this.scopes.length = 0;
491
495
  }
@@ -2341,7 +2345,9 @@ function queuePostFlushCb(cb) {
2341
2345
  cb.flags |= 1;
2342
2346
  }
2343
2347
  } else {
2344
- pendingPostFlushCbs.push(...cb);
2348
+ for (let i = 0; i < cb.length; i++) {
2349
+ pendingPostFlushCbs.push(cb[i]);
2350
+ }
2345
2351
  }
2346
2352
  queueFlush();
2347
2353
  }
@@ -2371,7 +2377,9 @@ function flushPostFlushCbs(seen) {
2371
2377
  );
2372
2378
  pendingPostFlushCbs.length = 0;
2373
2379
  if (activePostFlushCbs) {
2374
- activePostFlushCbs.push(...deduped);
2380
+ for (let i = 0; i < deduped.length; i++) {
2381
+ activePostFlushCbs.push(deduped[i]);
2382
+ }
2375
2383
  return;
2376
2384
  }
2377
2385
  activePostFlushCbs = deduped;
@@ -2611,10 +2619,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
2611
2619
  setBlockTracking(-1);
2612
2620
  }
2613
2621
  const prevInstance = setCurrentRenderingInstance(ctx);
2622
+ const prevStackSize = blockStack.length;
2614
2623
  let res;
2615
2624
  try {
2616
2625
  res = fn(...args);
2617
2626
  } finally {
2627
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
2618
2628
  setCurrentRenderingInstance(prevInstance);
2619
2629
  if (renderFnWithContext._d) {
2620
2630
  setBlockTracking(1);
@@ -3536,7 +3546,11 @@ function getInnerChild$1(vnode) {
3536
3546
  function setTransitionHooks(vnode, hooks) {
3537
3547
  if (vnode.shapeFlag & 6 && vnode.component) {
3538
3548
  vnode.transition = hooks;
3539
- setTransitionHooks(vnode.component.subTree, hooks);
3549
+ const subTree = vnode.component.subTree;
3550
+ setTransitionHooks(
3551
+ isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
3552
+ hooks
3553
+ );
3540
3554
  } else if (vnode.shapeFlag & 128) {
3541
3555
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3542
3556
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -3663,12 +3677,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3663
3677
  }
3664
3678
  }
3665
3679
  if (isFunction(ref)) {
3666
- pauseTracking();
3667
- try {
3668
- callWithErrorHandling(ref, owner, 12, [value, refs]);
3669
- } finally {
3670
- resetTracking();
3671
- }
3680
+ callWithErrorHandling(ref, owner, 12, [value, refs]);
3672
3681
  } else {
3673
3682
  const _isString = isString(ref);
3674
3683
  const _isRef = isRef(ref);
@@ -4005,10 +4014,14 @@ function createHydrationFunctions(rendererInternals) {
4005
4014
  if (props) {
4006
4015
  if (forcePatch || hasDynamicProps || !optimized || patchFlag & (16 | 32)) {
4007
4016
  const isCustomElement = el.tagName.includes("-");
4017
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
4008
4018
  for (const key in props) {
4009
4019
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4010
4020
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4011
- patchProp(el, key, null, props[key], void 0, parentComponent);
4021
+ if (isUnchangedResourceProp(el, key, props[key])) {
4022
+ continue;
4023
+ }
4024
+ patchProp(el, key, null, props[key], namespace, parentComponent);
4012
4025
  }
4013
4026
  }
4014
4027
  } else if (props.onClick) {
@@ -4186,6 +4199,13 @@ function createHydrationFunctions(rendererInternals) {
4186
4199
  };
4187
4200
  return [hydrate, hydrateNode];
4188
4201
  }
4202
+ const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
4203
+ function isUnchangedResourceProp(el, key, clientValue) {
4204
+ if (!resourceProps.has(key)) {
4205
+ return false;
4206
+ }
4207
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
4208
+ }
4189
4209
  const allowMismatchAttr = "data-allow-mismatch";
4190
4210
  const MismatchTypeString = {
4191
4211
  [0 /* TEXT */]: "text",
@@ -4376,12 +4396,14 @@ function defineAsyncComponent(source) {
4376
4396
  name: "AsyncComponentWrapper",
4377
4397
  __asyncLoader: load,
4378
4398
  __asyncHydrate(el, instance, hydrate) {
4399
+ const wasConnected = el.isConnected;
4379
4400
  let patched = false;
4380
4401
  (instance.bu || (instance.bu = [])).push(() => patched = true);
4381
4402
  const performHydrate = () => {
4382
4403
  if (patched) {
4383
4404
  return;
4384
4405
  }
4406
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
4385
4407
  hydrate();
4386
4408
  };
4387
4409
  const doHydrate = hydrateStrategy ? () => {
@@ -5197,14 +5219,16 @@ function createSlots(slots, dynamicSlots) {
5197
5219
  return slots;
5198
5220
  }
5199
5221
 
5200
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5222
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
5223
+ if (props == null) props = {};
5201
5224
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
5202
- const hasProps = Object.keys(props).length > 0;
5203
- if (name !== "default") props.name = name;
5225
+ const slotProps = branchKey != null && props.key == null ? extend$1({}, props, { key: branchKey }) : props;
5226
+ const hasProps = Object.keys(slotProps).length > 0;
5227
+ if (name !== "default") slotProps.name = name;
5204
5228
  return openBlock(), createBlock(
5205
5229
  Fragment,
5206
5230
  null,
5207
- [createVNode("slot", props, fallback && fallback())],
5231
+ [createVNode("slot", slotProps, fallback && fallback())],
5208
5232
  hasProps ? -2 : 64
5209
5233
  );
5210
5234
  }
@@ -5212,26 +5236,34 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5212
5236
  if (slot && slot._c) {
5213
5237
  slot._d = false;
5214
5238
  }
5239
+ const prevStackSize = blockStack.length;
5215
5240
  openBlock();
5216
- const validSlotContent = slot && ensureValidVNode(slot(props));
5217
- const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5218
- // key attached in the `createSlots` helper, respect that
5219
- validSlotContent && validSlotContent.key;
5220
- const rendered = createBlock(
5221
- Fragment,
5222
- {
5223
- key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
5224
- (!validSlotContent && fallback ? "_fb" : "")
5225
- },
5226
- validSlotContent || (fallback ? fallback() : []),
5227
- validSlotContent && slots._ === 1 ? 64 : -2
5228
- );
5241
+ let rendered;
5242
+ try {
5243
+ const validSlotContent = slot && ensureValidVNode(slot(props));
5244
+ const slotKey = props.key || branchKey || // slot content array of a dynamic conditional slot may have a branch
5245
+ // key attached in the `createSlots` helper, respect that
5246
+ validSlotContent && validSlotContent.key;
5247
+ rendered = createBlock(
5248
+ Fragment,
5249
+ {
5250
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
5251
+ (!validSlotContent && fallback ? "_fb" : "")
5252
+ },
5253
+ validSlotContent || (fallback ? fallback() : []),
5254
+ validSlotContent && slots._ === 1 ? 64 : -2
5255
+ );
5256
+ } catch (err) {
5257
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
5258
+ throw err;
5259
+ } finally {
5260
+ if (slot && slot._c) {
5261
+ slot._d = true;
5262
+ }
5263
+ }
5229
5264
  if (!noSlotted && rendered.scopeId) {
5230
5265
  rendered.slotScopeIds = [rendered.scopeId + "-s"];
5231
5266
  }
5232
- if (slot && slot._c) {
5233
- slot._d = true;
5234
- }
5235
5267
  return rendered;
5236
5268
  }
5237
5269
  function ensureValidVNode(vnodes) {
@@ -6156,7 +6188,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6156
6188
  return vm;
6157
6189
  }
6158
6190
  }
6159
- Vue.version = `2.6.14-compat:${"3.5.39"}`;
6191
+ Vue.version = `2.6.14-compat:${"3.5.41"}`;
6160
6192
  Vue.config = singletonApp.config;
6161
6193
  Vue.use = (plugin, ...options) => {
6162
6194
  if (plugin && isFunction(plugin.install)) {
@@ -6955,7 +6987,8 @@ function renderComponentRoot(instance) {
6955
6987
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
6956
6988
  }
6957
6989
  if (vnode.transition) {
6958
- setTransitionHooks(root, vnode.transition);
6990
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
6991
+ setTransitionHooks(child, vnode.transition);
6959
6992
  }
6960
6993
  {
6961
6994
  result = root;
@@ -9320,7 +9353,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9320
9353
  let hasUnresolvedAncestor = false;
9321
9354
  while (parent) {
9322
9355
  if (parent.pendingBranch) {
9323
- parent.effects.push(...effects);
9356
+ for (let i = 0; i < effects.length; i++) {
9357
+ parent.effects.push(effects[i]);
9358
+ }
9324
9359
  hasUnresolvedAncestor = true;
9325
9360
  break;
9326
9361
  }
@@ -10134,7 +10169,12 @@ function setupStatefulComponent(instance, isSSR) {
10134
10169
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
10135
10170
  if (isSSR) {
10136
10171
  return setupResult.then((resolvedResult) => {
10137
- handleSetupResult(instance, resolvedResult, isSSR);
10172
+ setInSSRSetupState(true);
10173
+ try {
10174
+ handleSetupResult(instance, resolvedResult, isSSR);
10175
+ } finally {
10176
+ setInSSRSetupState(false);
10177
+ }
10138
10178
  }).catch((e) => {
10139
10179
  handleError(e, instance, 0);
10140
10180
  });
@@ -10324,7 +10364,7 @@ function isMemoSame(cached, memo) {
10324
10364
  return true;
10325
10365
  }
10326
10366
 
10327
- const version = "3.5.39";
10367
+ const version = "3.5.41";
10328
10368
  const warn$1 = NOOP;
10329
10369
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10330
10370
  const devtools = void 0;
@@ -11276,7 +11316,9 @@ class VueElement extends BaseClass {
11276
11316
  if (parent && parent._pendingResolve) {
11277
11317
  this._pendingResolve = parent._pendingResolve.then(() => {
11278
11318
  this._pendingResolve = void 0;
11279
- this._resolveDef();
11319
+ if (this.isConnected) {
11320
+ return this._resolveDef();
11321
+ }
11280
11322
  });
11281
11323
  } else {
11282
11324
  this._resolveDef();
@@ -11326,7 +11368,7 @@ class VueElement extends BaseClass {
11326
11368
  */
11327
11369
  _resolveDef() {
11328
11370
  if (this._pendingResolve) {
11329
- return;
11371
+ return this._pendingResolve;
11330
11372
  }
11331
11373
  for (let i = 0; i < this.attributes.length; i++) {
11332
11374
  this._setAttr(this.attributes[i].name);
@@ -11362,6 +11404,7 @@ class VueElement extends BaseClass {
11362
11404
  def.configureApp = this._def.configureApp;
11363
11405
  resolve(this._def = def, true);
11364
11406
  });
11407
+ return this._pendingResolve;
11365
11408
  } else {
11366
11409
  resolve(this._def);
11367
11410
  }
@@ -11835,6 +11878,7 @@ function onCompositionEnd(e) {
11835
11878
  }
11836
11879
  }
11837
11880
  const assignKey = /* @__PURE__ */ Symbol("_assign");
11881
+ const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
11838
11882
  function castValue(value, trim, number) {
11839
11883
  if (trim) value = value.trim();
11840
11884
  if (number) value = looseToNumber(value);
@@ -11842,6 +11886,13 @@ function castValue(value, trim, number) {
11842
11886
  }
11843
11887
  const vModelText = {
11844
11888
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
11889
+ if (el.parentNode) {
11890
+ if (el.type === "text") {
11891
+ el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
11892
+ } else if (el.type === "textarea") {
11893
+ el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
11894
+ }
11895
+ }
11845
11896
  el[assignKey] = getModelAssigner(vnode);
11846
11897
  const castToNumber = number || vnode.props && vnode.props.type === "number";
11847
11898
  addEventListener(el, lazy ? "change" : "input", (e) => {
@@ -11860,8 +11911,15 @@ const vModelText = {
11860
11911
  }
11861
11912
  },
11862
11913
  // set value on mounted so it's after min/max for type="range"
11863
- mounted(el, { value }) {
11864
- el.value = value == null ? "" : value;
11914
+ mounted(el, { value, modifiers: { trim, number } }) {
11915
+ const newValue = value == null ? "" : value;
11916
+ const initialValue = el[initialValueKey];
11917
+ delete el[initialValueKey];
11918
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
11919
+ el[assignKey](castValue(el.value, trim, number));
11920
+ } else {
11921
+ el.value = newValue;
11922
+ }
11865
11923
  },
11866
11924
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
11867
11925
  el[assignKey] = getModelAssigner(vnode);
@@ -11957,13 +12015,13 @@ const vModelSelect = {
11957
12015
  // <select multiple> value need to be deep traversed
11958
12016
  deep: true,
11959
12017
  created(el, { value, modifiers: { number } }, vnode) {
11960
- const isSetModel = isSet(value);
12018
+ el._modelValue = value;
11961
12019
  addEventListener(el, "change", () => {
11962
12020
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
11963
12021
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
11964
12022
  );
11965
12023
  el[assignKey](
11966
- el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
12024
+ el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]
11967
12025
  );
11968
12026
  el._assigning = true;
11969
12027
  nextTick(() => {
@@ -11977,7 +12035,8 @@ const vModelSelect = {
11977
12035
  mounted(el, { value }) {
11978
12036
  setSelected(el, value);
11979
12037
  },
11980
- beforeUpdate(el, _binding, vnode) {
12038
+ beforeUpdate(el, { value }, vnode) {
12039
+ el._modelValue = value;
11981
12040
  el[assignKey] = getModelAssigner(vnode);
11982
12041
  },
11983
12042
  updated(el, { value }) {
@@ -14216,6 +14275,9 @@ function getUnnormalizedProps(props, callPath = []) {
14216
14275
  return [props, callPath];
14217
14276
  }
14218
14277
  function injectProp(node, prop, context) {
14278
+ if (node.type !== 13 && injectSlotKey(node, prop)) {
14279
+ return;
14280
+ }
14219
14281
  let propsWithInjection;
14220
14282
  let props = node.type === 13 ? node.props : node.arguments[2];
14221
14283
  let callPath = [];
@@ -14273,6 +14335,24 @@ function injectProp(node, prop, context) {
14273
14335
  }
14274
14336
  }
14275
14337
  }
14338
+ function injectSlotKey(node, prop) {
14339
+ var _a, _b, _c;
14340
+ if (prop.key.type !== 4 || prop.key.content !== "key") {
14341
+ return false;
14342
+ }
14343
+ const props = node.arguments[2];
14344
+ if (props && !isString(props)) {
14345
+ const [unnormalizedProps] = getUnnormalizedProps(props);
14346
+ if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) {
14347
+ return true;
14348
+ }
14349
+ }
14350
+ (_a = node.arguments)[2] || (_a[2] = "{}");
14351
+ (_b = node.arguments)[3] || (_b[3] = "undefined");
14352
+ (_c = node.arguments)[4] || (_c[4] = "undefined");
14353
+ node.arguments[5] = prop.value;
14354
+ return true;
14355
+ }
14276
14356
  function hasProp(prop, props) {
14277
14357
  let result = false;
14278
14358
  if (prop.key.type === 4) {
@@ -16916,6 +16996,7 @@ const transformFor = createStructuralDirectiveTransform(
16916
16996
  node.loc
16917
16997
  );
16918
16998
  return () => {
16999
+ var _a;
16919
17000
  let childBlock;
16920
17001
  const { children } = forNode;
16921
17002
  if (isTemplate) {
@@ -16959,7 +17040,8 @@ const transformFor = createStructuralDirectiveTransform(
16959
17040
  if (isTemplate && keyProperty) {
16960
17041
  injectProp(childBlock, keyProperty, context);
16961
17042
  }
16962
- if (childBlock.isBlock !== !isStableFragment) {
17043
+ const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
17044
+ if (childBlock.isBlock !== shouldUseBlock) {
16963
17045
  if (childBlock.isBlock) {
16964
17046
  removeHelper(OPEN_BLOCK);
16965
17047
  removeHelper(
@@ -16971,12 +17053,15 @@ const transformFor = createStructuralDirectiveTransform(
16971
17053
  );
16972
17054
  }
16973
17055
  }
16974
- childBlock.isBlock = !isStableFragment;
17056
+ childBlock.isBlock = shouldUseBlock;
16975
17057
  if (childBlock.isBlock) {
16976
17058
  helper(OPEN_BLOCK);
16977
17059
  helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
16978
17060
  } else {
16979
17061
  helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
17062
+ if (childBlock.needsPatch) {
17063
+ childBlock.patchFlag = ((_a = childBlock.patchFlag) != null ? _a : 0) | 512;
17064
+ }
16980
17065
  }
16981
17066
  }
16982
17067
  if (memo) {
@@ -17398,6 +17483,8 @@ const transformElement = (node, context) => {
17398
17483
  let vnodeDynamicProps;
17399
17484
  let dynamicPropNames;
17400
17485
  let vnodeDirectives;
17486
+ let needsPatch = false;
17487
+ let isBlockRequired = false;
17401
17488
  let shouldUseBlock = (
17402
17489
  // dynamic component may resolve to plain elements
17403
17490
  isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
@@ -17417,6 +17504,8 @@ const transformElement = (node, context) => {
17417
17504
  vnodeProps = propsBuildResult.props;
17418
17505
  patchFlag = propsBuildResult.patchFlag;
17419
17506
  dynamicPropNames = propsBuildResult.dynamicPropNames;
17507
+ needsPatch = propsBuildResult.needsPatch;
17508
+ isBlockRequired = propsBuildResult.isBlockRequired;
17420
17509
  const directives = propsBuildResult.directives;
17421
17510
  vnodeDirectives = directives && directives.length ? createArrayExpression(
17422
17511
  directives.map((dir) => buildDirectiveArgs(dir, context))
@@ -17458,7 +17547,7 @@ const transformElement = (node, context) => {
17458
17547
  if (dynamicPropNames && dynamicPropNames.length) {
17459
17548
  vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
17460
17549
  }
17461
- node.codegenNode = createVNodeCall(
17550
+ const vnodeCall = node.codegenNode = createVNodeCall(
17462
17551
  context,
17463
17552
  vnodeTag,
17464
17553
  vnodeProps,
@@ -17471,6 +17560,13 @@ const transformElement = (node, context) => {
17471
17560
  isComponent,
17472
17561
  node.loc
17473
17562
  );
17563
+ needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
17564
+ if (needsPatch) {
17565
+ vnodeCall.needsPatch = true;
17566
+ }
17567
+ if (isBlockRequired) {
17568
+ vnodeCall.isBlockRequired = true;
17569
+ }
17474
17570
  };
17475
17571
  };
17476
17572
  function resolveComponentType(node, context, ssr = false) {
@@ -17580,6 +17676,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17580
17676
  const runtimeDirectives = [];
17581
17677
  const hasChildren = children.length > 0;
17582
17678
  let shouldUseBlock = false;
17679
+ let isBlockRequired = false;
17583
17680
  let patchFlag = 0;
17584
17681
  let hasRef = false;
17585
17682
  let hasClassBinding = false;
@@ -17621,19 +17718,20 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17621
17718
  if (isEventHandler && isReservedProp(name)) {
17622
17719
  hasVnodeHook = true;
17623
17720
  }
17721
+ if (name === "ref") {
17722
+ hasRef = true;
17723
+ }
17624
17724
  if (isEventHandler && value.type === 14) {
17625
17725
  value = value.arguments[0];
17626
17726
  }
17627
17727
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
17628
17728
  return;
17629
17729
  }
17630
- if (name === "ref") {
17631
- hasRef = true;
17632
- } else if (name === "class") {
17730
+ if (name === "class") {
17633
17731
  hasClassBinding = true;
17634
17732
  } else if (name === "style") {
17635
17733
  hasStyleBinding = true;
17636
- } else if (name !== "key" && !dynamicPropNames.includes(name)) {
17734
+ } else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) {
17637
17735
  dynamicPropNames.push(name);
17638
17736
  }
17639
17737
  if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
@@ -17704,14 +17802,13 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17704
17802
  if (isVOn && ssr) {
17705
17803
  continue;
17706
17804
  }
17707
- if (
17708
- // #938: elements with dynamic keys should be forced into blocks
17709
- isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked
17710
- // before children
17711
- isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
17712
- ) {
17805
+ if (isVBind && isStaticArgOf(arg, "key")) {
17713
17806
  shouldUseBlock = true;
17714
17807
  }
17808
+ if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
17809
+ shouldUseBlock = true;
17810
+ isBlockRequired = true;
17811
+ }
17715
17812
  if (isVBind && isStaticArgOf(arg, "ref")) {
17716
17813
  pushRefVForMarker();
17717
17814
  }
@@ -17772,6 +17869,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17772
17869
  runtimeDirectives.push(prop);
17773
17870
  if (hasChildren) {
17774
17871
  shouldUseBlock = true;
17872
+ isBlockRequired = true;
17775
17873
  }
17776
17874
  }
17777
17875
  }
@@ -17810,7 +17908,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17810
17908
  patchFlag |= 32;
17811
17909
  }
17812
17910
  }
17813
- if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
17911
+ const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
17912
+ if (!shouldUseBlock && needsPatch) {
17814
17913
  patchFlag |= 512;
17815
17914
  }
17816
17915
  if (!context.inSSR && propsExpression) {
@@ -17876,7 +17975,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17876
17975
  directives: runtimeDirectives,
17877
17976
  patchFlag,
17878
17977
  dynamicPropNames,
17879
- shouldUseBlock
17978
+ shouldUseBlock,
17979
+ needsPatch,
17980
+ isBlockRequired
17880
17981
  };
17881
17982
  }
17882
17983
  function dedupeProperties(properties) {
@@ -19181,12 +19282,15 @@ function stringifyElement(node, context) {
19181
19282
  res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
19182
19283
  continue;
19183
19284
  }
19184
- if (isBooleanAttr(p.arg.content) && exp.content === "false") {
19285
+ if ((isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && exp.content === "false") {
19185
19286
  continue;
19186
19287
  }
19187
19288
  let evaluated = evaluateConstant(exp);
19188
19289
  if (evaluated != null) {
19189
19290
  const arg = p.arg && p.arg.content;
19291
+ if (arg === "hidden" && typeof evaluated === "number" && !includeBooleanAttr(evaluated)) {
19292
+ continue;
19293
+ }
19190
19294
  if (arg === "class") {
19191
19295
  evaluated = normalizeClass(evaluated);
19192
19296
  } else if (arg === "style") {