@vue/compat 3.5.40 → 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.40
2
+ * @vue/compat v3.5.41
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -270,7 +270,7 @@ var Vue = (function () {
270
270
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
271
271
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
272
272
  const isBooleanAttr = /* @__PURE__ */ makeMap(
273
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
273
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
274
274
  );
275
275
  function includeBooleanAttr(value) {
276
276
  return !!value || value === "";
@@ -2673,7 +2673,9 @@ var Vue = (function () {
2673
2673
  cb.flags |= 1;
2674
2674
  }
2675
2675
  } else {
2676
- pendingPostFlushCbs.push(...cb);
2676
+ for (let i = 0; i < cb.length; i++) {
2677
+ pendingPostFlushCbs.push(cb[i]);
2678
+ }
2677
2679
  }
2678
2680
  queueFlush();
2679
2681
  }
@@ -2709,7 +2711,9 @@ var Vue = (function () {
2709
2711
  );
2710
2712
  pendingPostFlushCbs.length = 0;
2711
2713
  if (activePostFlushCbs) {
2712
- activePostFlushCbs.push(...deduped);
2714
+ for (let i = 0; i < deduped.length; i++) {
2715
+ activePostFlushCbs.push(deduped[i]);
2716
+ }
2713
2717
  return;
2714
2718
  }
2715
2719
  activePostFlushCbs = deduped;
@@ -4442,7 +4446,11 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4442
4446
  function setTransitionHooks(vnode, hooks) {
4443
4447
  if (vnode.shapeFlag & 6 && vnode.component) {
4444
4448
  vnode.transition = hooks;
4445
- setTransitionHooks(vnode.component.subTree, hooks);
4449
+ const subTree = vnode.component.subTree;
4450
+ setTransitionHooks(
4451
+ isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
4452
+ hooks
4453
+ );
4446
4454
  } else if (vnode.shapeFlag & 128) {
4447
4455
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4448
4456
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -4982,6 +4990,9 @@ Server rendered element contains more child nodes than client vdom.`
4982
4990
  }
4983
4991
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4984
4992
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4993
+ if (isUnchangedResourceProp(el, key, props[key])) {
4994
+ continue;
4995
+ }
4985
4996
  patchProp(el, key, null, props[key], namespace, parentComponent);
4986
4997
  }
4987
4998
  }
@@ -5164,6 +5175,13 @@ Server rendered element contains fewer child nodes than client vdom.`
5164
5175
  };
5165
5176
  return [hydrate, hydrateNode];
5166
5177
  }
5178
+ const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
5179
+ function isUnchangedResourceProp(el, key, clientValue) {
5180
+ if (!resourceProps.has(key)) {
5181
+ return false;
5182
+ }
5183
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
5184
+ }
5167
5185
  function propHasMismatch(el, key, clientValue, vnode, instance) {
5168
5186
  let mismatchType;
5169
5187
  let mismatchKey;
@@ -5201,7 +5219,10 @@ Server rendered element contains fewer child nodes than client vdom.`
5201
5219
  mismatchKey = "style";
5202
5220
  }
5203
5221
  } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
5204
- if (isBooleanAttr(key)) {
5222
+ if (key === "hidden") {
5223
+ actual = normalizeHiddenValue(el.getAttribute(key));
5224
+ expected = normalizeHiddenValue(clientValue);
5225
+ } else if (isBooleanAttr(key)) {
5205
5226
  actual = el.hasAttribute(key);
5206
5227
  expected = includeBooleanAttr(clientValue);
5207
5228
  } else if (clientValue == null) {
@@ -5237,6 +5258,15 @@ Server rendered element contains fewer child nodes than client vdom.`
5237
5258
  }
5238
5259
  return false;
5239
5260
  }
5261
+ function normalizeHiddenValue(value) {
5262
+ if (!isRenderableAttrValue(value)) {
5263
+ return false;
5264
+ }
5265
+ if (isString(value)) {
5266
+ return value.toLowerCase() === "until-found" ? "until-found" : "";
5267
+ }
5268
+ return includeBooleanAttr(value) ? "" : false;
5269
+ }
5240
5270
  function toClassSet(str) {
5241
5271
  return new Set(str.trim().split(/\s+/));
5242
5272
  }
@@ -6341,7 +6371,8 @@ If this is a native custom element, make sure to exclude it from component resol
6341
6371
  return slots;
6342
6372
  }
6343
6373
 
6344
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
6374
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
6375
+ if (props == null) props = {};
6345
6376
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
6346
6377
  const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
6347
6378
  const hasProps = Object.keys(slotProps).length > 0;
@@ -7565,7 +7596,7 @@ If this is a native custom element, make sure to exclude it from component resol
7565
7596
  return vm;
7566
7597
  }
7567
7598
  }
7568
- Vue.version = `2.6.14-compat:${"3.5.40"}`;
7599
+ Vue.version = `2.6.14-compat:${"3.5.41"}`;
7569
7600
  Vue.config = singletonApp.config;
7570
7601
  Vue.use = (plugin, ...options) => {
7571
7602
  if (plugin && isFunction(plugin.install)) {
@@ -8587,12 +8618,13 @@ If you want to remount the same app, move your app creation logic into a factory
8587
8618
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
8588
8619
  }
8589
8620
  if (vnode.transition) {
8590
- if (!isElementRoot(root)) {
8621
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
8622
+ if (!isElementRoot(child)) {
8591
8623
  warn$1(
8592
8624
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8593
8625
  );
8594
8626
  }
8595
- setTransitionHooks(root, vnode.transition);
8627
+ setTransitionHooks(child, vnode.transition);
8596
8628
  }
8597
8629
  if (setRoot) {
8598
8630
  setRoot(root);
@@ -11346,7 +11378,9 @@ If you want to remount the same app, move your app creation logic into a factory
11346
11378
  let hasUnresolvedAncestor = false;
11347
11379
  while (parent) {
11348
11380
  if (parent.pendingBranch) {
11349
- parent.effects.push(...effects);
11381
+ for (let i = 0; i < effects.length; i++) {
11382
+ parent.effects.push(effects[i]);
11383
+ }
11350
11384
  hasUnresolvedAncestor = true;
11351
11385
  break;
11352
11386
  }
@@ -11768,6 +11802,14 @@ If you want to remount the same app, move your app creation logic into a factory
11768
11802
  if (vnode.key !== vnode.key) {
11769
11803
  warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
11770
11804
  }
11805
+ if (props && vnode.shapeFlag & 1) {
11806
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
11807
+ if (overwritingProp && hasContentChildren(vnode.children)) {
11808
+ warn$1(
11809
+ `The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`
11810
+ );
11811
+ }
11812
+ }
11771
11813
  if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
11772
11814
  !isBlockNode && // has current parent block
11773
11815
  currentBlock && // presence of a patch flag indicates this node needs patching on updates.
@@ -11785,6 +11827,11 @@ If you want to remount the same app, move your app creation logic into a factory
11785
11827
  }
11786
11828
  return vnode;
11787
11829
  }
11830
+ function hasContentChildren(children) {
11831
+ if (isString(children)) return children !== "";
11832
+ if (isArray(children)) return children.length > 0;
11833
+ return false;
11834
+ }
11788
11835
  const createVNode = createVNodeWithArgsTransform ;
11789
11836
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
11790
11837
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -12227,7 +12274,12 @@ Component that was made reactive: `,
12227
12274
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
12228
12275
  if (isSSR) {
12229
12276
  return setupResult.then((resolvedResult) => {
12230
- handleSetupResult(instance, resolvedResult, isSSR);
12277
+ setInSSRSetupState(true);
12278
+ try {
12279
+ handleSetupResult(instance, resolvedResult, isSSR);
12280
+ } finally {
12281
+ setInSSRSetupState(false);
12282
+ }
12231
12283
  }).catch((e) => {
12232
12284
  handleError(e, instance, 0);
12233
12285
  });
@@ -12703,7 +12755,7 @@ Component that was made reactive: `,
12703
12755
  return true;
12704
12756
  }
12705
12757
 
12706
- const version = "3.5.40";
12758
+ const version = "3.5.41";
12707
12759
  const warn = warn$1 ;
12708
12760
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12709
12761
  const devtools = devtools$1 ;
@@ -13742,7 +13794,9 @@ Expected function or array of functions, received type ${typeof value}.`
13742
13794
  if (parent && parent._pendingResolve) {
13743
13795
  this._pendingResolve = parent._pendingResolve.then(() => {
13744
13796
  this._pendingResolve = void 0;
13745
- this._resolveDef();
13797
+ if (this.isConnected) {
13798
+ return this._resolveDef();
13799
+ }
13746
13800
  });
13747
13801
  } else {
13748
13802
  this._resolveDef();
@@ -13792,7 +13846,7 @@ Expected function or array of functions, received type ${typeof value}.`
13792
13846
  */
13793
13847
  _resolveDef() {
13794
13848
  if (this._pendingResolve) {
13795
- return;
13849
+ return this._pendingResolve;
13796
13850
  }
13797
13851
  for (let i = 0; i < this.attributes.length; i++) {
13798
13852
  this._setAttr(this.attributes[i].name);
@@ -13832,6 +13886,7 @@ Expected function or array of functions, received type ${typeof value}.`
13832
13886
  def.configureApp = this._def.configureApp;
13833
13887
  resolve(this._def = def, true);
13834
13888
  });
13889
+ return this._pendingResolve;
13835
13890
  } else {
13836
13891
  resolve(this._def);
13837
13892
  }
@@ -13869,6 +13924,11 @@ Expected function or array of functions, received type ${typeof value}.`
13869
13924
  }
13870
13925
  }
13871
13926
  for (const key of declaredPropKeys.map(camelize)) {
13927
+ if (key in Object.getPrototypeOf(this)) {
13928
+ warn(
13929
+ `Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`
13930
+ );
13931
+ }
13872
13932
  Object.defineProperty(this, key, {
13873
13933
  get() {
13874
13934
  return this._getProp(key);
@@ -14350,6 +14410,7 @@ Expected function or array of functions, received type ${typeof value}.`
14350
14410
  }
14351
14411
  }
14352
14412
  const assignKey = /* @__PURE__ */ Symbol("_assign");
14413
+ const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
14353
14414
  function castValue(value, trim, number) {
14354
14415
  if (trim) value = value.trim();
14355
14416
  if (number) value = looseToNumber(value);
@@ -14357,6 +14418,13 @@ Expected function or array of functions, received type ${typeof value}.`
14357
14418
  }
14358
14419
  const vModelText = {
14359
14420
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
14421
+ if (el.parentNode) {
14422
+ if (el.type === "text") {
14423
+ el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
14424
+ } else if (el.type === "textarea") {
14425
+ el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
14426
+ }
14427
+ }
14360
14428
  el[assignKey] = getModelAssigner(vnode);
14361
14429
  const castToNumber = number || vnode.props && vnode.props.type === "number";
14362
14430
  addEventListener(el, lazy ? "change" : "input", (e) => {
@@ -14375,8 +14443,15 @@ Expected function or array of functions, received type ${typeof value}.`
14375
14443
  }
14376
14444
  },
14377
14445
  // set value on mounted so it's after min/max for type="range"
14378
- mounted(el, { value }) {
14379
- el.value = value == null ? "" : value;
14446
+ mounted(el, { value, modifiers: { trim, number } }) {
14447
+ const newValue = value == null ? "" : value;
14448
+ const initialValue = el[initialValueKey];
14449
+ delete el[initialValueKey];
14450
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
14451
+ el[assignKey](castValue(el.value, trim, number));
14452
+ } else {
14453
+ el.value = newValue;
14454
+ }
14380
14455
  },
14381
14456
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
14382
14457
  el[assignKey] = getModelAssigner(vnode);
@@ -18735,6 +18810,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
18735
18810
  node.loc
18736
18811
  );
18737
18812
  return () => {
18813
+ var _a;
18738
18814
  let childBlock;
18739
18815
  const { children } = forNode;
18740
18816
  if (isTemplate) {
@@ -18778,7 +18854,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
18778
18854
  if (isTemplate && keyProperty) {
18779
18855
  injectProp(childBlock, keyProperty, context);
18780
18856
  }
18781
- if (childBlock.isBlock !== !isStableFragment) {
18857
+ const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
18858
+ if (childBlock.isBlock !== shouldUseBlock) {
18782
18859
  if (childBlock.isBlock) {
18783
18860
  removeHelper(OPEN_BLOCK);
18784
18861
  removeHelper(
@@ -18790,12 +18867,15 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
18790
18867
  );
18791
18868
  }
18792
18869
  }
18793
- childBlock.isBlock = !isStableFragment;
18870
+ childBlock.isBlock = shouldUseBlock;
18794
18871
  if (childBlock.isBlock) {
18795
18872
  helper(OPEN_BLOCK);
18796
18873
  helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
18797
18874
  } else {
18798
18875
  helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
18876
+ if (childBlock.needsPatch) {
18877
+ childBlock.patchFlag = ((_a = childBlock.patchFlag) != null ? _a : 0) | 512;
18878
+ }
18799
18879
  }
18800
18880
  }
18801
18881
  if (memo) {
@@ -19174,6 +19254,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19174
19254
  let vnodeDynamicProps;
19175
19255
  let dynamicPropNames;
19176
19256
  let vnodeDirectives;
19257
+ let needsPatch = false;
19258
+ let isBlockRequired = false;
19177
19259
  let shouldUseBlock = (
19178
19260
  // dynamic component may resolve to plain elements
19179
19261
  isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
@@ -19193,6 +19275,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19193
19275
  vnodeProps = propsBuildResult.props;
19194
19276
  patchFlag = propsBuildResult.patchFlag;
19195
19277
  dynamicPropNames = propsBuildResult.dynamicPropNames;
19278
+ needsPatch = propsBuildResult.needsPatch;
19279
+ isBlockRequired = propsBuildResult.isBlockRequired;
19196
19280
  const directives = propsBuildResult.directives;
19197
19281
  vnodeDirectives = directives && directives.length ? createArrayExpression(
19198
19282
  directives.map((dir) => buildDirectiveArgs(dir, context))
@@ -19243,7 +19327,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19243
19327
  if (dynamicPropNames && dynamicPropNames.length) {
19244
19328
  vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
19245
19329
  }
19246
- node.codegenNode = createVNodeCall(
19330
+ const vnodeCall = node.codegenNode = createVNodeCall(
19247
19331
  context,
19248
19332
  vnodeTag,
19249
19333
  vnodeProps,
@@ -19256,6 +19340,13 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19256
19340
  isComponent,
19257
19341
  node.loc
19258
19342
  );
19343
+ needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
19344
+ if (needsPatch) {
19345
+ vnodeCall.needsPatch = true;
19346
+ }
19347
+ if (isBlockRequired) {
19348
+ vnodeCall.isBlockRequired = true;
19349
+ }
19259
19350
  };
19260
19351
  };
19261
19352
  function resolveComponentType(node, context, ssr = false) {
@@ -19307,6 +19398,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19307
19398
  const runtimeDirectives = [];
19308
19399
  const hasChildren = children.length > 0;
19309
19400
  let shouldUseBlock = false;
19401
+ let isBlockRequired = false;
19310
19402
  let patchFlag = 0;
19311
19403
  let hasRef = false;
19312
19404
  let hasClassBinding = false;
@@ -19348,19 +19440,20 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19348
19440
  if (isEventHandler && isReservedProp(name)) {
19349
19441
  hasVnodeHook = true;
19350
19442
  }
19443
+ if (name === "ref") {
19444
+ hasRef = true;
19445
+ }
19351
19446
  if (isEventHandler && value.type === 14) {
19352
19447
  value = value.arguments[0];
19353
19448
  }
19354
19449
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
19355
19450
  return;
19356
19451
  }
19357
- if (name === "ref") {
19358
- hasRef = true;
19359
- } else if (name === "class") {
19452
+ if (name === "class") {
19360
19453
  hasClassBinding = true;
19361
19454
  } else if (name === "style") {
19362
19455
  hasStyleBinding = true;
19363
- } else if (name !== "key" && !dynamicPropNames.includes(name)) {
19456
+ } else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) {
19364
19457
  dynamicPropNames.push(name);
19365
19458
  }
19366
19459
  if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
@@ -19419,13 +19512,12 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19419
19512
  if (isVOn && ssr) {
19420
19513
  continue;
19421
19514
  }
19422
- if (
19423
- // #938: elements with dynamic keys should be forced into blocks
19424
- isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked
19425
- // before children
19426
- isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
19427
- ) {
19515
+ if (isVBind && isStaticArgOf(arg, "key")) {
19516
+ shouldUseBlock = true;
19517
+ }
19518
+ if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
19428
19519
  shouldUseBlock = true;
19520
+ isBlockRequired = true;
19429
19521
  }
19430
19522
  if (isVBind && isStaticArgOf(arg, "ref")) {
19431
19523
  pushRefVForMarker();
@@ -19508,6 +19600,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19508
19600
  runtimeDirectives.push(prop);
19509
19601
  if (hasChildren) {
19510
19602
  shouldUseBlock = true;
19603
+ isBlockRequired = true;
19511
19604
  }
19512
19605
  }
19513
19606
  }
@@ -19546,7 +19639,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19546
19639
  patchFlag |= 32;
19547
19640
  }
19548
19641
  }
19549
- if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
19642
+ const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
19643
+ if (!shouldUseBlock && needsPatch) {
19550
19644
  patchFlag |= 512;
19551
19645
  }
19552
19646
  if (!context.inSSR && propsExpression) {
@@ -19612,7 +19706,9 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19612
19706
  directives: runtimeDirectives,
19613
19707
  patchFlag,
19614
19708
  dynamicPropNames,
19615
- shouldUseBlock
19709
+ shouldUseBlock,
19710
+ needsPatch,
19711
+ isBlockRequired
19616
19712
  };
19617
19713
  }
19618
19714
  function dedupeProperties(properties) {