vue 3.5.33 → 3.5.35

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 v3.5.33
2
+ * vue v3.5.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.33
2
+ * vue v3.5.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -430,12 +430,18 @@ var Vue = (function (exports) {
430
430
  */
431
431
  this.cleanups = [];
432
432
  this._isPaused = false;
433
+ this._warnOnRun = true;
433
434
  this.__v_skip = true;
434
- this.parent = activeEffectScope;
435
435
  if (!detached && activeEffectScope) {
436
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
437
- this
438
- ) - 1;
436
+ if (activeEffectScope.active) {
437
+ this.parent = activeEffectScope;
438
+ this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
439
+ this
440
+ ) - 1;
441
+ } else {
442
+ this._active = false;
443
+ this._warnOnRun = false;
444
+ }
439
445
  }
440
446
  }
441
447
  get active() {
@@ -483,7 +489,7 @@ var Vue = (function (exports) {
483
489
  } finally {
484
490
  activeEffectScope = currentEffectScope;
485
491
  }
486
- } else {
492
+ } else if (this._warnOnRun) {
487
493
  warn$2(`cannot run an inactive effect scope.`);
488
494
  }
489
495
  }
@@ -589,8 +595,12 @@ var Vue = (function (exports) {
589
595
  */
590
596
  this.cleanup = void 0;
591
597
  this.scheduler = void 0;
592
- if (activeEffectScope && activeEffectScope.active) {
593
- activeEffectScope.effects.push(this);
598
+ if (activeEffectScope) {
599
+ if (activeEffectScope.active) {
600
+ activeEffectScope.effects.push(this);
601
+ } else {
602
+ this.flags &= -2;
603
+ }
594
604
  }
595
605
  }
596
606
  pause() {
@@ -1738,9 +1748,6 @@ var Vue = (function (exports) {
1738
1748
  return 0 /* INVALID */;
1739
1749
  }
1740
1750
  }
1741
- function getTargetType(value) {
1742
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1743
- }
1744
1751
  // @__NO_SIDE_EFFECTS__
1745
1752
  function reactive(target) {
1746
1753
  if (/* @__PURE__ */ isReadonly(target)) {
@@ -1798,14 +1805,17 @@ var Vue = (function (exports) {
1798
1805
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1799
1806
  return target;
1800
1807
  }
1801
- const targetType = getTargetType(target);
1802
- if (targetType === 0 /* INVALID */) {
1808
+ if (target["__v_skip"] || !Object.isExtensible(target)) {
1803
1809
  return target;
1804
1810
  }
1805
1811
  const existingProxy = proxyMap.get(target);
1806
1812
  if (existingProxy) {
1807
1813
  return existingProxy;
1808
1814
  }
1815
+ const targetType = targetTypeMap(toRawType(target));
1816
+ if (targetType === 0 /* INVALID */) {
1817
+ return target;
1818
+ }
1809
1819
  const proxy = new Proxy(
1810
1820
  target,
1811
1821
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -3460,19 +3470,18 @@ var Vue = (function (exports) {
3460
3470
  target,
3461
3471
  props
3462
3472
  } = vnode;
3463
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3473
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3464
3474
  const pendingMount = pendingMounts.get(vnode);
3465
3475
  if (pendingMount) {
3466
3476
  pendingMount.flags |= 8;
3467
3477
  pendingMounts.delete(vnode);
3468
- shouldRemove = false;
3469
3478
  }
3470
3479
  if (target) {
3471
3480
  hostRemove(targetStart);
3472
3481
  hostRemove(targetAnchor);
3473
3482
  }
3474
3483
  doRemove && hostRemove(anchor);
3475
- if (shapeFlag & 16) {
3484
+ if (!pendingMount && shapeFlag & 16) {
3476
3485
  for (let i = 0; i < children.length; i++) {
3477
3486
  const child = children[i];
3478
3487
  unmount(
@@ -4440,20 +4449,16 @@ var Vue = (function (exports) {
4440
4449
  slotScopeIds,
4441
4450
  optimized
4442
4451
  );
4443
- let hasWarned = false;
4444
- while (next) {
4445
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
4446
- if (!hasWarned) {
4447
- warn$1(
4448
- `Hydration children mismatch on`,
4449
- el,
4450
- `
4452
+ if (next && !isMismatchAllowed(el, 1 /* CHILDREN */)) {
4453
+ warn$1(
4454
+ `Hydration children mismatch on`,
4455
+ el,
4456
+ `
4451
4457
  Server rendered element contains more child nodes than client vdom.`
4452
- );
4453
- hasWarned = true;
4454
- }
4455
- logMismatchError();
4456
- }
4458
+ );
4459
+ logMismatchError();
4460
+ }
4461
+ while (next) {
4457
4462
  const cur = next;
4458
4463
  next = next.nextSibling;
4459
4464
  remove(cur);
@@ -4516,7 +4521,7 @@ Server rendered element contains more child nodes than client vdom.`
4516
4521
  optimized = optimized || !!parentVNode.dynamicChildren;
4517
4522
  const children = parentVNode.children;
4518
4523
  const l = children.length;
4519
- let hasWarned = false;
4524
+ let hasCheckedMismatch = false;
4520
4525
  for (let i = 0; i < l; i++) {
4521
4526
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4522
4527
  const isText = vnode.type === Text;
@@ -4544,17 +4549,17 @@ Server rendered element contains more child nodes than client vdom.`
4544
4549
  } else if (isText && !vnode.children) {
4545
4550
  insert(vnode.el = createText(""), container);
4546
4551
  } else {
4547
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4548
- if (!hasWarned) {
4552
+ if (!hasCheckedMismatch) {
4553
+ hasCheckedMismatch = true;
4554
+ if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4549
4555
  warn$1(
4550
4556
  `Hydration children mismatch on`,
4551
4557
  container,
4552
4558
  `
4553
4559
  Server rendered element contains fewer child nodes than client vdom.`
4554
4560
  );
4555
- hasWarned = true;
4561
+ logMismatchError();
4556
4562
  }
4557
- logMismatchError();
4558
4563
  }
4559
4564
  patch(
4560
4565
  null,
@@ -7481,7 +7486,7 @@ If you want to remount the same app, move your app creation logic into a factory
7481
7486
  const receivedType = toRawType(value);
7482
7487
  const expectedValue = styleValue(value, expectedType);
7483
7488
  const receivedValue = styleValue(value, receivedType);
7484
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
7489
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) {
7485
7490
  message += ` with value ${expectedValue}`;
7486
7491
  }
7487
7492
  message += `, got ${receivedType} `;
@@ -7491,7 +7496,9 @@ If you want to remount the same app, move your app creation logic into a factory
7491
7496
  return message;
7492
7497
  }
7493
7498
  function styleValue(value, type) {
7494
- if (type === "String") {
7499
+ if (isSymbol(value)) {
7500
+ return value.toString();
7501
+ } else if (type === "String") {
7495
7502
  return `"${value}"`;
7496
7503
  } else if (type === "Number") {
7497
7504
  return `${Number(value)}`;
@@ -7503,8 +7510,11 @@ If you want to remount the same app, move your app creation logic into a factory
7503
7510
  const explicitTypes = ["string", "number", "boolean"];
7504
7511
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
7505
7512
  }
7506
- function isBoolean(...args) {
7507
- return args.some((elem) => elem.toLowerCase() === "boolean");
7513
+ function isCoercible(...args) {
7514
+ return args.every((elem) => {
7515
+ const value = elem.toLowerCase();
7516
+ return value !== "boolean" && value !== "symbol";
7517
+ });
7508
7518
  }
7509
7519
 
7510
7520
  const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
@@ -8822,9 +8832,13 @@ If you want to remount the same app, move your app creation logic into a factory
8822
8832
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
8823
8833
  if (needTransition2) {
8824
8834
  if (moveType === 0) {
8825
- transition.beforeEnter(el);
8826
- hostInsert(el, container, anchor);
8827
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
8835
+ if (transition.persisted && !el[leaveCbKey]) {
8836
+ hostInsert(el, container, anchor);
8837
+ } else {
8838
+ transition.beforeEnter(el);
8839
+ hostInsert(el, container, anchor);
8840
+ queuePostRenderEffect(() => transition.enter(el), parentSuspense);
8841
+ }
8828
8842
  } else {
8829
8843
  const { leave, delayLeave, afterLeave } = transition;
8830
8844
  const remove2 = () => {
@@ -8835,16 +8849,21 @@ If you want to remount the same app, move your app creation logic into a factory
8835
8849
  }
8836
8850
  };
8837
8851
  const performLeave = () => {
8852
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
8838
8853
  if (el._isLeaving) {
8839
8854
  el[leaveCbKey](
8840
8855
  true
8841
8856
  /* cancelled */
8842
8857
  );
8843
8858
  }
8844
- leave(el, () => {
8859
+ if (transition.persisted && !wasLeaving) {
8845
8860
  remove2();
8846
- afterLeave && afterLeave();
8847
- });
8861
+ } else {
8862
+ leave(el, () => {
8863
+ remove2();
8864
+ afterLeave && afterLeave();
8865
+ });
8866
+ }
8848
8867
  };
8849
8868
  if (delayLeave) {
8850
8869
  delayLeave(el, remove2, performLeave);
@@ -9524,13 +9543,14 @@ If you want to remount the same app, move your app creation logic into a factory
9524
9543
  suspense.isHydrating = false;
9525
9544
  } else if (!resume) {
9526
9545
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
9546
+ let hasUpdatedAnchor = false;
9527
9547
  if (delayEnter) {
9528
9548
  activeBranch.transition.afterLeave = () => {
9529
9549
  if (pendingId === suspense.pendingId) {
9530
9550
  move(
9531
9551
  pendingBranch,
9532
9552
  container2,
9533
- anchor === initialAnchor ? next(activeBranch) : anchor,
9553
+ anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor,
9534
9554
  0
9535
9555
  );
9536
9556
  queuePostFlushCb(effects);
@@ -9543,6 +9563,7 @@ If you want to remount the same app, move your app creation logic into a factory
9543
9563
  if (activeBranch && !suspense.isFallbackMountPending) {
9544
9564
  if (parentNode(activeBranch.el) === container2) {
9545
9565
  anchor = next(activeBranch);
9566
+ hasUpdatedAnchor = true;
9546
9567
  }
9547
9568
  unmount(activeBranch, parentComponent2, suspense, true);
9548
9569
  if (!delayEnter && isInFallback && vnode2.ssFallback) {
@@ -10835,7 +10856,7 @@ Component that was made reactive: `,
10835
10856
  return true;
10836
10857
  }
10837
10858
 
10838
- const version = "3.5.33";
10859
+ const version = "3.5.35";
10839
10860
  const warn = warn$1 ;
10840
10861
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10841
10862
  const devtools = devtools$1 ;
@@ -11573,12 +11594,37 @@ Component that was made reactive: `,
11573
11594
  } else if (e._vts <= invoker.attached) {
11574
11595
  return;
11575
11596
  }
11576
- callWithAsyncErrorHandling(
11577
- patchStopImmediatePropagation(e, invoker.value),
11578
- instance,
11579
- 5,
11580
- [e]
11581
- );
11597
+ const value = invoker.value;
11598
+ if (isArray(value)) {
11599
+ const originalStop = e.stopImmediatePropagation;
11600
+ e.stopImmediatePropagation = () => {
11601
+ originalStop.call(e);
11602
+ e._stopped = true;
11603
+ };
11604
+ const handlers = value.slice();
11605
+ const args = [e];
11606
+ for (let i = 0; i < handlers.length; i++) {
11607
+ if (e._stopped) {
11608
+ break;
11609
+ }
11610
+ const handler = handlers[i];
11611
+ if (handler) {
11612
+ callWithAsyncErrorHandling(
11613
+ handler,
11614
+ instance,
11615
+ 5,
11616
+ args
11617
+ );
11618
+ }
11619
+ }
11620
+ } else {
11621
+ callWithAsyncErrorHandling(
11622
+ value,
11623
+ instance,
11624
+ 5,
11625
+ [e]
11626
+ );
11627
+ }
11582
11628
  };
11583
11629
  invoker.value = initialValue;
11584
11630
  invoker.attached = getNow();
@@ -11594,20 +11640,6 @@ Expected function or array of functions, received type ${typeof value}.`
11594
11640
  );
11595
11641
  return NOOP;
11596
11642
  }
11597
- function patchStopImmediatePropagation(e, value) {
11598
- if (isArray(value)) {
11599
- const originalStop = e.stopImmediatePropagation;
11600
- e.stopImmediatePropagation = () => {
11601
- originalStop.call(e);
11602
- e._stopped = true;
11603
- };
11604
- return value.map(
11605
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
11606
- );
11607
- } else {
11608
- return value;
11609
- }
11610
- }
11611
11643
 
11612
11644
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11613
11645
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
@@ -16313,7 +16345,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
16313
16345
  const keyProp = findProp(node, `key`, false, true);
16314
16346
  keyProp && keyProp.type === 7;
16315
16347
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
16316
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
16348
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
16317
16349
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
16318
16350
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
16319
16351
  forNode.codegenNode = createVNodeCall(