@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
  **/
@@ -1745,9 +1745,6 @@ function targetTypeMap(rawType) {
1745
1745
  return 0 /* INVALID */;
1746
1746
  }
1747
1747
  }
1748
- function getTargetType(value) {
1749
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1750
- }
1751
1748
  // @__NO_SIDE_EFFECTS__
1752
1749
  function reactive(target) {
1753
1750
  if (/* @__PURE__ */ isReadonly(target)) {
@@ -1805,14 +1802,17 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
1805
1802
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1806
1803
  return target;
1807
1804
  }
1808
- const targetType = getTargetType(target);
1809
- if (targetType === 0 /* INVALID */) {
1805
+ if (target["__v_skip"] || !Object.isExtensible(target)) {
1810
1806
  return target;
1811
1807
  }
1812
1808
  const existingProxy = proxyMap.get(target);
1813
1809
  if (existingProxy) {
1814
1810
  return existingProxy;
1815
1811
  }
1812
+ const targetType = targetTypeMap(toRawType(target));
1813
+ if (targetType === 0 /* INVALID */) {
1814
+ return target;
1815
+ }
1816
1816
  const proxy = new Proxy(
1817
1817
  target,
1818
1818
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -3964,19 +3964,18 @@ const TeleportImpl = {
3964
3964
  target,
3965
3965
  props
3966
3966
  } = vnode;
3967
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3967
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3968
3968
  const pendingMount = pendingMounts.get(vnode);
3969
3969
  if (pendingMount) {
3970
3970
  pendingMount.flags |= 8;
3971
3971
  pendingMounts.delete(vnode);
3972
- shouldRemove = false;
3973
3972
  }
3974
3973
  if (target) {
3975
3974
  hostRemove(targetStart);
3976
3975
  hostRemove(targetAnchor);
3977
3976
  }
3978
3977
  doRemove && hostRemove(anchor);
3979
- if (shapeFlag & 16) {
3978
+ if (!pendingMount && shapeFlag & 16) {
3980
3979
  for (let i = 0; i < children.length; i++) {
3981
3980
  const child = children[i];
3982
3981
  unmount(
@@ -4947,20 +4946,16 @@ function createHydrationFunctions(rendererInternals) {
4947
4946
  slotScopeIds,
4948
4947
  optimized
4949
4948
  );
4950
- let hasWarned = false;
4951
- while (next) {
4952
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
4953
- if (!hasWarned) {
4954
- warn$1(
4955
- `Hydration children mismatch on`,
4956
- el,
4957
- `
4949
+ if (next && !isMismatchAllowed(el, 1 /* CHILDREN */)) {
4950
+ warn$1(
4951
+ `Hydration children mismatch on`,
4952
+ el,
4953
+ `
4958
4954
  Server rendered element contains more child nodes than client vdom.`
4959
- );
4960
- hasWarned = true;
4961
- }
4962
- logMismatchError();
4963
- }
4955
+ );
4956
+ logMismatchError();
4957
+ }
4958
+ while (next) {
4964
4959
  const cur = next;
4965
4960
  next = next.nextSibling;
4966
4961
  remove(cur);
@@ -5023,7 +5018,7 @@ Server rendered element contains more child nodes than client vdom.`
5023
5018
  optimized = optimized || !!parentVNode.dynamicChildren;
5024
5019
  const children = parentVNode.children;
5025
5020
  const l = children.length;
5026
- let hasWarned = false;
5021
+ let hasCheckedMismatch = false;
5027
5022
  for (let i = 0; i < l; i++) {
5028
5023
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
5029
5024
  const isText = vnode.type === Text;
@@ -5051,17 +5046,17 @@ Server rendered element contains more child nodes than client vdom.`
5051
5046
  } else if (isText && !vnode.children) {
5052
5047
  insert(vnode.el = createText(""), container);
5053
5048
  } else {
5054
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
5055
- if (!hasWarned) {
5049
+ if (!hasCheckedMismatch) {
5050
+ hasCheckedMismatch = true;
5051
+ if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
5056
5052
  warn$1(
5057
5053
  `Hydration children mismatch on`,
5058
5054
  container,
5059
5055
  `
5060
5056
  Server rendered element contains fewer child nodes than client vdom.`
5061
5057
  );
5062
- hasWarned = true;
5058
+ logMismatchError();
5063
5059
  }
5064
- logMismatchError();
5065
5060
  }
5066
5061
  patch(
5067
5062
  null,
@@ -7547,7 +7542,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7547
7542
  return vm;
7548
7543
  }
7549
7544
  }
7550
- Vue.version = `2.6.14-compat:${"3.5.34"}`;
7545
+ Vue.version = `2.6.14-compat:${"3.5.35"}`;
7551
7546
  Vue.config = singletonApp.config;
7552
7547
  Vue.use = (plugin, ...options) => {
7553
7548
  if (plugin && isFunction(plugin.install)) {
@@ -10553,9 +10548,13 @@ function baseCreateRenderer(options, createHydrationFns) {
10553
10548
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
10554
10549
  if (needTransition2) {
10555
10550
  if (moveType === 0) {
10556
- transition.beforeEnter(el);
10557
- hostInsert(el, container, anchor);
10558
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
10551
+ if (transition.persisted && !el[leaveCbKey]) {
10552
+ hostInsert(el, container, anchor);
10553
+ } else {
10554
+ transition.beforeEnter(el);
10555
+ hostInsert(el, container, anchor);
10556
+ queuePostRenderEffect(() => transition.enter(el), parentSuspense);
10557
+ }
10559
10558
  } else {
10560
10559
  const { leave, delayLeave, afterLeave } = transition;
10561
10560
  const remove2 = () => {
@@ -10566,16 +10565,21 @@ function baseCreateRenderer(options, createHydrationFns) {
10566
10565
  }
10567
10566
  };
10568
10567
  const performLeave = () => {
10568
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
10569
10569
  if (el._isLeaving) {
10570
10570
  el[leaveCbKey](
10571
10571
  true
10572
10572
  /* cancelled */
10573
10573
  );
10574
10574
  }
10575
- leave(el, () => {
10575
+ if (transition.persisted && !wasLeaving) {
10576
10576
  remove2();
10577
- afterLeave && afterLeave();
10578
- });
10577
+ } else {
10578
+ leave(el, () => {
10579
+ remove2();
10580
+ afterLeave && afterLeave();
10581
+ });
10582
+ }
10579
10583
  };
10580
10584
  if (delayLeave) {
10581
10585
  delayLeave(el, remove2, performLeave);
@@ -12670,7 +12674,7 @@ function isMemoSame(cached, memo) {
12670
12674
  return true;
12671
12675
  }
12672
12676
 
12673
- const version = "3.5.34";
12677
+ const version = "3.5.35";
12674
12678
  const warn = warn$1 ;
12675
12679
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12676
12680
  const devtools = devtools$1 ;
@@ -13515,12 +13519,37 @@ function createInvoker(initialValue, instance) {
13515
13519
  } else if (e._vts <= invoker.attached) {
13516
13520
  return;
13517
13521
  }
13518
- callWithAsyncErrorHandling(
13519
- patchStopImmediatePropagation(e, invoker.value),
13520
- instance,
13521
- 5,
13522
- [e]
13523
- );
13522
+ const value = invoker.value;
13523
+ if (isArray(value)) {
13524
+ const originalStop = e.stopImmediatePropagation;
13525
+ e.stopImmediatePropagation = () => {
13526
+ originalStop.call(e);
13527
+ e._stopped = true;
13528
+ };
13529
+ const handlers = value.slice();
13530
+ const args = [e];
13531
+ for (let i = 0; i < handlers.length; i++) {
13532
+ if (e._stopped) {
13533
+ break;
13534
+ }
13535
+ const handler = handlers[i];
13536
+ if (handler) {
13537
+ callWithAsyncErrorHandling(
13538
+ handler,
13539
+ instance,
13540
+ 5,
13541
+ args
13542
+ );
13543
+ }
13544
+ }
13545
+ } else {
13546
+ callWithAsyncErrorHandling(
13547
+ value,
13548
+ instance,
13549
+ 5,
13550
+ [e]
13551
+ );
13552
+ }
13524
13553
  };
13525
13554
  invoker.value = initialValue;
13526
13555
  invoker.attached = getNow();
@@ -13536,20 +13565,6 @@ Expected function or array of functions, received type ${typeof value}.`
13536
13565
  );
13537
13566
  return NOOP;
13538
13567
  }
13539
- function patchStopImmediatePropagation(e, value) {
13540
- if (isArray(value)) {
13541
- const originalStop = e.stopImmediatePropagation;
13542
- e.stopImmediatePropagation = () => {
13543
- originalStop.call(e);
13544
- e._stopped = true;
13545
- };
13546
- return value.map(
13547
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
13548
- );
13549
- } else {
13550
- return value;
13551
- }
13552
- }
13553
13568
 
13554
13569
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
13555
13570
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
@@ -18723,7 +18738,7 @@ const transformFor = createStructuralDirectiveTransform(
18723
18738
  const keyProp = findProp(node, `key`, false, true);
18724
18739
  keyProp && keyProp.type === 7;
18725
18740
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
18726
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
18741
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
18727
18742
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
18728
18743
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
18729
18744
  forNode.codegenNode = createVNodeCall(