vue 3.6.0-beta.11 → 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.11
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.11
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.11
2
+ * vue v3.6.0-beta.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -521,6 +521,13 @@ function warn$2(msg, ...args) {
521
521
  const notifyBuffer = [];
522
522
  let batchDepth = 0;
523
523
  let activeSub = void 0;
524
+ let runDepth = 0;
525
+ function incRunDepth() {
526
+ ++runDepth;
527
+ }
528
+ function decRunDepth() {
529
+ --runDepth;
530
+ }
524
531
  let globalVersion = 0;
525
532
  let notifyIndex = 0;
526
533
  let notifyBufferLength = 0;
@@ -594,8 +601,10 @@ function propagate(link) {
594
601
  const sub = link.sub;
595
602
  let flags = sub.flags;
596
603
  if (flags & 3) {
597
- if (!(flags & 60)) sub.flags = flags | 32;
598
- else if (!(flags & 12)) flags = 0;
604
+ if (!(flags & 60)) {
605
+ sub.flags = flags | 32;
606
+ if (runDepth) sub.flags |= 8;
607
+ } else if (!(flags & 12)) flags = 0;
599
608
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
600
609
  else if (!(flags & 48) && isValidLink(link, sub)) {
601
610
  sub.flags = flags | 40;
@@ -664,13 +673,13 @@ function checkDirty(link, sub) {
664
673
  let dirty = false;
665
674
  if (sub.flags & 16) dirty = true;
666
675
  else if ((depFlags & 17) === 17) {
676
+ const subs = dep.subs;
667
677
  if (dep.update()) {
668
- const subs = dep.subs;
669
678
  if (subs.nextSub !== void 0) shallowPropagate(subs);
670
679
  dirty = true;
671
680
  }
672
681
  } else if ((depFlags & 33) === 33) {
673
- if (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {
682
+ stack = {
674
683
  value: link,
675
684
  prev: stack
676
685
  };
@@ -685,15 +694,12 @@ function checkDirty(link, sub) {
685
694
  }
686
695
  while (checkDepth) {
687
696
  --checkDepth;
688
- const firstSub = sub.subs;
689
- const hasMultipleSubs = firstSub.nextSub !== void 0;
690
- if (hasMultipleSubs) {
691
- link = stack.value;
692
- stack = stack.prev;
693
- } else link = firstSub;
697
+ link = stack.value;
698
+ stack = stack.prev;
694
699
  if (dirty) {
700
+ const subs = sub.subs;
695
701
  if (sub.update()) {
696
- if (hasMultipleSubs) shallowPropagate(firstSub);
702
+ if (subs.nextSub !== void 0) shallowPropagate(subs);
697
703
  sub = link.sub;
698
704
  continue;
699
705
  }
@@ -705,7 +711,7 @@ function checkDirty(link, sub) {
705
711
  }
706
712
  dirty = false;
707
713
  }
708
- return dirty;
714
+ return dirty && !!sub.flags;
709
715
  } while (true);
710
716
  }
711
717
  function shallowPropagate(link) {
@@ -1306,9 +1312,6 @@ function targetTypeMap(rawType) {
1306
1312
  default: return 0;
1307
1313
  }
1308
1314
  }
1309
- function getTargetType(value) {
1310
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
1311
- }
1312
1315
  /* @__NO_SIDE_EFFECTS__ */
1313
1316
  function reactive(target) {
1314
1317
  if (/* @__PURE__ */ isReadonly(target)) return target;
@@ -1421,10 +1424,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1421
1424
  return target;
1422
1425
  }
1423
1426
  if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
1424
- const targetType = getTargetType(target);
1425
- if (targetType === 0) return target;
1427
+ if (target["__v_skip"] || !Object.isExtensible(target)) return target;
1426
1428
  const existingProxy = proxyMap.get(target);
1427
1429
  if (existingProxy) return existingProxy;
1430
+ const targetType = targetTypeMap(toRawType(target));
1431
+ if (targetType === 0) return target;
1428
1432
  const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
1429
1433
  proxyMap.set(target, proxy);
1430
1434
  return proxy;
@@ -1857,9 +1861,11 @@ var ReactiveEffect = class {
1857
1861
  if (!this.active) return this.fn();
1858
1862
  cleanup(this);
1859
1863
  const prevSub = startTracking(this);
1864
+ incRunDepth();
1860
1865
  try {
1861
1866
  return this.fn();
1862
1867
  } finally {
1868
+ decRunDepth();
1863
1869
  endTracking(this, prevSub);
1864
1870
  const flags = this.flags;
1865
1871
  if ((flags & 136) === 136) {
@@ -3241,17 +3247,16 @@ const TeleportImpl = {
3241
3247
  },
3242
3248
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
3243
3249
  const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
3244
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3250
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3245
3251
  const pendingMount = pendingMounts.get(vnode);
3246
3252
  if (pendingMount) {
3247
3253
  pendingMount.flags |= 4;
3248
3254
  pendingMounts.delete(vnode);
3249
- shouldRemove = false;
3250
3255
  }
3251
3256
  if (targetStart) hostRemove(targetStart);
3252
3257
  if (targetAnchor) hostRemove(targetAnchor);
3253
3258
  doRemove && hostRemove(anchor);
3254
- if (shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3259
+ if (!pendingMount && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3255
3260
  const child = children[i];
3256
3261
  unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3257
3262
  }
@@ -3903,15 +3908,11 @@ function createHydrationFunctions(rendererInternals) {
3903
3908
  }
3904
3909
  if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
3905
3910
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
3906
- 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
+ }
3907
3915
  while (next) {
3908
- if (!isMismatchAllowed(el, 1)) {
3909
- if (!hasWarned) {
3910
- warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3911
- hasWarned = true;
3912
- }
3913
- logMismatchError();
3914
- }
3915
3916
  const cur = next;
3916
3917
  next = next.nextSibling;
3917
3918
  remove(cur);
@@ -3950,7 +3951,7 @@ function createHydrationFunctions(rendererInternals) {
3950
3951
  optimized = optimized || !!parentVNode.dynamicChildren;
3951
3952
  const children = parentVNode.children;
3952
3953
  const l = children.length;
3953
- let hasWarned = false;
3954
+ let hasCheckedMismatch = false;
3954
3955
  for (let i = 0; i < l; i++) {
3955
3956
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
3956
3957
  const isText = vnode.type === Text;
@@ -3964,12 +3965,12 @@ function createHydrationFunctions(rendererInternals) {
3964
3965
  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3965
3966
  } else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
3966
3967
  else {
3967
- if (!isMismatchAllowed(container, 1)) {
3968
- if (!hasWarned) {
3968
+ if (!hasCheckedMismatch) {
3969
+ hasCheckedMismatch = true;
3970
+ if (!isMismatchAllowed(container, 1)) {
3969
3971
  warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
3970
- hasWarned = true;
3972
+ logMismatchError();
3971
3973
  }
3972
- logMismatchError();
3973
3974
  }
3974
3975
  patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
3975
3976
  }
@@ -6982,8 +6983,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6982
6983
  else hostInsert(el, container, anchor);
6983
6984
  };
6984
6985
  const performLeave = () => {
6986
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
6985
6987
  if (el._isLeaving) el[leaveCbKey](true);
6986
- leave(el, () => {
6988
+ if (transition.persisted && !wasLeaving) remove();
6989
+ else leave(el, () => {
6987
6990
  remove();
6988
6991
  afterLeave && afterLeave();
6989
6992
  });
@@ -7204,6 +7207,10 @@ function invalidateMount(hooks) {
7204
7207
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
7205
7208
  }
7206
7209
  function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
7210
+ if (force && transition.persisted && !el[leaveCbKey]) {
7211
+ insert();
7212
+ return;
7213
+ }
7207
7214
  if (force || needTransition(parentSuspense, transition)) {
7208
7215
  transition.beforeEnter(el);
7209
7216
  insert();
@@ -8450,7 +8457,7 @@ function isMemoSame(cached, memo) {
8450
8457
  }
8451
8458
  //#endregion
8452
8459
  //#region packages/runtime-core/src/index.ts
8453
- const version = "3.6.0-beta.11";
8460
+ const version = "3.6.0-beta.13";
8454
8461
  const warn = warn$1;
8455
8462
  /**
8456
8463
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -9058,7 +9065,21 @@ function createInvoker(initialValue, instance) {
9058
9065
  const invoker = (e) => {
9059
9066
  if (!e._vts) e._vts = Date.now();
9060
9067
  else if (e._vts <= invoker.attached) return;
9061
- 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]);
9062
9083
  };
9063
9084
  invoker.value = initialValue;
9064
9085
  invoker.attached = getNow();
@@ -9069,16 +9090,6 @@ function sanitizeEventValue(value, propName) {
9069
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}.`);
9070
9091
  return NOOP;
9071
9092
  }
9072
- function patchStopImmediatePropagation(e, value) {
9073
- if (isArray(value)) {
9074
- const originalStop = e.stopImmediatePropagation;
9075
- e.stopImmediatePropagation = () => {
9076
- originalStop.call(e);
9077
- e._stopped = true;
9078
- };
9079
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
9080
- } else return value;
9081
- }
9082
9093
  //#endregion
9083
9094
  //#region packages/runtime-dom/src/patchProp.ts
9084
9095
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
@@ -12966,10 +12977,9 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
12966
12977
  const isTemplate = isTemplateNode(node);
12967
12978
  const memo = findDir(node, "memo");
12968
12979
  const keyProp = findProp(node, `key`, false, true);
12969
- const isDirKey = keyProp && keyProp.type === 7;
12980
+ keyProp && keyProp.type;
12970
12981
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
12971
- if (memo && keyExp && isDirKey) {}
12972
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
12982
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
12973
12983
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
12974
12984
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
12975
12985
  forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);