@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
  **/
@@ -197,7 +197,7 @@ var Vue = (function () {
197
197
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
198
198
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
199
199
  const isBooleanAttr = /* @__PURE__ */ makeMap(
200
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
200
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
201
201
  );
202
202
  function includeBooleanAttr(value) {
203
203
  return !!value || value === "";
@@ -379,8 +379,9 @@ var Vue = (function () {
379
379
  this._isPaused = true;
380
380
  let i, l;
381
381
  if (this.scopes) {
382
- for (i = 0, l = this.scopes.length; i < l; i++) {
383
- this.scopes[i].pause();
382
+ const scopes = this.scopes.slice();
383
+ for (i = 0, l = scopes.length; i < l; i++) {
384
+ scopes[i].pause();
384
385
  }
385
386
  }
386
387
  for (i = 0, l = this.effects.length; i < l; i++) {
@@ -397,12 +398,14 @@ var Vue = (function () {
397
398
  this._isPaused = false;
398
399
  let i, l;
399
400
  if (this.scopes) {
400
- for (i = 0, l = this.scopes.length; i < l; i++) {
401
- this.scopes[i].resume();
401
+ const scopes = this.scopes.slice();
402
+ for (i = 0, l = scopes.length; i < l; i++) {
403
+ scopes[i].resume();
402
404
  }
403
405
  }
404
- for (i = 0, l = this.effects.length; i < l; i++) {
405
- this.effects[i].resume();
406
+ const effects = this.effects.slice();
407
+ for (i = 0, l = effects.length; i < l; i++) {
408
+ effects[i].resume();
406
409
  }
407
410
  }
408
411
  }
@@ -464,8 +467,9 @@ var Vue = (function () {
464
467
  }
465
468
  this.cleanups.length = 0;
466
469
  if (this.scopes) {
467
- for (i = 0, l = this.scopes.length; i < l; i++) {
468
- this.scopes[i].stop(true);
470
+ const scopes = this.scopes.slice();
471
+ for (i = 0, l = scopes.length; i < l; i++) {
472
+ scopes[i].stop(true);
469
473
  }
470
474
  this.scopes.length = 0;
471
475
  }
@@ -2596,7 +2600,9 @@ var Vue = (function () {
2596
2600
  cb.flags |= 1;
2597
2601
  }
2598
2602
  } else {
2599
- pendingPostFlushCbs.push(...cb);
2603
+ for (let i = 0; i < cb.length; i++) {
2604
+ pendingPostFlushCbs.push(cb[i]);
2605
+ }
2600
2606
  }
2601
2607
  queueFlush();
2602
2608
  }
@@ -2632,7 +2638,9 @@ var Vue = (function () {
2632
2638
  );
2633
2639
  pendingPostFlushCbs.length = 0;
2634
2640
  if (activePostFlushCbs) {
2635
- activePostFlushCbs.push(...deduped);
2641
+ for (let i = 0; i < deduped.length; i++) {
2642
+ activePostFlushCbs.push(deduped[i]);
2643
+ }
2636
2644
  return;
2637
2645
  }
2638
2646
  activePostFlushCbs = deduped;
@@ -3387,10 +3395,12 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3387
3395
  setBlockTracking(-1);
3388
3396
  }
3389
3397
  const prevInstance = setCurrentRenderingInstance(ctx);
3398
+ const prevStackSize = blockStack.length;
3390
3399
  let res;
3391
3400
  try {
3392
3401
  res = fn(...args);
3393
3402
  } finally {
3403
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
3394
3404
  setCurrentRenderingInstance(prevInstance);
3395
3405
  if (renderFnWithContext._d) {
3396
3406
  setBlockTracking(1);
@@ -4363,7 +4373,11 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4363
4373
  function setTransitionHooks(vnode, hooks) {
4364
4374
  if (vnode.shapeFlag & 6 && vnode.component) {
4365
4375
  vnode.transition = hooks;
4366
- setTransitionHooks(vnode.component.subTree, hooks);
4376
+ const subTree = vnode.component.subTree;
4377
+ setTransitionHooks(
4378
+ isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
4379
+ hooks
4380
+ );
4367
4381
  } else if (vnode.shapeFlag & 128) {
4368
4382
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4369
4383
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -4523,12 +4537,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4523
4537
  }
4524
4538
  }
4525
4539
  if (isFunction(ref)) {
4526
- pauseTracking();
4527
- try {
4528
- callWithErrorHandling(ref, owner, 12, [value, refs]);
4529
- } finally {
4530
- resetTracking();
4531
- }
4540
+ callWithErrorHandling(ref, owner, 12, [value, refs]);
4532
4541
  } else {
4533
4542
  const _isString = isString(ref);
4534
4543
  const _isRef = isRef(ref);
@@ -4899,6 +4908,7 @@ Server rendered element contains more child nodes than client vdom.`
4899
4908
  if (props) {
4900
4909
  {
4901
4910
  const isCustomElement = el.tagName.includes("-");
4911
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
4902
4912
  for (const key in props) {
4903
4913
  if (// #11189 skip if this node has directives that have created hooks
4904
4914
  // as it could have mutated the DOM in any possible way
@@ -4907,7 +4917,10 @@ Server rendered element contains more child nodes than client vdom.`
4907
4917
  }
4908
4918
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4909
4919
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4910
- patchProp(el, key, null, props[key], void 0, parentComponent);
4920
+ if (isUnchangedResourceProp(el, key, props[key])) {
4921
+ continue;
4922
+ }
4923
+ patchProp(el, key, null, props[key], namespace, parentComponent);
4911
4924
  }
4912
4925
  }
4913
4926
  }
@@ -5089,6 +5102,13 @@ Server rendered element contains fewer child nodes than client vdom.`
5089
5102
  };
5090
5103
  return [hydrate, hydrateNode];
5091
5104
  }
5105
+ const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
5106
+ function isUnchangedResourceProp(el, key, clientValue) {
5107
+ if (!resourceProps.has(key)) {
5108
+ return false;
5109
+ }
5110
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
5111
+ }
5092
5112
  function propHasMismatch(el, key, clientValue, vnode, instance) {
5093
5113
  let mismatchType;
5094
5114
  let mismatchKey;
@@ -5126,7 +5146,10 @@ Server rendered element contains fewer child nodes than client vdom.`
5126
5146
  mismatchKey = "style";
5127
5147
  }
5128
5148
  } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
5129
- if (isBooleanAttr(key)) {
5149
+ if (key === "hidden") {
5150
+ actual = normalizeHiddenValue(el.getAttribute(key));
5151
+ expected = normalizeHiddenValue(clientValue);
5152
+ } else if (isBooleanAttr(key)) {
5130
5153
  actual = el.hasAttribute(key);
5131
5154
  expected = includeBooleanAttr(clientValue);
5132
5155
  } else if (clientValue == null) {
@@ -5162,6 +5185,15 @@ Server rendered element contains fewer child nodes than client vdom.`
5162
5185
  }
5163
5186
  return false;
5164
5187
  }
5188
+ function normalizeHiddenValue(value) {
5189
+ if (!isRenderableAttrValue(value)) {
5190
+ return false;
5191
+ }
5192
+ if (isString(value)) {
5193
+ return value.toLowerCase() === "until-found" ? "until-found" : "";
5194
+ }
5195
+ return includeBooleanAttr(value) ? "" : false;
5196
+ }
5165
5197
  function toClassSet(str) {
5166
5198
  return new Set(str.trim().split(/\s+/));
5167
5199
  }
@@ -5410,6 +5442,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5410
5442
  name: "AsyncComponentWrapper",
5411
5443
  __asyncLoader: load,
5412
5444
  __asyncHydrate(el, instance, hydrate) {
5445
+ const wasConnected = el.isConnected;
5413
5446
  let patched = false;
5414
5447
  (instance.bu || (instance.bu = [])).push(() => patched = true);
5415
5448
  const performHydrate = () => {
@@ -5421,6 +5454,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5421
5454
  }
5422
5455
  return;
5423
5456
  }
5457
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
5424
5458
  hydrate();
5425
5459
  };
5426
5460
  const doHydrate = hydrateStrategy ? () => {
@@ -6264,14 +6298,16 @@ If this is a native custom element, make sure to exclude it from component resol
6264
6298
  return slots;
6265
6299
  }
6266
6300
 
6267
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
6301
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
6302
+ if (props == null) props = {};
6268
6303
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
6269
- const hasProps = Object.keys(props).length > 0;
6270
- if (name !== "default") props.name = name;
6304
+ const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
6305
+ const hasProps = Object.keys(slotProps).length > 0;
6306
+ if (name !== "default") slotProps.name = name;
6271
6307
  return openBlock(), createBlock(
6272
6308
  Fragment,
6273
6309
  null,
6274
- [createVNode("slot", props, fallback && fallback())],
6310
+ [createVNode("slot", slotProps, fallback && fallback())],
6275
6311
  hasProps ? -2 : 64
6276
6312
  );
6277
6313
  }
@@ -6285,26 +6321,34 @@ If this is a native custom element, make sure to exclude it from component resol
6285
6321
  if (slot && slot._c) {
6286
6322
  slot._d = false;
6287
6323
  }
6324
+ const prevStackSize = blockStack.length;
6288
6325
  openBlock();
6289
- const validSlotContent = slot && ensureValidVNode(slot(props));
6290
- const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
6291
- // key attached in the `createSlots` helper, respect that
6292
- validSlotContent && validSlotContent.key;
6293
- const rendered = createBlock(
6294
- Fragment,
6295
- {
6296
- key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
6297
- (!validSlotContent && fallback ? "_fb" : "")
6298
- },
6299
- validSlotContent || (fallback ? fallback() : []),
6300
- validSlotContent && slots._ === 1 ? 64 : -2
6301
- );
6326
+ let rendered;
6327
+ try {
6328
+ const validSlotContent = slot && ensureValidVNode(slot(props));
6329
+ const slotKey = props.key || branchKey || // slot content array of a dynamic conditional slot may have a branch
6330
+ // key attached in the `createSlots` helper, respect that
6331
+ validSlotContent && validSlotContent.key;
6332
+ rendered = createBlock(
6333
+ Fragment,
6334
+ {
6335
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
6336
+ (!validSlotContent && fallback ? "_fb" : "")
6337
+ },
6338
+ validSlotContent || (fallback ? fallback() : []),
6339
+ validSlotContent && slots._ === 1 ? 64 : -2
6340
+ );
6341
+ } catch (err) {
6342
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
6343
+ throw err;
6344
+ } finally {
6345
+ if (slot && slot._c) {
6346
+ slot._d = true;
6347
+ }
6348
+ }
6302
6349
  if (!noSlotted && rendered.scopeId) {
6303
6350
  rendered.slotScopeIds = [rendered.scopeId + "-s"];
6304
6351
  }
6305
- if (slot && slot._c) {
6306
- slot._d = true;
6307
- }
6308
6352
  return rendered;
6309
6353
  }
6310
6354
  function ensureValidVNode(vnodes) {
@@ -7479,7 +7523,7 @@ If this is a native custom element, make sure to exclude it from component resol
7479
7523
  return vm;
7480
7524
  }
7481
7525
  }
7482
- Vue.version = `2.6.14-compat:${"3.5.39"}`;
7526
+ Vue.version = `2.6.14-compat:${"3.5.41"}`;
7483
7527
  Vue.config = singletonApp.config;
7484
7528
  Vue.use = (plugin, ...options) => {
7485
7529
  if (plugin && isFunction(plugin.install)) {
@@ -8501,12 +8545,13 @@ If you want to remount the same app, move your app creation logic into a factory
8501
8545
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
8502
8546
  }
8503
8547
  if (vnode.transition) {
8504
- if (!isElementRoot(root)) {
8548
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
8549
+ if (!isElementRoot(child)) {
8505
8550
  warn$1(
8506
8551
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8507
8552
  );
8508
8553
  }
8509
- setTransitionHooks(root, vnode.transition);
8554
+ setTransitionHooks(child, vnode.transition);
8510
8555
  }
8511
8556
  if (setRoot) {
8512
8557
  setRoot(root);
@@ -11260,7 +11305,9 @@ If you want to remount the same app, move your app creation logic into a factory
11260
11305
  let hasUnresolvedAncestor = false;
11261
11306
  while (parent) {
11262
11307
  if (parent.pendingBranch) {
11263
- parent.effects.push(...effects);
11308
+ for (let i = 0; i < effects.length; i++) {
11309
+ parent.effects.push(effects[i]);
11310
+ }
11264
11311
  hasUnresolvedAncestor = true;
11265
11312
  break;
11266
11313
  }
@@ -11682,6 +11729,14 @@ If you want to remount the same app, move your app creation logic into a factory
11682
11729
  if (vnode.key !== vnode.key) {
11683
11730
  warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
11684
11731
  }
11732
+ if (props && vnode.shapeFlag & 1) {
11733
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
11734
+ if (overwritingProp && hasContentChildren(vnode.children)) {
11735
+ warn$1(
11736
+ `The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`
11737
+ );
11738
+ }
11739
+ }
11685
11740
  if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
11686
11741
  !isBlockNode && // has current parent block
11687
11742
  currentBlock && // presence of a patch flag indicates this node needs patching on updates.
@@ -11699,6 +11754,11 @@ If you want to remount the same app, move your app creation logic into a factory
11699
11754
  }
11700
11755
  return vnode;
11701
11756
  }
11757
+ function hasContentChildren(children) {
11758
+ if (isString(children)) return children !== "";
11759
+ if (isArray(children)) return children.length > 0;
11760
+ return false;
11761
+ }
11702
11762
  const createVNode = createVNodeWithArgsTransform ;
11703
11763
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
11704
11764
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -12141,7 +12201,12 @@ Component that was made reactive: `,
12141
12201
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
12142
12202
  if (isSSR) {
12143
12203
  return setupResult.then((resolvedResult) => {
12144
- handleSetupResult(instance, resolvedResult, isSSR);
12204
+ setInSSRSetupState(true);
12205
+ try {
12206
+ handleSetupResult(instance, resolvedResult, isSSR);
12207
+ } finally {
12208
+ setInSSRSetupState(false);
12209
+ }
12145
12210
  }).catch((e) => {
12146
12211
  handleError(e, instance, 0);
12147
12212
  });
@@ -12617,7 +12682,7 @@ Component that was made reactive: `,
12617
12682
  return true;
12618
12683
  }
12619
12684
 
12620
- const version = "3.5.39";
12685
+ const version = "3.5.41";
12621
12686
  const warn = warn$1 ;
12622
12687
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12623
12688
  const devtools = devtools$1 ;
@@ -13656,7 +13721,9 @@ Expected function or array of functions, received type ${typeof value}.`
13656
13721
  if (parent && parent._pendingResolve) {
13657
13722
  this._pendingResolve = parent._pendingResolve.then(() => {
13658
13723
  this._pendingResolve = void 0;
13659
- this._resolveDef();
13724
+ if (this.isConnected) {
13725
+ return this._resolveDef();
13726
+ }
13660
13727
  });
13661
13728
  } else {
13662
13729
  this._resolveDef();
@@ -13706,7 +13773,7 @@ Expected function or array of functions, received type ${typeof value}.`
13706
13773
  */
13707
13774
  _resolveDef() {
13708
13775
  if (this._pendingResolve) {
13709
- return;
13776
+ return this._pendingResolve;
13710
13777
  }
13711
13778
  for (let i = 0; i < this.attributes.length; i++) {
13712
13779
  this._setAttr(this.attributes[i].name);
@@ -13746,6 +13813,7 @@ Expected function or array of functions, received type ${typeof value}.`
13746
13813
  def.configureApp = this._def.configureApp;
13747
13814
  resolve(this._def = def, true);
13748
13815
  });
13816
+ return this._pendingResolve;
13749
13817
  } else {
13750
13818
  resolve(this._def);
13751
13819
  }
@@ -13783,6 +13851,11 @@ Expected function or array of functions, received type ${typeof value}.`
13783
13851
  }
13784
13852
  }
13785
13853
  for (const key of declaredPropKeys.map(camelize)) {
13854
+ if (key in Object.getPrototypeOf(this)) {
13855
+ warn(
13856
+ `Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`
13857
+ );
13858
+ }
13786
13859
  Object.defineProperty(this, key, {
13787
13860
  get() {
13788
13861
  return this._getProp(key);
@@ -14264,6 +14337,7 @@ Expected function or array of functions, received type ${typeof value}.`
14264
14337
  }
14265
14338
  }
14266
14339
  const assignKey = /* @__PURE__ */ Symbol("_assign");
14340
+ const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
14267
14341
  function castValue(value, trim, number) {
14268
14342
  if (trim) value = value.trim();
14269
14343
  if (number) value = looseToNumber(value);
@@ -14271,6 +14345,13 @@ Expected function or array of functions, received type ${typeof value}.`
14271
14345
  }
14272
14346
  const vModelText = {
14273
14347
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
14348
+ if (el.parentNode) {
14349
+ if (el.type === "text") {
14350
+ el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
14351
+ } else if (el.type === "textarea") {
14352
+ el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
14353
+ }
14354
+ }
14274
14355
  el[assignKey] = getModelAssigner(vnode);
14275
14356
  const castToNumber = number || vnode.props && vnode.props.type === "number";
14276
14357
  addEventListener(el, lazy ? "change" : "input", (e) => {
@@ -14289,8 +14370,15 @@ Expected function or array of functions, received type ${typeof value}.`
14289
14370
  }
14290
14371
  },
14291
14372
  // set value on mounted so it's after min/max for type="range"
14292
- mounted(el, { value }) {
14293
- el.value = value == null ? "" : value;
14373
+ mounted(el, { value, modifiers: { trim, number } }) {
14374
+ const newValue = value == null ? "" : value;
14375
+ const initialValue = el[initialValueKey];
14376
+ delete el[initialValueKey];
14377
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
14378
+ el[assignKey](castValue(el.value, trim, number));
14379
+ } else {
14380
+ el.value = newValue;
14381
+ }
14294
14382
  },
14295
14383
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
14296
14384
  el[assignKey] = getModelAssigner(vnode);
@@ -14386,13 +14474,13 @@ Expected function or array of functions, received type ${typeof value}.`
14386
14474
  // <select multiple> value need to be deep traversed
14387
14475
  deep: true,
14388
14476
  created(el, { value, modifiers: { number } }, vnode) {
14389
- const isSetModel = isSet(value);
14477
+ el._modelValue = value;
14390
14478
  addEventListener(el, "change", () => {
14391
14479
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
14392
14480
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
14393
14481
  );
14394
14482
  el[assignKey](
14395
- el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
14483
+ el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]
14396
14484
  );
14397
14485
  el._assigning = true;
14398
14486
  nextTick(() => {
@@ -14406,7 +14494,8 @@ Expected function or array of functions, received type ${typeof value}.`
14406
14494
  mounted(el, { value }) {
14407
14495
  setSelected(el, value);
14408
14496
  },
14409
- beforeUpdate(el, _binding, vnode) {
14497
+ beforeUpdate(el, { value }, vnode) {
14498
+ el._modelValue = value;
14410
14499
  el[assignKey] = getModelAssigner(vnode);
14411
14500
  },
14412
14501
  updated(el, { value }) {