@vue/compat 3.5.34 → 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/compat v3.5.34
2
+ * @vue/compat v3.5.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1672,9 +1672,6 @@ function targetTypeMap(rawType) {
1672
1672
  return 0 /* INVALID */;
1673
1673
  }
1674
1674
  }
1675
- function getTargetType(value) {
1676
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1677
- }
1678
1675
  // @__NO_SIDE_EFFECTS__
1679
1676
  function reactive(target) {
1680
1677
  if (/* @__PURE__ */ isReadonly(target)) {
@@ -1732,14 +1729,17 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
1732
1729
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1733
1730
  return target;
1734
1731
  }
1735
- const targetType = getTargetType(target);
1736
- if (targetType === 0 /* INVALID */) {
1732
+ if (target["__v_skip"] || !Object.isExtensible(target)) {
1737
1733
  return target;
1738
1734
  }
1739
1735
  const existingProxy = proxyMap.get(target);
1740
1736
  if (existingProxy) {
1741
1737
  return existingProxy;
1742
1738
  }
1739
+ const targetType = targetTypeMap(toRawType(target));
1740
+ if (targetType === 0 /* INVALID */) {
1741
+ return target;
1742
+ }
1743
1743
  const proxy = new Proxy(
1744
1744
  target,
1745
1745
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -3891,19 +3891,18 @@ const TeleportImpl = {
3891
3891
  target,
3892
3892
  props
3893
3893
  } = vnode;
3894
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3894
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3895
3895
  const pendingMount = pendingMounts.get(vnode);
3896
3896
  if (pendingMount) {
3897
3897
  pendingMount.flags |= 8;
3898
3898
  pendingMounts.delete(vnode);
3899
- shouldRemove = false;
3900
3899
  }
3901
3900
  if (target) {
3902
3901
  hostRemove(targetStart);
3903
3902
  hostRemove(targetAnchor);
3904
3903
  }
3905
3904
  doRemove && hostRemove(anchor);
3906
- if (shapeFlag & 16) {
3905
+ if (!pendingMount && shapeFlag & 16) {
3907
3906
  for (let i = 0; i < children.length; i++) {
3908
3907
  const child = children[i];
3909
3908
  unmount(
@@ -4874,20 +4873,16 @@ function createHydrationFunctions(rendererInternals) {
4874
4873
  slotScopeIds,
4875
4874
  optimized
4876
4875
  );
4877
- let hasWarned = false;
4878
- while (next) {
4879
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
4880
- if (!hasWarned) {
4881
- warn$1(
4882
- `Hydration children mismatch on`,
4883
- el,
4884
- `
4876
+ if (next && !isMismatchAllowed(el, 1 /* CHILDREN */)) {
4877
+ warn$1(
4878
+ `Hydration children mismatch on`,
4879
+ el,
4880
+ `
4885
4881
  Server rendered element contains more child nodes than client vdom.`
4886
- );
4887
- hasWarned = true;
4888
- }
4889
- logMismatchError();
4890
- }
4882
+ );
4883
+ logMismatchError();
4884
+ }
4885
+ while (next) {
4891
4886
  const cur = next;
4892
4887
  next = next.nextSibling;
4893
4888
  remove(cur);
@@ -4950,7 +4945,7 @@ Server rendered element contains more child nodes than client vdom.`
4950
4945
  optimized = optimized || !!parentVNode.dynamicChildren;
4951
4946
  const children = parentVNode.children;
4952
4947
  const l = children.length;
4953
- let hasWarned = false;
4948
+ let hasCheckedMismatch = false;
4954
4949
  for (let i = 0; i < l; i++) {
4955
4950
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4956
4951
  const isText = vnode.type === Text;
@@ -4978,17 +4973,17 @@ Server rendered element contains more child nodes than client vdom.`
4978
4973
  } else if (isText && !vnode.children) {
4979
4974
  insert(vnode.el = createText(""), container);
4980
4975
  } else {
4981
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4982
- if (!hasWarned) {
4976
+ if (!hasCheckedMismatch) {
4977
+ hasCheckedMismatch = true;
4978
+ if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4983
4979
  warn$1(
4984
4980
  `Hydration children mismatch on`,
4985
4981
  container,
4986
4982
  `
4987
4983
  Server rendered element contains fewer child nodes than client vdom.`
4988
4984
  );
4989
- hasWarned = true;
4985
+ logMismatchError();
4990
4986
  }
4991
- logMismatchError();
4992
4987
  }
4993
4988
  patch(
4994
4989
  null,
@@ -7474,7 +7469,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7474
7469
  return vm;
7475
7470
  }
7476
7471
  }
7477
- Vue.version = `2.6.14-compat:${"3.5.34"}`;
7472
+ Vue.version = `2.6.14-compat:${"3.5.35"}`;
7478
7473
  Vue.config = singletonApp.config;
7479
7474
  Vue.use = (plugin, ...options) => {
7480
7475
  if (plugin && isFunction(plugin.install)) {
@@ -10480,9 +10475,13 @@ function baseCreateRenderer(options, createHydrationFns) {
10480
10475
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
10481
10476
  if (needTransition2) {
10482
10477
  if (moveType === 0) {
10483
- transition.beforeEnter(el);
10484
- hostInsert(el, container, anchor);
10485
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
10478
+ if (transition.persisted && !el[leaveCbKey]) {
10479
+ hostInsert(el, container, anchor);
10480
+ } else {
10481
+ transition.beforeEnter(el);
10482
+ hostInsert(el, container, anchor);
10483
+ queuePostRenderEffect(() => transition.enter(el), parentSuspense);
10484
+ }
10486
10485
  } else {
10487
10486
  const { leave, delayLeave, afterLeave } = transition;
10488
10487
  const remove2 = () => {
@@ -10493,16 +10492,21 @@ function baseCreateRenderer(options, createHydrationFns) {
10493
10492
  }
10494
10493
  };
10495
10494
  const performLeave = () => {
10495
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
10496
10496
  if (el._isLeaving) {
10497
10497
  el[leaveCbKey](
10498
10498
  true
10499
10499
  /* cancelled */
10500
10500
  );
10501
10501
  }
10502
- leave(el, () => {
10502
+ if (transition.persisted && !wasLeaving) {
10503
10503
  remove2();
10504
- afterLeave && afterLeave();
10505
- });
10504
+ } else {
10505
+ leave(el, () => {
10506
+ remove2();
10507
+ afterLeave && afterLeave();
10508
+ });
10509
+ }
10506
10510
  };
10507
10511
  if (delayLeave) {
10508
10512
  delayLeave(el, remove2, performLeave);
@@ -12597,7 +12601,7 @@ function isMemoSame(cached, memo) {
12597
12601
  return true;
12598
12602
  }
12599
12603
 
12600
- const version = "3.5.34";
12604
+ const version = "3.5.35";
12601
12605
  const warn = warn$1 ;
12602
12606
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12603
12607
  const devtools = devtools$1 ;
@@ -13442,12 +13446,37 @@ function createInvoker(initialValue, instance) {
13442
13446
  } else if (e._vts <= invoker.attached) {
13443
13447
  return;
13444
13448
  }
13445
- callWithAsyncErrorHandling(
13446
- patchStopImmediatePropagation(e, invoker.value),
13447
- instance,
13448
- 5,
13449
- [e]
13450
- );
13449
+ const value = invoker.value;
13450
+ if (isArray(value)) {
13451
+ const originalStop = e.stopImmediatePropagation;
13452
+ e.stopImmediatePropagation = () => {
13453
+ originalStop.call(e);
13454
+ e._stopped = true;
13455
+ };
13456
+ const handlers = value.slice();
13457
+ const args = [e];
13458
+ for (let i = 0; i < handlers.length; i++) {
13459
+ if (e._stopped) {
13460
+ break;
13461
+ }
13462
+ const handler = handlers[i];
13463
+ if (handler) {
13464
+ callWithAsyncErrorHandling(
13465
+ handler,
13466
+ instance,
13467
+ 5,
13468
+ args
13469
+ );
13470
+ }
13471
+ }
13472
+ } else {
13473
+ callWithAsyncErrorHandling(
13474
+ value,
13475
+ instance,
13476
+ 5,
13477
+ [e]
13478
+ );
13479
+ }
13451
13480
  };
13452
13481
  invoker.value = initialValue;
13453
13482
  invoker.attached = getNow();
@@ -13463,20 +13492,6 @@ Expected function or array of functions, received type ${typeof value}.`
13463
13492
  );
13464
13493
  return NOOP;
13465
13494
  }
13466
- function patchStopImmediatePropagation(e, value) {
13467
- if (isArray(value)) {
13468
- const originalStop = e.stopImmediatePropagation;
13469
- e.stopImmediatePropagation = () => {
13470
- originalStop.call(e);
13471
- e._stopped = true;
13472
- };
13473
- return value.map(
13474
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
13475
- );
13476
- } else {
13477
- return value;
13478
- }
13479
- }
13480
13495
 
13481
13496
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
13482
13497
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;