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
  **/
@@ -357,12 +357,18 @@ var Vue = (function (exports) {
357
357
  */
358
358
  this.cleanups = [];
359
359
  this._isPaused = false;
360
+ this._warnOnRun = true;
360
361
  this.__v_skip = true;
361
- this.parent = activeEffectScope;
362
362
  if (!detached && activeEffectScope) {
363
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
364
- this
365
- ) - 1;
363
+ if (activeEffectScope.active) {
364
+ this.parent = activeEffectScope;
365
+ this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
366
+ this
367
+ ) - 1;
368
+ } else {
369
+ this._active = false;
370
+ this._warnOnRun = false;
371
+ }
366
372
  }
367
373
  }
368
374
  get active() {
@@ -410,7 +416,7 @@ var Vue = (function (exports) {
410
416
  } finally {
411
417
  activeEffectScope = currentEffectScope;
412
418
  }
413
- } else {
419
+ } else if (this._warnOnRun) {
414
420
  warn$2(`cannot run an inactive effect scope.`);
415
421
  }
416
422
  }
@@ -516,8 +522,12 @@ var Vue = (function (exports) {
516
522
  */
517
523
  this.cleanup = void 0;
518
524
  this.scheduler = void 0;
519
- if (activeEffectScope && activeEffectScope.active) {
520
- activeEffectScope.effects.push(this);
525
+ if (activeEffectScope) {
526
+ if (activeEffectScope.active) {
527
+ activeEffectScope.effects.push(this);
528
+ } else {
529
+ this.flags &= -2;
530
+ }
521
531
  }
522
532
  }
523
533
  pause() {
@@ -1665,9 +1675,6 @@ var Vue = (function (exports) {
1665
1675
  return 0 /* INVALID */;
1666
1676
  }
1667
1677
  }
1668
- function getTargetType(value) {
1669
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1670
- }
1671
1678
  // @__NO_SIDE_EFFECTS__
1672
1679
  function reactive(target) {
1673
1680
  if (/* @__PURE__ */ isReadonly(target)) {
@@ -1725,14 +1732,17 @@ var Vue = (function (exports) {
1725
1732
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1726
1733
  return target;
1727
1734
  }
1728
- const targetType = getTargetType(target);
1729
- if (targetType === 0 /* INVALID */) {
1735
+ if (target["__v_skip"] || !Object.isExtensible(target)) {
1730
1736
  return target;
1731
1737
  }
1732
1738
  const existingProxy = proxyMap.get(target);
1733
1739
  if (existingProxy) {
1734
1740
  return existingProxy;
1735
1741
  }
1742
+ const targetType = targetTypeMap(toRawType(target));
1743
+ if (targetType === 0 /* INVALID */) {
1744
+ return target;
1745
+ }
1736
1746
  const proxy = new Proxy(
1737
1747
  target,
1738
1748
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -3387,19 +3397,18 @@ var Vue = (function (exports) {
3387
3397
  target,
3388
3398
  props
3389
3399
  } = vnode;
3390
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3400
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3391
3401
  const pendingMount = pendingMounts.get(vnode);
3392
3402
  if (pendingMount) {
3393
3403
  pendingMount.flags |= 8;
3394
3404
  pendingMounts.delete(vnode);
3395
- shouldRemove = false;
3396
3405
  }
3397
3406
  if (target) {
3398
3407
  hostRemove(targetStart);
3399
3408
  hostRemove(targetAnchor);
3400
3409
  }
3401
3410
  doRemove && hostRemove(anchor);
3402
- if (shapeFlag & 16) {
3411
+ if (!pendingMount && shapeFlag & 16) {
3403
3412
  for (let i = 0; i < children.length; i++) {
3404
3413
  const child = children[i];
3405
3414
  unmount(
@@ -4367,20 +4376,16 @@ var Vue = (function (exports) {
4367
4376
  slotScopeIds,
4368
4377
  optimized
4369
4378
  );
4370
- let hasWarned = false;
4371
- while (next) {
4372
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
4373
- if (!hasWarned) {
4374
- warn$1(
4375
- `Hydration children mismatch on`,
4376
- el,
4377
- `
4379
+ if (next && !isMismatchAllowed(el, 1 /* CHILDREN */)) {
4380
+ warn$1(
4381
+ `Hydration children mismatch on`,
4382
+ el,
4383
+ `
4378
4384
  Server rendered element contains more child nodes than client vdom.`
4379
- );
4380
- hasWarned = true;
4381
- }
4382
- logMismatchError();
4383
- }
4385
+ );
4386
+ logMismatchError();
4387
+ }
4388
+ while (next) {
4384
4389
  const cur = next;
4385
4390
  next = next.nextSibling;
4386
4391
  remove(cur);
@@ -4443,7 +4448,7 @@ Server rendered element contains more child nodes than client vdom.`
4443
4448
  optimized = optimized || !!parentVNode.dynamicChildren;
4444
4449
  const children = parentVNode.children;
4445
4450
  const l = children.length;
4446
- let hasWarned = false;
4451
+ let hasCheckedMismatch = false;
4447
4452
  for (let i = 0; i < l; i++) {
4448
4453
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4449
4454
  const isText = vnode.type === Text;
@@ -4471,17 +4476,17 @@ Server rendered element contains more child nodes than client vdom.`
4471
4476
  } else if (isText && !vnode.children) {
4472
4477
  insert(vnode.el = createText(""), container);
4473
4478
  } else {
4474
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4475
- if (!hasWarned) {
4479
+ if (!hasCheckedMismatch) {
4480
+ hasCheckedMismatch = true;
4481
+ if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4476
4482
  warn$1(
4477
4483
  `Hydration children mismatch on`,
4478
4484
  container,
4479
4485
  `
4480
4486
  Server rendered element contains fewer child nodes than client vdom.`
4481
4487
  );
4482
- hasWarned = true;
4488
+ logMismatchError();
4483
4489
  }
4484
- logMismatchError();
4485
4490
  }
4486
4491
  patch(
4487
4492
  null,
@@ -7408,7 +7413,7 @@ If you want to remount the same app, move your app creation logic into a factory
7408
7413
  const receivedType = toRawType(value);
7409
7414
  const expectedValue = styleValue(value, expectedType);
7410
7415
  const receivedValue = styleValue(value, receivedType);
7411
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
7416
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) {
7412
7417
  message += ` with value ${expectedValue}`;
7413
7418
  }
7414
7419
  message += `, got ${receivedType} `;
@@ -7418,7 +7423,9 @@ If you want to remount the same app, move your app creation logic into a factory
7418
7423
  return message;
7419
7424
  }
7420
7425
  function styleValue(value, type) {
7421
- if (type === "String") {
7426
+ if (isSymbol(value)) {
7427
+ return value.toString();
7428
+ } else if (type === "String") {
7422
7429
  return `"${value}"`;
7423
7430
  } else if (type === "Number") {
7424
7431
  return `${Number(value)}`;
@@ -7430,8 +7437,11 @@ If you want to remount the same app, move your app creation logic into a factory
7430
7437
  const explicitTypes = ["string", "number", "boolean"];
7431
7438
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
7432
7439
  }
7433
- function isBoolean(...args) {
7434
- return args.some((elem) => elem.toLowerCase() === "boolean");
7440
+ function isCoercible(...args) {
7441
+ return args.every((elem) => {
7442
+ const value = elem.toLowerCase();
7443
+ return value !== "boolean" && value !== "symbol";
7444
+ });
7435
7445
  }
7436
7446
 
7437
7447
  const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
@@ -8749,9 +8759,13 @@ If you want to remount the same app, move your app creation logic into a factory
8749
8759
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
8750
8760
  if (needTransition2) {
8751
8761
  if (moveType === 0) {
8752
- transition.beforeEnter(el);
8753
- hostInsert(el, container, anchor);
8754
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
8762
+ if (transition.persisted && !el[leaveCbKey]) {
8763
+ hostInsert(el, container, anchor);
8764
+ } else {
8765
+ transition.beforeEnter(el);
8766
+ hostInsert(el, container, anchor);
8767
+ queuePostRenderEffect(() => transition.enter(el), parentSuspense);
8768
+ }
8755
8769
  } else {
8756
8770
  const { leave, delayLeave, afterLeave } = transition;
8757
8771
  const remove2 = () => {
@@ -8762,16 +8776,21 @@ If you want to remount the same app, move your app creation logic into a factory
8762
8776
  }
8763
8777
  };
8764
8778
  const performLeave = () => {
8779
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
8765
8780
  if (el._isLeaving) {
8766
8781
  el[leaveCbKey](
8767
8782
  true
8768
8783
  /* cancelled */
8769
8784
  );
8770
8785
  }
8771
- leave(el, () => {
8786
+ if (transition.persisted && !wasLeaving) {
8772
8787
  remove2();
8773
- afterLeave && afterLeave();
8774
- });
8788
+ } else {
8789
+ leave(el, () => {
8790
+ remove2();
8791
+ afterLeave && afterLeave();
8792
+ });
8793
+ }
8775
8794
  };
8776
8795
  if (delayLeave) {
8777
8796
  delayLeave(el, remove2, performLeave);
@@ -9451,13 +9470,14 @@ If you want to remount the same app, move your app creation logic into a factory
9451
9470
  suspense.isHydrating = false;
9452
9471
  } else if (!resume) {
9453
9472
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
9473
+ let hasUpdatedAnchor = false;
9454
9474
  if (delayEnter) {
9455
9475
  activeBranch.transition.afterLeave = () => {
9456
9476
  if (pendingId === suspense.pendingId) {
9457
9477
  move(
9458
9478
  pendingBranch,
9459
9479
  container2,
9460
- anchor === initialAnchor ? next(activeBranch) : anchor,
9480
+ anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor,
9461
9481
  0
9462
9482
  );
9463
9483
  queuePostFlushCb(effects);
@@ -9470,6 +9490,7 @@ If you want to remount the same app, move your app creation logic into a factory
9470
9490
  if (activeBranch && !suspense.isFallbackMountPending) {
9471
9491
  if (parentNode(activeBranch.el) === container2) {
9472
9492
  anchor = next(activeBranch);
9493
+ hasUpdatedAnchor = true;
9473
9494
  }
9474
9495
  unmount(activeBranch, parentComponent2, suspense, true);
9475
9496
  if (!delayEnter && isInFallback && vnode2.ssFallback) {
@@ -10762,7 +10783,7 @@ Component that was made reactive: `,
10762
10783
  return true;
10763
10784
  }
10764
10785
 
10765
- const version = "3.5.33";
10786
+ const version = "3.5.35";
10766
10787
  const warn = warn$1 ;
10767
10788
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10768
10789
  const devtools = devtools$1 ;
@@ -11500,12 +11521,37 @@ Component that was made reactive: `,
11500
11521
  } else if (e._vts <= invoker.attached) {
11501
11522
  return;
11502
11523
  }
11503
- callWithAsyncErrorHandling(
11504
- patchStopImmediatePropagation(e, invoker.value),
11505
- instance,
11506
- 5,
11507
- [e]
11508
- );
11524
+ const value = invoker.value;
11525
+ if (isArray(value)) {
11526
+ const originalStop = e.stopImmediatePropagation;
11527
+ e.stopImmediatePropagation = () => {
11528
+ originalStop.call(e);
11529
+ e._stopped = true;
11530
+ };
11531
+ const handlers = value.slice();
11532
+ const args = [e];
11533
+ for (let i = 0; i < handlers.length; i++) {
11534
+ if (e._stopped) {
11535
+ break;
11536
+ }
11537
+ const handler = handlers[i];
11538
+ if (handler) {
11539
+ callWithAsyncErrorHandling(
11540
+ handler,
11541
+ instance,
11542
+ 5,
11543
+ args
11544
+ );
11545
+ }
11546
+ }
11547
+ } else {
11548
+ callWithAsyncErrorHandling(
11549
+ value,
11550
+ instance,
11551
+ 5,
11552
+ [e]
11553
+ );
11554
+ }
11509
11555
  };
11510
11556
  invoker.value = initialValue;
11511
11557
  invoker.attached = getNow();
@@ -11521,20 +11567,6 @@ Expected function or array of functions, received type ${typeof value}.`
11521
11567
  );
11522
11568
  return NOOP;
11523
11569
  }
11524
- function patchStopImmediatePropagation(e, value) {
11525
- if (isArray(value)) {
11526
- const originalStop = e.stopImmediatePropagation;
11527
- e.stopImmediatePropagation = () => {
11528
- originalStop.call(e);
11529
- e._stopped = true;
11530
- };
11531
- return value.map(
11532
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
11533
- );
11534
- } else {
11535
- return value;
11536
- }
11537
- }
11538
11570
 
11539
11571
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11540
11572
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;