@vue/runtime-dom 3.5.34 → 3.5.36

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.34
2
+ * @vue/runtime-dom v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -742,12 +742,37 @@ function createInvoker(initialValue, instance) {
742
742
  } else if (e._vts <= invoker.attached) {
743
743
  return;
744
744
  }
745
- callWithAsyncErrorHandling(
746
- patchStopImmediatePropagation(e, invoker.value),
747
- instance,
748
- 5,
749
- [e]
750
- );
745
+ const value = invoker.value;
746
+ if (isArray(value)) {
747
+ const originalStop = e.stopImmediatePropagation;
748
+ e.stopImmediatePropagation = () => {
749
+ originalStop.call(e);
750
+ e._stopped = true;
751
+ };
752
+ const handlers = value.slice();
753
+ const args = [e];
754
+ for (let i = 0; i < handlers.length; i++) {
755
+ if (e._stopped) {
756
+ break;
757
+ }
758
+ const handler = handlers[i];
759
+ if (handler) {
760
+ callWithAsyncErrorHandling(
761
+ handler,
762
+ instance,
763
+ 5,
764
+ args
765
+ );
766
+ }
767
+ }
768
+ } else {
769
+ callWithAsyncErrorHandling(
770
+ value,
771
+ instance,
772
+ 5,
773
+ [e]
774
+ );
775
+ }
751
776
  };
752
777
  invoker.value = initialValue;
753
778
  invoker.attached = getNow();
@@ -763,20 +788,6 @@ Expected function or array of functions, received type ${typeof value}.`
763
788
  );
764
789
  return NOOP;
765
790
  }
766
- function patchStopImmediatePropagation(e, value) {
767
- if (isArray(value)) {
768
- const originalStop = e.stopImmediatePropagation;
769
- e.stopImmediatePropagation = () => {
770
- originalStop.call(e);
771
- e._stopped = true;
772
- };
773
- return value.map(
774
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
775
- );
776
- } else {
777
- return value;
778
- }
779
- }
780
791
 
781
792
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
782
793
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
@@ -1450,7 +1461,8 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
1450
1461
  if (children) {
1451
1462
  for (let i = 0; i < children.length; i++) {
1452
1463
  const child = children[i];
1453
- if (child.el && child.el instanceof Element) {
1464
+ if (child.el && child.el instanceof Element && // Hidden v-show nodes have no previous layout box to animate from.
1465
+ !child.el[vShowHidden]) {
1454
1466
  prevChildren.push(child);
1455
1467
  setTransitionHooks(
1456
1468
  child,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.34
2
+ * @vue/runtime-dom v3.5.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1675,9 +1675,6 @@ var VueRuntimeDOM = (function (exports) {
1675
1675
  return 0 /* INVALID */;
1676
1676
  }
1677
1677
  }
1678
- function getTargetType(value) {
1679
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1680
- }
1681
1678
  // @__NO_SIDE_EFFECTS__
1682
1679
  function reactive(target) {
1683
1680
  if (/* @__PURE__ */ isReadonly(target)) {
@@ -1735,14 +1732,17 @@ var VueRuntimeDOM = (function (exports) {
1735
1732
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1736
1733
  return target;
1737
1734
  }
1738
- const targetType = getTargetType(target);
1739
- if (targetType === 0 /* INVALID */) {
1735
+ if (target["__v_skip"] || !Object.isExtensible(target)) {
1740
1736
  return target;
1741
1737
  }
1742
1738
  const existingProxy = proxyMap.get(target);
1743
1739
  if (existingProxy) {
1744
1740
  return existingProxy;
1745
1741
  }
1742
+ const targetType = targetTypeMap(toRawType(target));
1743
+ if (targetType === 0 /* INVALID */) {
1744
+ return target;
1745
+ }
1746
1746
  const proxy = new Proxy(
1747
1747
  target,
1748
1748
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -2170,8 +2170,9 @@ var VueRuntimeDOM = (function (exports) {
2170
2170
  if (once && cb) {
2171
2171
  const _cb = cb;
2172
2172
  cb = (...args) => {
2173
- _cb(...args);
2173
+ const res = _cb(...args);
2174
2174
  watchHandle();
2175
+ return res;
2175
2176
  };
2176
2177
  }
2177
2178
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -2181,7 +2182,7 @@ var VueRuntimeDOM = (function (exports) {
2181
2182
  }
2182
2183
  if (cb) {
2183
2184
  const newValue = effect.run();
2184
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2185
+ if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2185
2186
  if (cleanup) {
2186
2187
  cleanup();
2187
2188
  }
@@ -3397,19 +3398,18 @@ var VueRuntimeDOM = (function (exports) {
3397
3398
  target,
3398
3399
  props
3399
3400
  } = vnode;
3400
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3401
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3401
3402
  const pendingMount = pendingMounts.get(vnode);
3402
3403
  if (pendingMount) {
3403
3404
  pendingMount.flags |= 8;
3404
3405
  pendingMounts.delete(vnode);
3405
- shouldRemove = false;
3406
3406
  }
3407
3407
  if (target) {
3408
3408
  hostRemove(targetStart);
3409
3409
  hostRemove(targetAnchor);
3410
3410
  }
3411
3411
  doRemove && hostRemove(anchor);
3412
- if (shapeFlag & 16) {
3412
+ if (!pendingMount && shapeFlag & 16) {
3413
3413
  for (let i = 0; i < children.length; i++) {
3414
3414
  const child = children[i];
3415
3415
  unmount(
@@ -4377,20 +4377,16 @@ var VueRuntimeDOM = (function (exports) {
4377
4377
  slotScopeIds,
4378
4378
  optimized
4379
4379
  );
4380
- let hasWarned = false;
4381
- while (next) {
4382
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
4383
- if (!hasWarned) {
4384
- warn$1(
4385
- `Hydration children mismatch on`,
4386
- el,
4387
- `
4380
+ if (next && !isMismatchAllowed(el, 1 /* CHILDREN */)) {
4381
+ warn$1(
4382
+ `Hydration children mismatch on`,
4383
+ el,
4384
+ `
4388
4385
  Server rendered element contains more child nodes than client vdom.`
4389
- );
4390
- hasWarned = true;
4391
- }
4392
- logMismatchError();
4393
- }
4386
+ );
4387
+ logMismatchError();
4388
+ }
4389
+ while (next) {
4394
4390
  const cur = next;
4395
4391
  next = next.nextSibling;
4396
4392
  remove(cur);
@@ -4453,7 +4449,7 @@ Server rendered element contains more child nodes than client vdom.`
4453
4449
  optimized = optimized || !!parentVNode.dynamicChildren;
4454
4450
  const children = parentVNode.children;
4455
4451
  const l = children.length;
4456
- let hasWarned = false;
4452
+ let hasCheckedMismatch = false;
4457
4453
  for (let i = 0; i < l; i++) {
4458
4454
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4459
4455
  const isText = vnode.type === Text;
@@ -4481,17 +4477,17 @@ Server rendered element contains more child nodes than client vdom.`
4481
4477
  } else if (isText && !vnode.children) {
4482
4478
  insert(vnode.el = createText(""), container);
4483
4479
  } else {
4484
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4485
- if (!hasWarned) {
4480
+ if (!hasCheckedMismatch) {
4481
+ hasCheckedMismatch = true;
4482
+ if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4486
4483
  warn$1(
4487
4484
  `Hydration children mismatch on`,
4488
4485
  container,
4489
4486
  `
4490
4487
  Server rendered element contains fewer child nodes than client vdom.`
4491
4488
  );
4492
- hasWarned = true;
4489
+ logMismatchError();
4493
4490
  }
4494
- logMismatchError();
4495
4491
  }
4496
4492
  patch(
4497
4493
  null,
@@ -4971,13 +4967,21 @@ Server rendered element contains fewer child nodes than client vdom.`
4971
4967
  const loaded = ref(false);
4972
4968
  const error = ref();
4973
4969
  const delayed = ref(!!delay);
4970
+ let timeoutTimer;
4971
+ let delayTimer;
4972
+ onUnmounted(() => {
4973
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4974
+ if (delayTimer != null) clearTimeout(delayTimer);
4975
+ });
4974
4976
  if (delay) {
4975
- setTimeout(() => {
4977
+ delayTimer = setTimeout(() => {
4978
+ if (instance.isUnmounted) return;
4976
4979
  delayed.value = false;
4977
4980
  }, delay);
4978
4981
  }
4979
4982
  if (timeout != null) {
4980
- setTimeout(() => {
4983
+ timeoutTimer = setTimeout(() => {
4984
+ if (instance.isUnmounted) return;
4981
4985
  if (!loaded.value && !error.value) {
4982
4986
  const err = new Error(
4983
4987
  `Async component timed out after ${timeout}ms.`
@@ -4988,11 +4992,16 @@ Server rendered element contains fewer child nodes than client vdom.`
4988
4992
  }, timeout);
4989
4993
  }
4990
4994
  load().then(() => {
4995
+ if (instance.isUnmounted) return;
4991
4996
  loaded.value = true;
4992
4997
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
4993
4998
  instance.parent.update();
4994
4999
  }
4995
5000
  }).catch((err) => {
5001
+ if (instance.isUnmounted) {
5002
+ pendingRequest = null;
5003
+ return;
5004
+ }
4996
5005
  onError(err);
4997
5006
  error.value = err;
4998
5007
  });
@@ -6562,13 +6571,20 @@ If you want to remount the same app, move your app creation logic into a factory
6562
6571
  return;
6563
6572
  }
6564
6573
  const rawProps = i.vnode.props;
6565
- if (!(rawProps && // check if parent has passed v-model
6566
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
6574
+ const hasVModel = !!(rawProps && // check if parent has passed v-model
6575
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps));
6576
+ if (!hasVModel) {
6567
6577
  localValue = value;
6568
6578
  trigger();
6569
6579
  }
6570
6580
  i.emit(`update:${name}`, emittedValue);
6571
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
6581
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || // #13524: browsers differ in when they flush microtasks between
6582
+ // event listeners. If a v-model listener emits an intermediate value
6583
+ // and a following listener restores the model to its previous prop
6584
+ // value before parent updates are flushed, the parent render can be
6585
+ // deduped as having no prop change. Force a local update so DOM state
6586
+ // such as an input's value is synchronized back to the current model.
6587
+ hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) {
6572
6588
  trigger();
6573
6589
  }
6574
6590
  prevSetValue = value;
@@ -8764,9 +8780,13 @@ If you want to remount the same app, move your app creation logic into a factory
8764
8780
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
8765
8781
  if (needTransition2) {
8766
8782
  if (moveType === 0) {
8767
- transition.beforeEnter(el);
8768
- hostInsert(el, container, anchor);
8769
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
8783
+ if (transition.persisted && !el[leaveCbKey]) {
8784
+ hostInsert(el, container, anchor);
8785
+ } else {
8786
+ transition.beforeEnter(el);
8787
+ hostInsert(el, container, anchor);
8788
+ queuePostRenderEffect(() => transition.enter(el), parentSuspense);
8789
+ }
8770
8790
  } else {
8771
8791
  const { leave, delayLeave, afterLeave } = transition;
8772
8792
  const remove2 = () => {
@@ -8777,16 +8797,21 @@ If you want to remount the same app, move your app creation logic into a factory
8777
8797
  }
8778
8798
  };
8779
8799
  const performLeave = () => {
8800
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
8780
8801
  if (el._isLeaving) {
8781
8802
  el[leaveCbKey](
8782
8803
  true
8783
8804
  /* cancelled */
8784
8805
  );
8785
8806
  }
8786
- leave(el, () => {
8807
+ if (transition.persisted && !wasLeaving) {
8787
8808
  remove2();
8788
- afterLeave && afterLeave();
8789
- });
8809
+ } else {
8810
+ leave(el, () => {
8811
+ remove2();
8812
+ afterLeave && afterLeave();
8813
+ });
8814
+ }
8790
8815
  };
8791
8816
  if (delayLeave) {
8792
8817
  delayLeave(el, remove2, performLeave);
@@ -10779,7 +10804,7 @@ Component that was made reactive: `,
10779
10804
  return true;
10780
10805
  }
10781
10806
 
10782
- const version = "3.5.34";
10807
+ const version = "3.5.36";
10783
10808
  const warn = warn$1 ;
10784
10809
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10785
10810
  const devtools = devtools$1 ;
@@ -11517,12 +11542,37 @@ Component that was made reactive: `,
11517
11542
  } else if (e._vts <= invoker.attached) {
11518
11543
  return;
11519
11544
  }
11520
- callWithAsyncErrorHandling(
11521
- patchStopImmediatePropagation(e, invoker.value),
11522
- instance,
11523
- 5,
11524
- [e]
11525
- );
11545
+ const value = invoker.value;
11546
+ if (isArray(value)) {
11547
+ const originalStop = e.stopImmediatePropagation;
11548
+ e.stopImmediatePropagation = () => {
11549
+ originalStop.call(e);
11550
+ e._stopped = true;
11551
+ };
11552
+ const handlers = value.slice();
11553
+ const args = [e];
11554
+ for (let i = 0; i < handlers.length; i++) {
11555
+ if (e._stopped) {
11556
+ break;
11557
+ }
11558
+ const handler = handlers[i];
11559
+ if (handler) {
11560
+ callWithAsyncErrorHandling(
11561
+ handler,
11562
+ instance,
11563
+ 5,
11564
+ args
11565
+ );
11566
+ }
11567
+ }
11568
+ } else {
11569
+ callWithAsyncErrorHandling(
11570
+ value,
11571
+ instance,
11572
+ 5,
11573
+ [e]
11574
+ );
11575
+ }
11526
11576
  };
11527
11577
  invoker.value = initialValue;
11528
11578
  invoker.attached = getNow();
@@ -11538,20 +11588,6 @@ Expected function or array of functions, received type ${typeof value}.`
11538
11588
  );
11539
11589
  return NOOP;
11540
11590
  }
11541
- function patchStopImmediatePropagation(e, value) {
11542
- if (isArray(value)) {
11543
- const originalStop = e.stopImmediatePropagation;
11544
- e.stopImmediatePropagation = () => {
11545
- originalStop.call(e);
11546
- e._stopped = true;
11547
- };
11548
- return value.map(
11549
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
11550
- );
11551
- } else {
11552
- return value;
11553
- }
11554
- }
11555
11591
 
11556
11592
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11557
11593
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
@@ -12213,7 +12249,8 @@ Expected function or array of functions, received type ${typeof value}.`
12213
12249
  if (children) {
12214
12250
  for (let i = 0; i < children.length; i++) {
12215
12251
  const child = children[i];
12216
- if (child.el && child.el instanceof Element) {
12252
+ if (child.el && child.el instanceof Element && // Hidden v-show nodes have no previous layout box to animate from.
12253
+ !child.el[vShowHidden]) {
12217
12254
  prevChildren.push(child);
12218
12255
  setTransitionHooks(
12219
12256
  child,