@vue/runtime-dom 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/runtime-dom v3.5.33
2
+ * @vue/runtime-dom v3.5.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -677,12 +677,37 @@ function createInvoker(initialValue, instance) {
677
677
  } else if (e._vts <= invoker.attached) {
678
678
  return;
679
679
  }
680
- runtimeCore.callWithAsyncErrorHandling(
681
- patchStopImmediatePropagation(e, invoker.value),
682
- instance,
683
- 5,
684
- [e]
685
- );
680
+ const value = invoker.value;
681
+ if (shared.isArray(value)) {
682
+ const originalStop = e.stopImmediatePropagation;
683
+ e.stopImmediatePropagation = () => {
684
+ originalStop.call(e);
685
+ e._stopped = true;
686
+ };
687
+ const handlers = value.slice();
688
+ const args = [e];
689
+ for (let i = 0; i < handlers.length; i++) {
690
+ if (e._stopped) {
691
+ break;
692
+ }
693
+ const handler = handlers[i];
694
+ if (handler) {
695
+ runtimeCore.callWithAsyncErrorHandling(
696
+ handler,
697
+ instance,
698
+ 5,
699
+ args
700
+ );
701
+ }
702
+ }
703
+ } else {
704
+ runtimeCore.callWithAsyncErrorHandling(
705
+ value,
706
+ instance,
707
+ 5,
708
+ [e]
709
+ );
710
+ }
686
711
  };
687
712
  invoker.value = initialValue;
688
713
  invoker.attached = getNow();
@@ -698,20 +723,6 @@ Expected function or array of functions, received type ${typeof value}.`
698
723
  );
699
724
  return shared.NOOP;
700
725
  }
701
- function patchStopImmediatePropagation(e, value) {
702
- if (shared.isArray(value)) {
703
- const originalStop = e.stopImmediatePropagation;
704
- e.stopImmediatePropagation = () => {
705
- originalStop.call(e);
706
- e._stopped = true;
707
- };
708
- return value.map(
709
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
710
- );
711
- } else {
712
- return value;
713
- }
714
- }
715
726
 
716
727
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
717
728
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.33
2
+ * @vue/runtime-dom v3.5.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -659,31 +659,42 @@ function createInvoker(initialValue, instance) {
659
659
  } else if (e._vts <= invoker.attached) {
660
660
  return;
661
661
  }
662
- runtimeCore.callWithAsyncErrorHandling(
663
- patchStopImmediatePropagation(e, invoker.value),
664
- instance,
665
- 5,
666
- [e]
667
- );
662
+ const value = invoker.value;
663
+ if (shared.isArray(value)) {
664
+ const originalStop = e.stopImmediatePropagation;
665
+ e.stopImmediatePropagation = () => {
666
+ originalStop.call(e);
667
+ e._stopped = true;
668
+ };
669
+ const handlers = value.slice();
670
+ const args = [e];
671
+ for (let i = 0; i < handlers.length; i++) {
672
+ if (e._stopped) {
673
+ break;
674
+ }
675
+ const handler = handlers[i];
676
+ if (handler) {
677
+ runtimeCore.callWithAsyncErrorHandling(
678
+ handler,
679
+ instance,
680
+ 5,
681
+ args
682
+ );
683
+ }
684
+ }
685
+ } else {
686
+ runtimeCore.callWithAsyncErrorHandling(
687
+ value,
688
+ instance,
689
+ 5,
690
+ [e]
691
+ );
692
+ }
668
693
  };
669
694
  invoker.value = initialValue;
670
695
  invoker.attached = getNow();
671
696
  return invoker;
672
697
  }
673
- function patchStopImmediatePropagation(e, value) {
674
- if (shared.isArray(value)) {
675
- const originalStop = e.stopImmediatePropagation;
676
- e.stopImmediatePropagation = () => {
677
- originalStop.call(e);
678
- e._stopped = true;
679
- };
680
- return value.map(
681
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
682
- );
683
- } else {
684
- return value;
685
- }
686
- }
687
698
 
688
699
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
689
700
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.33
2
+ * @vue/runtime-dom v3.5.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -354,12 +354,18 @@ class EffectScope {
354
354
  */
355
355
  this.cleanups = [];
356
356
  this._isPaused = false;
357
+ this._warnOnRun = true;
357
358
  this.__v_skip = true;
358
- this.parent = activeEffectScope;
359
359
  if (!detached && activeEffectScope) {
360
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
361
- this
362
- ) - 1;
360
+ if (activeEffectScope.active) {
361
+ this.parent = activeEffectScope;
362
+ this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
363
+ this
364
+ ) - 1;
365
+ } else {
366
+ this._active = false;
367
+ this._warnOnRun = false;
368
+ }
363
369
  }
364
370
  }
365
371
  get active() {
@@ -407,7 +413,7 @@ class EffectScope {
407
413
  } finally {
408
414
  activeEffectScope = currentEffectScope;
409
415
  }
410
- } else {
416
+ } else if (this._warnOnRun) {
411
417
  warn$2(`cannot run an inactive effect scope.`);
412
418
  }
413
419
  }
@@ -513,8 +519,12 @@ class ReactiveEffect {
513
519
  */
514
520
  this.cleanup = void 0;
515
521
  this.scheduler = void 0;
516
- if (activeEffectScope && activeEffectScope.active) {
517
- activeEffectScope.effects.push(this);
522
+ if (activeEffectScope) {
523
+ if (activeEffectScope.active) {
524
+ activeEffectScope.effects.push(this);
525
+ } else {
526
+ this.flags &= -2;
527
+ }
518
528
  }
519
529
  }
520
530
  pause() {
@@ -1662,9 +1672,6 @@ function targetTypeMap(rawType) {
1662
1672
  return 0 /* INVALID */;
1663
1673
  }
1664
1674
  }
1665
- function getTargetType(value) {
1666
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1667
- }
1668
1675
  // @__NO_SIDE_EFFECTS__
1669
1676
  function reactive(target) {
1670
1677
  if (/* @__PURE__ */ isReadonly(target)) {
@@ -1722,14 +1729,17 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
1722
1729
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1723
1730
  return target;
1724
1731
  }
1725
- const targetType = getTargetType(target);
1726
- if (targetType === 0 /* INVALID */) {
1732
+ if (target["__v_skip"] || !Object.isExtensible(target)) {
1727
1733
  return target;
1728
1734
  }
1729
1735
  const existingProxy = proxyMap.get(target);
1730
1736
  if (existingProxy) {
1731
1737
  return existingProxy;
1732
1738
  }
1739
+ const targetType = targetTypeMap(toRawType(target));
1740
+ if (targetType === 0 /* INVALID */) {
1741
+ return target;
1742
+ }
1733
1743
  const proxy = new Proxy(
1734
1744
  target,
1735
1745
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -3412,19 +3422,18 @@ const TeleportImpl = {
3412
3422
  target,
3413
3423
  props
3414
3424
  } = vnode;
3415
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3425
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3416
3426
  const pendingMount = pendingMounts.get(vnode);
3417
3427
  if (pendingMount) {
3418
3428
  pendingMount.flags |= 8;
3419
3429
  pendingMounts.delete(vnode);
3420
- shouldRemove = false;
3421
3430
  }
3422
3431
  if (target) {
3423
3432
  hostRemove(targetStart);
3424
3433
  hostRemove(targetAnchor);
3425
3434
  }
3426
3435
  doRemove && hostRemove(anchor);
3427
- if (shapeFlag & 16) {
3436
+ if (!pendingMount && shapeFlag & 16) {
3428
3437
  for (let i = 0; i < children.length; i++) {
3429
3438
  const child = children[i];
3430
3439
  unmount(
@@ -4392,20 +4401,16 @@ function createHydrationFunctions(rendererInternals) {
4392
4401
  slotScopeIds,
4393
4402
  optimized
4394
4403
  );
4395
- let hasWarned = false;
4396
- while (next) {
4397
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
4398
- if (!hasWarned) {
4399
- warn$1(
4400
- `Hydration children mismatch on`,
4401
- el,
4402
- `
4404
+ if (next && !isMismatchAllowed(el, 1 /* CHILDREN */)) {
4405
+ warn$1(
4406
+ `Hydration children mismatch on`,
4407
+ el,
4408
+ `
4403
4409
  Server rendered element contains more child nodes than client vdom.`
4404
- );
4405
- hasWarned = true;
4406
- }
4407
- logMismatchError();
4408
- }
4410
+ );
4411
+ logMismatchError();
4412
+ }
4413
+ while (next) {
4409
4414
  const cur = next;
4410
4415
  next = next.nextSibling;
4411
4416
  remove(cur);
@@ -4468,7 +4473,7 @@ Server rendered element contains more child nodes than client vdom.`
4468
4473
  optimized = optimized || !!parentVNode.dynamicChildren;
4469
4474
  const children = parentVNode.children;
4470
4475
  const l = children.length;
4471
- let hasWarned = false;
4476
+ let hasCheckedMismatch = false;
4472
4477
  for (let i = 0; i < l; i++) {
4473
4478
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4474
4479
  const isText = vnode.type === Text;
@@ -4496,17 +4501,17 @@ Server rendered element contains more child nodes than client vdom.`
4496
4501
  } else if (isText && !vnode.children) {
4497
4502
  insert(vnode.el = createText(""), container);
4498
4503
  } else {
4499
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4500
- if (!hasWarned) {
4504
+ if (!hasCheckedMismatch) {
4505
+ hasCheckedMismatch = true;
4506
+ if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4501
4507
  warn$1(
4502
4508
  `Hydration children mismatch on`,
4503
4509
  container,
4504
4510
  `
4505
4511
  Server rendered element contains fewer child nodes than client vdom.`
4506
4512
  );
4507
- hasWarned = true;
4513
+ logMismatchError();
4508
4514
  }
4509
- logMismatchError();
4510
4515
  }
4511
4516
  patch(
4512
4517
  null,
@@ -7442,7 +7447,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
7442
7447
  const receivedType = toRawType(value);
7443
7448
  const expectedValue = styleValue(value, expectedType);
7444
7449
  const receivedValue = styleValue(value, receivedType);
7445
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
7450
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) {
7446
7451
  message += ` with value ${expectedValue}`;
7447
7452
  }
7448
7453
  message += `, got ${receivedType} `;
@@ -7452,7 +7457,9 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
7452
7457
  return message;
7453
7458
  }
7454
7459
  function styleValue(value, type) {
7455
- if (type === "String") {
7460
+ if (isSymbol(value)) {
7461
+ return value.toString();
7462
+ } else if (type === "String") {
7456
7463
  return `"${value}"`;
7457
7464
  } else if (type === "Number") {
7458
7465
  return `${Number(value)}`;
@@ -7464,8 +7471,11 @@ function isExplicable(type) {
7464
7471
  const explicitTypes = ["string", "number", "boolean"];
7465
7472
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
7466
7473
  }
7467
- function isBoolean(...args) {
7468
- return args.some((elem) => elem.toLowerCase() === "boolean");
7474
+ function isCoercible(...args) {
7475
+ return args.every((elem) => {
7476
+ const value = elem.toLowerCase();
7477
+ return value !== "boolean" && value !== "symbol";
7478
+ });
7469
7479
  }
7470
7480
 
7471
7481
  const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
@@ -8783,9 +8793,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8783
8793
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
8784
8794
  if (needTransition2) {
8785
8795
  if (moveType === 0) {
8786
- transition.beforeEnter(el);
8787
- hostInsert(el, container, anchor);
8788
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
8796
+ if (transition.persisted && !el[leaveCbKey]) {
8797
+ hostInsert(el, container, anchor);
8798
+ } else {
8799
+ transition.beforeEnter(el);
8800
+ hostInsert(el, container, anchor);
8801
+ queuePostRenderEffect(() => transition.enter(el), parentSuspense);
8802
+ }
8789
8803
  } else {
8790
8804
  const { leave, delayLeave, afterLeave } = transition;
8791
8805
  const remove2 = () => {
@@ -8796,16 +8810,21 @@ function baseCreateRenderer(options, createHydrationFns) {
8796
8810
  }
8797
8811
  };
8798
8812
  const performLeave = () => {
8813
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
8799
8814
  if (el._isLeaving) {
8800
8815
  el[leaveCbKey](
8801
8816
  true
8802
8817
  /* cancelled */
8803
8818
  );
8804
8819
  }
8805
- leave(el, () => {
8820
+ if (transition.persisted && !wasLeaving) {
8806
8821
  remove2();
8807
- afterLeave && afterLeave();
8808
- });
8822
+ } else {
8823
+ leave(el, () => {
8824
+ remove2();
8825
+ afterLeave && afterLeave();
8826
+ });
8827
+ }
8809
8828
  };
8810
8829
  if (delayLeave) {
8811
8830
  delayLeave(el, remove2, performLeave);
@@ -9485,13 +9504,14 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9485
9504
  suspense.isHydrating = false;
9486
9505
  } else if (!resume) {
9487
9506
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
9507
+ let hasUpdatedAnchor = false;
9488
9508
  if (delayEnter) {
9489
9509
  activeBranch.transition.afterLeave = () => {
9490
9510
  if (pendingId === suspense.pendingId) {
9491
9511
  move(
9492
9512
  pendingBranch,
9493
9513
  container2,
9494
- anchor === initialAnchor ? next(activeBranch) : anchor,
9514
+ anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor,
9495
9515
  0
9496
9516
  );
9497
9517
  queuePostFlushCb(effects);
@@ -9504,6 +9524,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9504
9524
  if (activeBranch && !suspense.isFallbackMountPending) {
9505
9525
  if (parentNode(activeBranch.el) === container2) {
9506
9526
  anchor = next(activeBranch);
9527
+ hasUpdatedAnchor = true;
9507
9528
  }
9508
9529
  unmount(activeBranch, parentComponent2, suspense, true);
9509
9530
  if (!delayEnter && isInFallback && vnode2.ssFallback) {
@@ -10810,7 +10831,7 @@ function isMemoSame(cached, memo) {
10810
10831
  return true;
10811
10832
  }
10812
10833
 
10813
- const version = "3.5.33";
10834
+ const version = "3.5.35";
10814
10835
  const warn = warn$1 ;
10815
10836
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10816
10837
  const devtools = devtools$1 ;
@@ -11567,12 +11588,37 @@ function createInvoker(initialValue, instance) {
11567
11588
  } else if (e._vts <= invoker.attached) {
11568
11589
  return;
11569
11590
  }
11570
- callWithAsyncErrorHandling(
11571
- patchStopImmediatePropagation(e, invoker.value),
11572
- instance,
11573
- 5,
11574
- [e]
11575
- );
11591
+ const value = invoker.value;
11592
+ if (isArray(value)) {
11593
+ const originalStop = e.stopImmediatePropagation;
11594
+ e.stopImmediatePropagation = () => {
11595
+ originalStop.call(e);
11596
+ e._stopped = true;
11597
+ };
11598
+ const handlers = value.slice();
11599
+ const args = [e];
11600
+ for (let i = 0; i < handlers.length; i++) {
11601
+ if (e._stopped) {
11602
+ break;
11603
+ }
11604
+ const handler = handlers[i];
11605
+ if (handler) {
11606
+ callWithAsyncErrorHandling(
11607
+ handler,
11608
+ instance,
11609
+ 5,
11610
+ args
11611
+ );
11612
+ }
11613
+ }
11614
+ } else {
11615
+ callWithAsyncErrorHandling(
11616
+ value,
11617
+ instance,
11618
+ 5,
11619
+ [e]
11620
+ );
11621
+ }
11576
11622
  };
11577
11623
  invoker.value = initialValue;
11578
11624
  invoker.attached = getNow();
@@ -11588,20 +11634,6 @@ Expected function or array of functions, received type ${typeof value}.`
11588
11634
  );
11589
11635
  return NOOP;
11590
11636
  }
11591
- function patchStopImmediatePropagation(e, value) {
11592
- if (isArray(value)) {
11593
- const originalStop = e.stopImmediatePropagation;
11594
- e.stopImmediatePropagation = () => {
11595
- originalStop.call(e);
11596
- e._stopped = true;
11597
- };
11598
- return value.map(
11599
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
11600
- );
11601
- } else {
11602
- return value;
11603
- }
11604
- }
11605
11637
 
11606
11638
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11607
11639
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;