@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
  **/
@@ -194,7 +194,7 @@ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
194
194
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
195
195
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
196
196
  const isBooleanAttr = /* @__PURE__ */ makeMap(
197
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
197
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
198
198
  );
199
199
  function includeBooleanAttr(value) {
200
200
  return !!value || value === "";
@@ -2597,7 +2597,9 @@ function queuePostFlushCb(cb) {
2597
2597
  cb.flags |= 1;
2598
2598
  }
2599
2599
  } else {
2600
- pendingPostFlushCbs.push(...cb);
2600
+ for (let i = 0; i < cb.length; i++) {
2601
+ pendingPostFlushCbs.push(cb[i]);
2602
+ }
2601
2603
  }
2602
2604
  queueFlush();
2603
2605
  }
@@ -2633,7 +2635,9 @@ function flushPostFlushCbs(seen) {
2633
2635
  );
2634
2636
  pendingPostFlushCbs.length = 0;
2635
2637
  if (activePostFlushCbs) {
2636
- activePostFlushCbs.push(...deduped);
2638
+ for (let i = 0; i < deduped.length; i++) {
2639
+ activePostFlushCbs.push(deduped[i]);
2640
+ }
2637
2641
  return;
2638
2642
  }
2639
2643
  activePostFlushCbs = deduped;
@@ -4394,7 +4398,11 @@ function getInnerChild$1(vnode) {
4394
4398
  function setTransitionHooks(vnode, hooks) {
4395
4399
  if (vnode.shapeFlag & 6 && vnode.component) {
4396
4400
  vnode.transition = hooks;
4397
- setTransitionHooks(vnode.component.subTree, hooks);
4401
+ const subTree = vnode.component.subTree;
4402
+ setTransitionHooks(
4403
+ isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
4404
+ hooks
4405
+ );
4398
4406
  } else if (vnode.shapeFlag & 128) {
4399
4407
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4400
4408
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -4934,6 +4942,9 @@ Server rendered element contains more child nodes than client vdom.`
4934
4942
  }
4935
4943
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4936
4944
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4945
+ if (isUnchangedResourceProp(el, key, props[key])) {
4946
+ continue;
4947
+ }
4937
4948
  patchProp(el, key, null, props[key], namespace, parentComponent);
4938
4949
  }
4939
4950
  }
@@ -5116,6 +5127,13 @@ Server rendered element contains fewer child nodes than client vdom.`
5116
5127
  };
5117
5128
  return [hydrate, hydrateNode];
5118
5129
  }
5130
+ const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
5131
+ function isUnchangedResourceProp(el, key, clientValue) {
5132
+ if (!resourceProps.has(key)) {
5133
+ return false;
5134
+ }
5135
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
5136
+ }
5119
5137
  function propHasMismatch(el, key, clientValue, vnode, instance) {
5120
5138
  let mismatchType;
5121
5139
  let mismatchKey;
@@ -5153,7 +5171,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
5153
5171
  mismatchKey = "style";
5154
5172
  }
5155
5173
  } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
5156
- if (isBooleanAttr(key)) {
5174
+ if (key === "hidden") {
5175
+ actual = normalizeHiddenValue(el.getAttribute(key));
5176
+ expected = normalizeHiddenValue(clientValue);
5177
+ } else if (isBooleanAttr(key)) {
5157
5178
  actual = el.hasAttribute(key);
5158
5179
  expected = includeBooleanAttr(clientValue);
5159
5180
  } else if (clientValue == null) {
@@ -5189,6 +5210,15 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
5189
5210
  }
5190
5211
  return false;
5191
5212
  }
5213
+ function normalizeHiddenValue(value) {
5214
+ if (!isRenderableAttrValue(value)) {
5215
+ return false;
5216
+ }
5217
+ if (isString(value)) {
5218
+ return value.toLowerCase() === "until-found" ? "until-found" : "";
5219
+ }
5220
+ return includeBooleanAttr(value) ? "" : false;
5221
+ }
5192
5222
  function toClassSet(str) {
5193
5223
  return new Set(str.trim().split(/\s+/));
5194
5224
  }
@@ -6299,7 +6329,8 @@ function createSlots(slots, dynamicSlots) {
6299
6329
  return slots;
6300
6330
  }
6301
6331
 
6302
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
6332
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
6333
+ if (props == null) props = {};
6303
6334
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
6304
6335
  const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
6305
6336
  const hasProps = Object.keys(slotProps).length > 0;
@@ -7526,7 +7557,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7526
7557
  return vm;
7527
7558
  }
7528
7559
  }
7529
- Vue.version = `2.6.14-compat:${"3.5.40"}`;
7560
+ Vue.version = `2.6.14-compat:${"3.5.41"}`;
7530
7561
  Vue.config = singletonApp.config;
7531
7562
  Vue.use = (plugin, ...options) => {
7532
7563
  if (plugin && isFunction(plugin.install)) {
@@ -8548,12 +8579,13 @@ function renderComponentRoot(instance) {
8548
8579
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
8549
8580
  }
8550
8581
  if (vnode.transition) {
8551
- if (!isElementRoot(root)) {
8582
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
8583
+ if (!isElementRoot(child)) {
8552
8584
  warn$1(
8553
8585
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8554
8586
  );
8555
8587
  }
8556
- setTransitionHooks(root, vnode.transition);
8588
+ setTransitionHooks(child, vnode.transition);
8557
8589
  }
8558
8590
  if (setRoot) {
8559
8591
  setRoot(root);
@@ -11307,7 +11339,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11307
11339
  let hasUnresolvedAncestor = false;
11308
11340
  while (parent) {
11309
11341
  if (parent.pendingBranch) {
11310
- parent.effects.push(...effects);
11342
+ for (let i = 0; i < effects.length; i++) {
11343
+ parent.effects.push(effects[i]);
11344
+ }
11311
11345
  hasUnresolvedAncestor = true;
11312
11346
  break;
11313
11347
  }
@@ -11729,6 +11763,14 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
11729
11763
  if (vnode.key !== vnode.key) {
11730
11764
  warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
11731
11765
  }
11766
+ if (props && vnode.shapeFlag & 1) {
11767
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
11768
+ if (overwritingProp && hasContentChildren(vnode.children)) {
11769
+ warn$1(
11770
+ `The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`
11771
+ );
11772
+ }
11773
+ }
11732
11774
  if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
11733
11775
  !isBlockNode && // has current parent block
11734
11776
  currentBlock && // presence of a patch flag indicates this node needs patching on updates.
@@ -11746,6 +11788,11 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
11746
11788
  }
11747
11789
  return vnode;
11748
11790
  }
11791
+ function hasContentChildren(children) {
11792
+ if (isString(children)) return children !== "";
11793
+ if (isArray(children)) return children.length > 0;
11794
+ return false;
11795
+ }
11749
11796
  const createVNode = createVNodeWithArgsTransform ;
11750
11797
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
11751
11798
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -12200,7 +12247,12 @@ function setupStatefulComponent(instance, isSSR) {
12200
12247
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
12201
12248
  if (isSSR) {
12202
12249
  return setupResult.then((resolvedResult) => {
12203
- handleSetupResult(instance, resolvedResult, isSSR);
12250
+ setInSSRSetupState(true);
12251
+ try {
12252
+ handleSetupResult(instance, resolvedResult, isSSR);
12253
+ } finally {
12254
+ setInSSRSetupState(false);
12255
+ }
12204
12256
  }).catch((e) => {
12205
12257
  handleError(e, instance, 0);
12206
12258
  });
@@ -12678,7 +12730,7 @@ function isMemoSame(cached, memo) {
12678
12730
  return true;
12679
12731
  }
12680
12732
 
12681
- const version = "3.5.40";
12733
+ const version = "3.5.41";
12682
12734
  const warn = warn$1 ;
12683
12735
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12684
12736
  const devtools = devtools$1 ;
@@ -13736,7 +13788,9 @@ class VueElement extends BaseClass {
13736
13788
  if (parent && parent._pendingResolve) {
13737
13789
  this._pendingResolve = parent._pendingResolve.then(() => {
13738
13790
  this._pendingResolve = void 0;
13739
- this._resolveDef();
13791
+ if (this.isConnected) {
13792
+ return this._resolveDef();
13793
+ }
13740
13794
  });
13741
13795
  } else {
13742
13796
  this._resolveDef();
@@ -13786,7 +13840,7 @@ class VueElement extends BaseClass {
13786
13840
  */
13787
13841
  _resolveDef() {
13788
13842
  if (this._pendingResolve) {
13789
- return;
13843
+ return this._pendingResolve;
13790
13844
  }
13791
13845
  for (let i = 0; i < this.attributes.length; i++) {
13792
13846
  this._setAttr(this.attributes[i].name);
@@ -13826,6 +13880,7 @@ class VueElement extends BaseClass {
13826
13880
  def.configureApp = this._def.configureApp;
13827
13881
  resolve(this._def = def, true);
13828
13882
  });
13883
+ return this._pendingResolve;
13829
13884
  } else {
13830
13885
  resolve(this._def);
13831
13886
  }
@@ -13863,6 +13918,11 @@ class VueElement extends BaseClass {
13863
13918
  }
13864
13919
  }
13865
13920
  for (const key of declaredPropKeys.map(camelize)) {
13921
+ if (key in Object.getPrototypeOf(this)) {
13922
+ warn(
13923
+ `Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`
13924
+ );
13925
+ }
13866
13926
  Object.defineProperty(this, key, {
13867
13927
  get() {
13868
13928
  return this._getProp(key);
@@ -14356,6 +14416,7 @@ function onCompositionEnd(e) {
14356
14416
  }
14357
14417
  }
14358
14418
  const assignKey = /* @__PURE__ */ Symbol("_assign");
14419
+ const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
14359
14420
  function castValue(value, trim, number) {
14360
14421
  if (trim) value = value.trim();
14361
14422
  if (number) value = looseToNumber(value);
@@ -14363,6 +14424,13 @@ function castValue(value, trim, number) {
14363
14424
  }
14364
14425
  const vModelText = {
14365
14426
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
14427
+ if (el.parentNode) {
14428
+ if (el.type === "text") {
14429
+ el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
14430
+ } else if (el.type === "textarea") {
14431
+ el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
14432
+ }
14433
+ }
14366
14434
  el[assignKey] = getModelAssigner(vnode);
14367
14435
  const castToNumber = number || vnode.props && vnode.props.type === "number";
14368
14436
  addEventListener(el, lazy ? "change" : "input", (e) => {
@@ -14381,8 +14449,15 @@ const vModelText = {
14381
14449
  }
14382
14450
  },
14383
14451
  // set value on mounted so it's after min/max for type="range"
14384
- mounted(el, { value }) {
14385
- el.value = value == null ? "" : value;
14452
+ mounted(el, { value, modifiers: { trim, number } }) {
14453
+ const newValue = value == null ? "" : value;
14454
+ const initialValue = el[initialValueKey];
14455
+ delete el[initialValueKey];
14456
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
14457
+ el[assignKey](castValue(el.value, trim, number));
14458
+ } else {
14459
+ el.value = newValue;
14460
+ }
14386
14461
  },
14387
14462
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
14388
14463
  el[assignKey] = getModelAssigner(vnode);