@vue/compat 3.5.39 → 3.5.40

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.40
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -376,8 +376,9 @@ class EffectScope {
376
376
  this._isPaused = true;
377
377
  let i, l;
378
378
  if (this.scopes) {
379
- for (i = 0, l = this.scopes.length; i < l; i++) {
380
- this.scopes[i].pause();
379
+ const scopes = this.scopes.slice();
380
+ for (i = 0, l = scopes.length; i < l; i++) {
381
+ scopes[i].pause();
381
382
  }
382
383
  }
383
384
  for (i = 0, l = this.effects.length; i < l; i++) {
@@ -394,12 +395,14 @@ class EffectScope {
394
395
  this._isPaused = false;
395
396
  let i, l;
396
397
  if (this.scopes) {
397
- for (i = 0, l = this.scopes.length; i < l; i++) {
398
- this.scopes[i].resume();
398
+ const scopes = this.scopes.slice();
399
+ for (i = 0, l = scopes.length; i < l; i++) {
400
+ scopes[i].resume();
399
401
  }
400
402
  }
401
- for (i = 0, l = this.effects.length; i < l; i++) {
402
- this.effects[i].resume();
403
+ const effects = this.effects.slice();
404
+ for (i = 0, l = effects.length; i < l; i++) {
405
+ effects[i].resume();
403
406
  }
404
407
  }
405
408
  }
@@ -461,8 +464,9 @@ class EffectScope {
461
464
  }
462
465
  this.cleanups.length = 0;
463
466
  if (this.scopes) {
464
- for (i = 0, l = this.scopes.length; i < l; i++) {
465
- this.scopes[i].stop(true);
467
+ const scopes = this.scopes.slice();
468
+ for (i = 0, l = scopes.length; i < l; i++) {
469
+ scopes[i].stop(true);
466
470
  }
467
471
  this.scopes.length = 0;
468
472
  }
@@ -3384,10 +3388,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
3384
3388
  setBlockTracking(-1);
3385
3389
  }
3386
3390
  const prevInstance = setCurrentRenderingInstance(ctx);
3391
+ const prevStackSize = blockStack.length;
3387
3392
  let res;
3388
3393
  try {
3389
3394
  res = fn(...args);
3390
3395
  } finally {
3396
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
3391
3397
  setCurrentRenderingInstance(prevInstance);
3392
3398
  if (renderFnWithContext._d) {
3393
3399
  setBlockTracking(1);
@@ -4548,12 +4554,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4548
4554
  }
4549
4555
  }
4550
4556
  if (isFunction(ref)) {
4551
- pauseTracking();
4552
- try {
4553
- callWithErrorHandling(ref, owner, 12, [value, refs]);
4554
- } finally {
4555
- resetTracking();
4556
- }
4557
+ callWithErrorHandling(ref, owner, 12, [value, refs]);
4557
4558
  } else {
4558
4559
  const _isString = isString(ref);
4559
4560
  const _isRef = isRef(ref);
@@ -4924,6 +4925,7 @@ Server rendered element contains more child nodes than client vdom.`
4924
4925
  if (props) {
4925
4926
  {
4926
4927
  const isCustomElement = el.tagName.includes("-");
4928
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
4927
4929
  for (const key in props) {
4928
4930
  if (// #11189 skip if this node has directives that have created hooks
4929
4931
  // as it could have mutated the DOM in any possible way
@@ -4932,7 +4934,7 @@ Server rendered element contains more child nodes than client vdom.`
4932
4934
  }
4933
4935
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4934
4936
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4935
- patchProp(el, key, null, props[key], void 0, parentComponent);
4937
+ patchProp(el, key, null, props[key], namespace, parentComponent);
4936
4938
  }
4937
4939
  }
4938
4940
  }
@@ -5435,6 +5437,7 @@ function defineAsyncComponent(source) {
5435
5437
  name: "AsyncComponentWrapper",
5436
5438
  __asyncLoader: load,
5437
5439
  __asyncHydrate(el, instance, hydrate) {
5440
+ const wasConnected = el.isConnected;
5438
5441
  let patched = false;
5439
5442
  (instance.bu || (instance.bu = [])).push(() => patched = true);
5440
5443
  const performHydrate = () => {
@@ -5446,6 +5449,7 @@ function defineAsyncComponent(source) {
5446
5449
  }
5447
5450
  return;
5448
5451
  }
5452
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
5449
5453
  hydrate();
5450
5454
  };
5451
5455
  const doHydrate = hydrateStrategy ? () => {
@@ -6295,14 +6299,15 @@ function createSlots(slots, dynamicSlots) {
6295
6299
  return slots;
6296
6300
  }
6297
6301
 
6298
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
6302
+ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
6299
6303
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
6300
- const hasProps = Object.keys(props).length > 0;
6301
- 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;
6302
6307
  return openBlock(), createBlock(
6303
6308
  Fragment,
6304
6309
  null,
6305
- [createVNode("slot", props, fallback && fallback())],
6310
+ [createVNode("slot", slotProps, fallback && fallback())],
6306
6311
  hasProps ? -2 : 64
6307
6312
  );
6308
6313
  }
@@ -6316,26 +6321,34 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
6316
6321
  if (slot && slot._c) {
6317
6322
  slot._d = false;
6318
6323
  }
6324
+ const prevStackSize = blockStack.length;
6319
6325
  openBlock();
6320
- const validSlotContent = slot && ensureValidVNode(slot(props));
6321
- const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
6322
- // key attached in the `createSlots` helper, respect that
6323
- validSlotContent && validSlotContent.key;
6324
- const rendered = createBlock(
6325
- Fragment,
6326
- {
6327
- key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
6328
- (!validSlotContent && fallback ? "_fb" : "")
6329
- },
6330
- validSlotContent || (fallback ? fallback() : []),
6331
- validSlotContent && slots._ === 1 ? 64 : -2
6332
- );
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
+ }
6333
6349
  if (!noSlotted && rendered.scopeId) {
6334
6350
  rendered.slotScopeIds = [rendered.scopeId + "-s"];
6335
6351
  }
6336
- if (slot && slot._c) {
6337
- slot._d = true;
6338
- }
6339
6352
  return rendered;
6340
6353
  }
6341
6354
  function ensureValidVNode(vnodes) {
@@ -7513,7 +7526,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7513
7526
  return vm;
7514
7527
  }
7515
7528
  }
7516
- Vue.version = `2.6.14-compat:${"3.5.39"}`;
7529
+ Vue.version = `2.6.14-compat:${"3.5.40"}`;
7517
7530
  Vue.config = singletonApp.config;
7518
7531
  Vue.use = (plugin, ...options) => {
7519
7532
  if (plugin && isFunction(plugin.install)) {
@@ -12665,7 +12678,7 @@ function isMemoSame(cached, memo) {
12665
12678
  return true;
12666
12679
  }
12667
12680
 
12668
- const version = "3.5.39";
12681
+ const version = "3.5.40";
12669
12682
  const warn = warn$1 ;
12670
12683
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12671
12684
  const devtools = devtools$1 ;
@@ -14465,13 +14478,13 @@ const vModelSelect = {
14465
14478
  // <select multiple> value need to be deep traversed
14466
14479
  deep: true,
14467
14480
  created(el, { value, modifiers: { number } }, vnode) {
14468
- const isSetModel = isSet(value);
14481
+ el._modelValue = value;
14469
14482
  addEventListener(el, "change", () => {
14470
14483
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
14471
14484
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
14472
14485
  );
14473
14486
  el[assignKey](
14474
- el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
14487
+ el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]
14475
14488
  );
14476
14489
  el._assigning = true;
14477
14490
  nextTick(() => {
@@ -14485,7 +14498,8 @@ const vModelSelect = {
14485
14498
  mounted(el, { value }) {
14486
14499
  setSelected(el, value);
14487
14500
  },
14488
- beforeUpdate(el, _binding, vnode) {
14501
+ beforeUpdate(el, { value }, vnode) {
14502
+ el._modelValue = value;
14489
14503
  el[assignKey] = getModelAssigner(vnode);
14490
14504
  },
14491
14505
  updated(el, { value }) {