vue 3.6.0-beta.12 → 3.6.0-beta.13

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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.12
2
+ * vue v3.6.0-beta.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.12
2
+ * vue v3.6.0-beta.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.12
2
+ * vue v3.6.0-beta.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1312,9 +1312,6 @@ function targetTypeMap(rawType) {
1312
1312
  default: return 0;
1313
1313
  }
1314
1314
  }
1315
- function getTargetType(value) {
1316
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
1317
- }
1318
1315
  /* @__NO_SIDE_EFFECTS__ */
1319
1316
  function reactive(target) {
1320
1317
  if (/* @__PURE__ */ isReadonly(target)) return target;
@@ -1427,10 +1424,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1427
1424
  return target;
1428
1425
  }
1429
1426
  if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
1430
- const targetType = getTargetType(target);
1431
- if (targetType === 0) return target;
1427
+ if (target["__v_skip"] || !Object.isExtensible(target)) return target;
1432
1428
  const existingProxy = proxyMap.get(target);
1433
1429
  if (existingProxy) return existingProxy;
1430
+ const targetType = targetTypeMap(toRawType(target));
1431
+ if (targetType === 0) return target;
1434
1432
  const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
1435
1433
  proxyMap.set(target, proxy);
1436
1434
  return proxy;
@@ -3249,17 +3247,16 @@ const TeleportImpl = {
3249
3247
  },
3250
3248
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
3251
3249
  const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
3252
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3250
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3253
3251
  const pendingMount = pendingMounts.get(vnode);
3254
3252
  if (pendingMount) {
3255
3253
  pendingMount.flags |= 4;
3256
3254
  pendingMounts.delete(vnode);
3257
- shouldRemove = false;
3258
3255
  }
3259
3256
  if (targetStart) hostRemove(targetStart);
3260
3257
  if (targetAnchor) hostRemove(targetAnchor);
3261
3258
  doRemove && hostRemove(anchor);
3262
- if (shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3259
+ if (!pendingMount && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3263
3260
  const child = children[i];
3264
3261
  unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3265
3262
  }
@@ -3911,15 +3908,11 @@ function createHydrationFunctions(rendererInternals) {
3911
3908
  }
3912
3909
  if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
3913
3910
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
3914
- let hasWarned = false;
3911
+ if (next && !isMismatchAllowed(el, 1)) {
3912
+ warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3913
+ logMismatchError();
3914
+ }
3915
3915
  while (next) {
3916
- if (!isMismatchAllowed(el, 1)) {
3917
- if (!hasWarned) {
3918
- warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3919
- hasWarned = true;
3920
- }
3921
- logMismatchError();
3922
- }
3923
3916
  const cur = next;
3924
3917
  next = next.nextSibling;
3925
3918
  remove(cur);
@@ -3958,7 +3951,7 @@ function createHydrationFunctions(rendererInternals) {
3958
3951
  optimized = optimized || !!parentVNode.dynamicChildren;
3959
3952
  const children = parentVNode.children;
3960
3953
  const l = children.length;
3961
- let hasWarned = false;
3954
+ let hasCheckedMismatch = false;
3962
3955
  for (let i = 0; i < l; i++) {
3963
3956
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
3964
3957
  const isText = vnode.type === Text;
@@ -3972,12 +3965,12 @@ function createHydrationFunctions(rendererInternals) {
3972
3965
  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3973
3966
  } else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
3974
3967
  else {
3975
- if (!isMismatchAllowed(container, 1)) {
3976
- if (!hasWarned) {
3968
+ if (!hasCheckedMismatch) {
3969
+ hasCheckedMismatch = true;
3970
+ if (!isMismatchAllowed(container, 1)) {
3977
3971
  warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
3978
- hasWarned = true;
3972
+ logMismatchError();
3979
3973
  }
3980
- logMismatchError();
3981
3974
  }
3982
3975
  patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
3983
3976
  }
@@ -6990,8 +6983,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6990
6983
  else hostInsert(el, container, anchor);
6991
6984
  };
6992
6985
  const performLeave = () => {
6986
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
6993
6987
  if (el._isLeaving) el[leaveCbKey](true);
6994
- leave(el, () => {
6988
+ if (transition.persisted && !wasLeaving) remove();
6989
+ else leave(el, () => {
6995
6990
  remove();
6996
6991
  afterLeave && afterLeave();
6997
6992
  });
@@ -7212,6 +7207,10 @@ function invalidateMount(hooks) {
7212
7207
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
7213
7208
  }
7214
7209
  function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
7210
+ if (force && transition.persisted && !el[leaveCbKey]) {
7211
+ insert();
7212
+ return;
7213
+ }
7215
7214
  if (force || needTransition(parentSuspense, transition)) {
7216
7215
  transition.beforeEnter(el);
7217
7216
  insert();
@@ -8458,7 +8457,7 @@ function isMemoSame(cached, memo) {
8458
8457
  }
8459
8458
  //#endregion
8460
8459
  //#region packages/runtime-core/src/index.ts
8461
- const version = "3.6.0-beta.12";
8460
+ const version = "3.6.0-beta.13";
8462
8461
  const warn = warn$1;
8463
8462
  /**
8464
8463
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -9066,7 +9065,21 @@ function createInvoker(initialValue, instance) {
9066
9065
  const invoker = (e) => {
9067
9066
  if (!e._vts) e._vts = Date.now();
9068
9067
  else if (e._vts <= invoker.attached) return;
9069
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
9068
+ const value = invoker.value;
9069
+ if (isArray(value)) {
9070
+ const originalStop = e.stopImmediatePropagation;
9071
+ e.stopImmediatePropagation = () => {
9072
+ originalStop.call(e);
9073
+ e._stopped = true;
9074
+ };
9075
+ const handlers = value.slice();
9076
+ const args = [e];
9077
+ for (let i = 0; i < handlers.length; i++) {
9078
+ if (e._stopped) break;
9079
+ const handler = handlers[i];
9080
+ if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
9081
+ }
9082
+ } else callWithAsyncErrorHandling(value, instance, 5, [e]);
9070
9083
  };
9071
9084
  invoker.value = initialValue;
9072
9085
  invoker.attached = getNow();
@@ -9077,16 +9090,6 @@ function sanitizeEventValue(value, propName) {
9077
9090
  warn(`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?\nExpected function or array of functions, received type ${typeof value}.`);
9078
9091
  return NOOP;
9079
9092
  }
9080
- function patchStopImmediatePropagation(e, value) {
9081
- if (isArray(value)) {
9082
- const originalStop = e.stopImmediatePropagation;
9083
- e.stopImmediatePropagation = () => {
9084
- originalStop.call(e);
9085
- e._stopped = true;
9086
- };
9087
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
9088
- } else return value;
9089
- }
9090
9093
  //#endregion
9091
9094
  //#region packages/runtime-dom/src/patchProp.ts
9092
9095
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
@@ -12974,10 +12977,9 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
12974
12977
  const isTemplate = isTemplateNode(node);
12975
12978
  const memo = findDir(node, "memo");
12976
12979
  const keyProp = findProp(node, `key`, false, true);
12977
- const isDirKey = keyProp && keyProp.type === 7;
12980
+ keyProp && keyProp.type;
12978
12981
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
12979
- if (memo && keyExp && isDirKey) {}
12980
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
12982
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
12981
12983
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
12982
12984
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
12983
12985
  forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);