@vue/runtime-dom 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.11
2
+ * @vue/runtime-dom v3.6.0-beta.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -598,7 +598,21 @@ function createInvoker(initialValue, instance) {
598
598
  const invoker = (e) => {
599
599
  if (!e._vts) e._vts = Date.now();
600
600
  else if (e._vts <= invoker.attached) return;
601
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
601
+ const value = invoker.value;
602
+ if (isArray(value)) {
603
+ const originalStop = e.stopImmediatePropagation;
604
+ e.stopImmediatePropagation = () => {
605
+ originalStop.call(e);
606
+ e._stopped = true;
607
+ };
608
+ const handlers = value.slice();
609
+ const args = [e];
610
+ for (let i = 0; i < handlers.length; i++) {
611
+ if (e._stopped) break;
612
+ const handler = handlers[i];
613
+ if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
614
+ }
615
+ } else callWithAsyncErrorHandling(value, instance, 5, [e]);
602
616
  };
603
617
  invoker.value = initialValue;
604
618
  invoker.attached = getNow();
@@ -609,16 +623,6 @@ function sanitizeEventValue(value, propName) {
609
623
  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}.`);
610
624
  return NOOP;
611
625
  }
612
- function patchStopImmediatePropagation(e, value) {
613
- if (isArray(value)) {
614
- const originalStop = e.stopImmediatePropagation;
615
- e.stopImmediatePropagation = () => {
616
- originalStop.call(e);
617
- e._stopped = true;
618
- };
619
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
620
- } else return value;
621
- }
622
626
  //#endregion
623
627
  //#region packages/runtime-dom/src/patchProp.ts
624
628
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.11
2
+ * @vue/runtime-dom v3.6.0-beta.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -433,6 +433,13 @@ var VueRuntimeDOM = (function(exports) {
433
433
  const notifyBuffer = [];
434
434
  let batchDepth = 0;
435
435
  let activeSub = void 0;
436
+ let runDepth = 0;
437
+ function incRunDepth() {
438
+ ++runDepth;
439
+ }
440
+ function decRunDepth() {
441
+ --runDepth;
442
+ }
436
443
  let globalVersion = 0;
437
444
  let notifyIndex = 0;
438
445
  let notifyBufferLength = 0;
@@ -506,8 +513,10 @@ var VueRuntimeDOM = (function(exports) {
506
513
  const sub = link.sub;
507
514
  let flags = sub.flags;
508
515
  if (flags & 3) {
509
- if (!(flags & 60)) sub.flags = flags | 32;
510
- else if (!(flags & 12)) flags = 0;
516
+ if (!(flags & 60)) {
517
+ sub.flags = flags | 32;
518
+ if (runDepth) sub.flags |= 8;
519
+ } else if (!(flags & 12)) flags = 0;
511
520
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
512
521
  else if (!(flags & 48) && isValidLink(link, sub)) {
513
522
  sub.flags = flags | 40;
@@ -576,13 +585,13 @@ var VueRuntimeDOM = (function(exports) {
576
585
  let dirty = false;
577
586
  if (sub.flags & 16) dirty = true;
578
587
  else if ((depFlags & 17) === 17) {
588
+ const subs = dep.subs;
579
589
  if (dep.update()) {
580
- const subs = dep.subs;
581
590
  if (subs.nextSub !== void 0) shallowPropagate(subs);
582
591
  dirty = true;
583
592
  }
584
593
  } else if ((depFlags & 33) === 33) {
585
- if (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {
594
+ stack = {
586
595
  value: link,
587
596
  prev: stack
588
597
  };
@@ -597,15 +606,12 @@ var VueRuntimeDOM = (function(exports) {
597
606
  }
598
607
  while (checkDepth) {
599
608
  --checkDepth;
600
- const firstSub = sub.subs;
601
- const hasMultipleSubs = firstSub.nextSub !== void 0;
602
- if (hasMultipleSubs) {
603
- link = stack.value;
604
- stack = stack.prev;
605
- } else link = firstSub;
609
+ link = stack.value;
610
+ stack = stack.prev;
606
611
  if (dirty) {
612
+ const subs = sub.subs;
607
613
  if (sub.update()) {
608
- if (hasMultipleSubs) shallowPropagate(firstSub);
614
+ if (subs.nextSub !== void 0) shallowPropagate(subs);
609
615
  sub = link.sub;
610
616
  continue;
611
617
  }
@@ -617,7 +623,7 @@ var VueRuntimeDOM = (function(exports) {
617
623
  }
618
624
  dirty = false;
619
625
  }
620
- return dirty;
626
+ return dirty && !!sub.flags;
621
627
  } while (true);
622
628
  }
623
629
  function shallowPropagate(link) {
@@ -1218,9 +1224,6 @@ var VueRuntimeDOM = (function(exports) {
1218
1224
  default: return 0;
1219
1225
  }
1220
1226
  }
1221
- function getTargetType(value) {
1222
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
1223
- }
1224
1227
  /* @__NO_SIDE_EFFECTS__ */
1225
1228
  function reactive(target) {
1226
1229
  if (/* @__PURE__ */ isReadonly(target)) return target;
@@ -1333,10 +1336,11 @@ var VueRuntimeDOM = (function(exports) {
1333
1336
  return target;
1334
1337
  }
1335
1338
  if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
1336
- const targetType = getTargetType(target);
1337
- if (targetType === 0) return target;
1339
+ if (target["__v_skip"] || !Object.isExtensible(target)) return target;
1338
1340
  const existingProxy = proxyMap.get(target);
1339
1341
  if (existingProxy) return existingProxy;
1342
+ const targetType = targetTypeMap(toRawType(target));
1343
+ if (targetType === 0) return target;
1340
1344
  const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
1341
1345
  proxyMap.set(target, proxy);
1342
1346
  return proxy;
@@ -1769,9 +1773,11 @@ var VueRuntimeDOM = (function(exports) {
1769
1773
  if (!this.active) return this.fn();
1770
1774
  cleanup(this);
1771
1775
  const prevSub = startTracking(this);
1776
+ incRunDepth();
1772
1777
  try {
1773
1778
  return this.fn();
1774
1779
  } finally {
1780
+ decRunDepth();
1775
1781
  endTracking(this, prevSub);
1776
1782
  const flags = this.flags;
1777
1783
  if ((flags & 136) === 136) {
@@ -3149,17 +3155,16 @@ var VueRuntimeDOM = (function(exports) {
3149
3155
  },
3150
3156
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
3151
3157
  const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
3152
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3158
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3153
3159
  const pendingMount = pendingMounts.get(vnode);
3154
3160
  if (pendingMount) {
3155
3161
  pendingMount.flags |= 4;
3156
3162
  pendingMounts.delete(vnode);
3157
- shouldRemove = false;
3158
3163
  }
3159
3164
  if (targetStart) hostRemove(targetStart);
3160
3165
  if (targetAnchor) hostRemove(targetAnchor);
3161
3166
  doRemove && hostRemove(anchor);
3162
- if (shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3167
+ if (!pendingMount && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3163
3168
  const child = children[i];
3164
3169
  unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3165
3170
  }
@@ -3811,15 +3816,11 @@ var VueRuntimeDOM = (function(exports) {
3811
3816
  }
3812
3817
  if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
3813
3818
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
3814
- let hasWarned = false;
3819
+ if (next && !isMismatchAllowed(el, 1)) {
3820
+ warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3821
+ logMismatchError();
3822
+ }
3815
3823
  while (next) {
3816
- if (!isMismatchAllowed(el, 1)) {
3817
- if (!hasWarned) {
3818
- warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3819
- hasWarned = true;
3820
- }
3821
- logMismatchError();
3822
- }
3823
3824
  const cur = next;
3824
3825
  next = next.nextSibling;
3825
3826
  remove(cur);
@@ -3858,7 +3859,7 @@ var VueRuntimeDOM = (function(exports) {
3858
3859
  optimized = optimized || !!parentVNode.dynamicChildren;
3859
3860
  const children = parentVNode.children;
3860
3861
  const l = children.length;
3861
- let hasWarned = false;
3862
+ let hasCheckedMismatch = false;
3862
3863
  for (let i = 0; i < l; i++) {
3863
3864
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
3864
3865
  const isText = vnode.type === Text;
@@ -3872,12 +3873,12 @@ var VueRuntimeDOM = (function(exports) {
3872
3873
  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3873
3874
  } else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
3874
3875
  else {
3875
- if (!isMismatchAllowed(container, 1)) {
3876
- if (!hasWarned) {
3876
+ if (!hasCheckedMismatch) {
3877
+ hasCheckedMismatch = true;
3878
+ if (!isMismatchAllowed(container, 1)) {
3877
3879
  warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
3878
- hasWarned = true;
3880
+ logMismatchError();
3879
3881
  }
3880
- logMismatchError();
3881
3882
  }
3882
3883
  patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
3883
3884
  }
@@ -6890,8 +6891,10 @@ var VueRuntimeDOM = (function(exports) {
6890
6891
  else hostInsert(el, container, anchor);
6891
6892
  };
6892
6893
  const performLeave = () => {
6894
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
6893
6895
  if (el._isLeaving) el[leaveCbKey](true);
6894
- leave(el, () => {
6896
+ if (transition.persisted && !wasLeaving) remove();
6897
+ else leave(el, () => {
6895
6898
  remove();
6896
6899
  afterLeave && afterLeave();
6897
6900
  });
@@ -7112,6 +7115,10 @@ var VueRuntimeDOM = (function(exports) {
7112
7115
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
7113
7116
  }
7114
7117
  function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
7118
+ if (force && transition.persisted && !el[leaveCbKey]) {
7119
+ insert();
7120
+ return;
7121
+ }
7115
7122
  if (force || needTransition(parentSuspense, transition)) {
7116
7123
  transition.beforeEnter(el);
7117
7124
  insert();
@@ -8358,7 +8365,7 @@ var VueRuntimeDOM = (function(exports) {
8358
8365
  }
8359
8366
  //#endregion
8360
8367
  //#region packages/runtime-core/src/index.ts
8361
- const version = "3.6.0-beta.11";
8368
+ const version = "3.6.0-beta.13";
8362
8369
  const warn = warn$1;
8363
8370
  /**
8364
8371
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8966,7 +8973,21 @@ var VueRuntimeDOM = (function(exports) {
8966
8973
  const invoker = (e) => {
8967
8974
  if (!e._vts) e._vts = Date.now();
8968
8975
  else if (e._vts <= invoker.attached) return;
8969
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
8976
+ const value = invoker.value;
8977
+ if (isArray(value)) {
8978
+ const originalStop = e.stopImmediatePropagation;
8979
+ e.stopImmediatePropagation = () => {
8980
+ originalStop.call(e);
8981
+ e._stopped = true;
8982
+ };
8983
+ const handlers = value.slice();
8984
+ const args = [e];
8985
+ for (let i = 0; i < handlers.length; i++) {
8986
+ if (e._stopped) break;
8987
+ const handler = handlers[i];
8988
+ if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
8989
+ }
8990
+ } else callWithAsyncErrorHandling(value, instance, 5, [e]);
8970
8991
  };
8971
8992
  invoker.value = initialValue;
8972
8993
  invoker.attached = getNow();
@@ -8977,16 +8998,6 @@ var VueRuntimeDOM = (function(exports) {
8977
8998
  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}.`);
8978
8999
  return NOOP;
8979
9000
  }
8980
- function patchStopImmediatePropagation(e, value) {
8981
- if (isArray(value)) {
8982
- const originalStop = e.stopImmediatePropagation;
8983
- e.stopImmediatePropagation = () => {
8984
- originalStop.call(e);
8985
- e._stopped = true;
8986
- };
8987
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
8988
- } else return value;
8989
- }
8990
9001
  //#endregion
8991
9002
  //#region packages/runtime-dom/src/patchProp.ts
8992
9003
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {