@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
  **/
@@ -449,8 +449,9 @@ class EffectScope {
449
449
  this._isPaused = true;
450
450
  let i, l;
451
451
  if (this.scopes) {
452
- for (i = 0, l = this.scopes.length; i < l; i++) {
453
- this.scopes[i].pause();
452
+ const scopes = this.scopes.slice();
453
+ for (i = 0, l = scopes.length; i < l; i++) {
454
+ scopes[i].pause();
454
455
  }
455
456
  }
456
457
  for (i = 0, l = this.effects.length; i < l; i++) {
@@ -467,12 +468,14 @@ class EffectScope {
467
468
  this._isPaused = false;
468
469
  let i, l;
469
470
  if (this.scopes) {
470
- for (i = 0, l = this.scopes.length; i < l; i++) {
471
- this.scopes[i].resume();
471
+ const scopes = this.scopes.slice();
472
+ for (i = 0, l = scopes.length; i < l; i++) {
473
+ scopes[i].resume();
472
474
  }
473
475
  }
474
- for (i = 0, l = this.effects.length; i < l; i++) {
475
- this.effects[i].resume();
476
+ const effects = this.effects.slice();
477
+ for (i = 0, l = effects.length; i < l; i++) {
478
+ effects[i].resume();
476
479
  }
477
480
  }
478
481
  }
@@ -534,8 +537,9 @@ class EffectScope {
534
537
  }
535
538
  this.cleanups.length = 0;
536
539
  if (this.scopes) {
537
- for (i = 0, l = this.scopes.length; i < l; i++) {
538
- this.scopes[i].stop(true);
540
+ const scopes = this.scopes.slice();
541
+ for (i = 0, l = scopes.length; i < l; i++) {
542
+ scopes[i].stop(true);
539
543
  }
540
544
  this.scopes.length = 0;
541
545
  }
@@ -3457,10 +3461,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
3457
3461
  setBlockTracking(-1);
3458
3462
  }
3459
3463
  const prevInstance = setCurrentRenderingInstance(ctx);
3464
+ const prevStackSize = blockStack.length;
3460
3465
  let res;
3461
3466
  try {
3462
3467
  res = fn(...args);
3463
3468
  } finally {
3469
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
3464
3470
  setCurrentRenderingInstance(prevInstance);
3465
3471
  if (renderFnWithContext._d) {
3466
3472
  setBlockTracking(1);
@@ -4621,12 +4627,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4621
4627
  }
4622
4628
  }
4623
4629
  if (isFunction(ref)) {
4624
- pauseTracking();
4625
- try {
4626
- callWithErrorHandling(ref, owner, 12, [value, refs]);
4627
- } finally {
4628
- resetTracking();
4629
- }
4630
+ callWithErrorHandling(ref, owner, 12, [value, refs]);
4630
4631
  } else {
4631
4632
  const _isString = isString(ref);
4632
4633
  const _isRef = isRef(ref);
@@ -4997,6 +4998,7 @@ Server rendered element contains more child nodes than client vdom.`
4997
4998
  if (props) {
4998
4999
  {
4999
5000
  const isCustomElement = el.tagName.includes("-");
5001
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
5000
5002
  for (const key in props) {
5001
5003
  if (// #11189 skip if this node has directives that have created hooks
5002
5004
  // as it could have mutated the DOM in any possible way
@@ -5005,7 +5007,7 @@ Server rendered element contains more child nodes than client vdom.`
5005
5007
  }
5006
5008
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
5007
5009
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
5008
- patchProp(el, key, null, props[key], void 0, parentComponent);
5010
+ patchProp(el, key, null, props[key], namespace, parentComponent);
5009
5011
  }
5010
5012
  }
5011
5013
  }
@@ -5508,6 +5510,7 @@ function defineAsyncComponent(source) {
5508
5510
  name: "AsyncComponentWrapper",
5509
5511
  __asyncLoader: load,
5510
5512
  __asyncHydrate(el, instance, hydrate) {
5513
+ const wasConnected = el.isConnected;
5511
5514
  let patched = false;
5512
5515
  (instance.bu || (instance.bu = [])).push(() => patched = true);
5513
5516
  const performHydrate = () => {
@@ -5519,6 +5522,7 @@ function defineAsyncComponent(source) {
5519
5522
  }
5520
5523
  return;
5521
5524
  }
5525
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
5522
5526
  hydrate();
5523
5527
  };
5524
5528
  const doHydrate = hydrateStrategy ? () => {
@@ -6368,14 +6372,15 @@ function createSlots(slots, dynamicSlots) {
6368
6372
  return slots;
6369
6373
  }
6370
6374
 
6371
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
6375
+ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
6372
6376
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
6373
- const hasProps = Object.keys(props).length > 0;
6374
- if (name !== "default") props.name = name;
6377
+ const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
6378
+ const hasProps = Object.keys(slotProps).length > 0;
6379
+ if (name !== "default") slotProps.name = name;
6375
6380
  return openBlock(), createBlock(
6376
6381
  Fragment,
6377
6382
  null,
6378
- [createVNode("slot", props, fallback && fallback())],
6383
+ [createVNode("slot", slotProps, fallback && fallback())],
6379
6384
  hasProps ? -2 : 64
6380
6385
  );
6381
6386
  }
@@ -6389,26 +6394,34 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
6389
6394
  if (slot && slot._c) {
6390
6395
  slot._d = false;
6391
6396
  }
6397
+ const prevStackSize = blockStack.length;
6392
6398
  openBlock();
6393
- const validSlotContent = slot && ensureValidVNode(slot(props));
6394
- const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
6395
- // key attached in the `createSlots` helper, respect that
6396
- validSlotContent && validSlotContent.key;
6397
- const rendered = createBlock(
6398
- Fragment,
6399
- {
6400
- key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
6401
- (!validSlotContent && fallback ? "_fb" : "")
6402
- },
6403
- validSlotContent || (fallback ? fallback() : []),
6404
- validSlotContent && slots._ === 1 ? 64 : -2
6405
- );
6399
+ let rendered;
6400
+ try {
6401
+ const validSlotContent = slot && ensureValidVNode(slot(props));
6402
+ const slotKey = props.key || branchKey || // slot content array of a dynamic conditional slot may have a branch
6403
+ // key attached in the `createSlots` helper, respect that
6404
+ validSlotContent && validSlotContent.key;
6405
+ rendered = createBlock(
6406
+ Fragment,
6407
+ {
6408
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
6409
+ (!validSlotContent && fallback ? "_fb" : "")
6410
+ },
6411
+ validSlotContent || (fallback ? fallback() : []),
6412
+ validSlotContent && slots._ === 1 ? 64 : -2
6413
+ );
6414
+ } catch (err) {
6415
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
6416
+ throw err;
6417
+ } finally {
6418
+ if (slot && slot._c) {
6419
+ slot._d = true;
6420
+ }
6421
+ }
6406
6422
  if (!noSlotted && rendered.scopeId) {
6407
6423
  rendered.slotScopeIds = [rendered.scopeId + "-s"];
6408
6424
  }
6409
- if (slot && slot._c) {
6410
- slot._d = true;
6411
- }
6412
6425
  return rendered;
6413
6426
  }
6414
6427
  function ensureValidVNode(vnodes) {
@@ -7586,7 +7599,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7586
7599
  return vm;
7587
7600
  }
7588
7601
  }
7589
- Vue.version = `2.6.14-compat:${"3.5.39"}`;
7602
+ Vue.version = `2.6.14-compat:${"3.5.40"}`;
7590
7603
  Vue.config = singletonApp.config;
7591
7604
  Vue.use = (plugin, ...options) => {
7592
7605
  if (plugin && isFunction(plugin.install)) {
@@ -12738,7 +12751,7 @@ function isMemoSame(cached, memo) {
12738
12751
  return true;
12739
12752
  }
12740
12753
 
12741
- const version = "3.5.39";
12754
+ const version = "3.5.40";
12742
12755
  const warn = warn$1 ;
12743
12756
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12744
12757
  const devtools = devtools$1 ;
@@ -14538,13 +14551,13 @@ const vModelSelect = {
14538
14551
  // <select multiple> value need to be deep traversed
14539
14552
  deep: true,
14540
14553
  created(el, { value, modifiers: { number } }, vnode) {
14541
- const isSetModel = isSet(value);
14554
+ el._modelValue = value;
14542
14555
  addEventListener(el, "change", () => {
14543
14556
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
14544
14557
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
14545
14558
  );
14546
14559
  el[assignKey](
14547
- el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
14560
+ el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]
14548
14561
  );
14549
14562
  el._assigning = true;
14550
14563
  nextTick(() => {
@@ -14558,7 +14571,8 @@ const vModelSelect = {
14558
14571
  mounted(el, { value }) {
14559
14572
  setSelected(el, value);
14560
14573
  },
14561
- beforeUpdate(el, _binding, vnode) {
14574
+ beforeUpdate(el, { value }, vnode) {
14575
+ el._modelValue = value;
14562
14576
  el[assignKey] = getModelAssigner(vnode);
14563
14577
  },
14564
14578
  updated(el, { value }) {
@@ -16497,6 +16511,9 @@ function getUnnormalizedProps(props, callPath = []) {
16497
16511
  return [props, callPath];
16498
16512
  }
16499
16513
  function injectProp(node, prop, context) {
16514
+ if (node.type !== 13 && injectSlotKey(node, prop)) {
16515
+ return;
16516
+ }
16500
16517
  let propsWithInjection;
16501
16518
  let props = node.type === 13 ? node.props : node.arguments[2];
16502
16519
  let callPath = [];
@@ -16554,6 +16571,24 @@ function injectProp(node, prop, context) {
16554
16571
  }
16555
16572
  }
16556
16573
  }
16574
+ function injectSlotKey(node, prop) {
16575
+ var _a, _b, _c;
16576
+ if (prop.key.type !== 4 || prop.key.content !== "key") {
16577
+ return false;
16578
+ }
16579
+ const props = node.arguments[2];
16580
+ if (props && !isString(props)) {
16581
+ const [unnormalizedProps] = getUnnormalizedProps(props);
16582
+ if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) {
16583
+ return true;
16584
+ }
16585
+ }
16586
+ (_a = node.arguments)[2] || (_a[2] = "{}");
16587
+ (_b = node.arguments)[3] || (_b[3] = "undefined");
16588
+ (_c = node.arguments)[4] || (_c[4] = "undefined");
16589
+ node.arguments[5] = prop.value;
16590
+ return true;
16591
+ }
16557
16592
  function hasProp(prop, props) {
16558
16593
  let result = false;
16559
16594
  if (prop.key.type === 4) {