@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
  **/
@@ -522,7 +522,21 @@ function createInvoker(initialValue, instance) {
522
522
  const invoker = (e) => {
523
523
  if (!e._vts) e._vts = Date.now();
524
524
  else if (e._vts <= invoker.attached) return;
525
- (0, _vue_runtime_core.callWithAsyncErrorHandling)(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
525
+ const value = invoker.value;
526
+ if ((0, _vue_shared.isArray)(value)) {
527
+ const originalStop = e.stopImmediatePropagation;
528
+ e.stopImmediatePropagation = () => {
529
+ originalStop.call(e);
530
+ e._stopped = true;
531
+ };
532
+ const handlers = value.slice();
533
+ const args = [e];
534
+ for (let i = 0; i < handlers.length; i++) {
535
+ if (e._stopped) break;
536
+ const handler = handlers[i];
537
+ if (handler) (0, _vue_runtime_core.callWithAsyncErrorHandling)(handler, instance, 5, args);
538
+ }
539
+ } else (0, _vue_runtime_core.callWithAsyncErrorHandling)(value, instance, 5, [e]);
526
540
  };
527
541
  invoker.value = initialValue;
528
542
  invoker.attached = getNow();
@@ -533,16 +547,6 @@ function sanitizeEventValue(value, propName) {
533
547
  (0, _vue_runtime_core.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}.`);
534
548
  return _vue_shared.NOOP;
535
549
  }
536
- function patchStopImmediatePropagation(e, value) {
537
- if ((0, _vue_shared.isArray)(value)) {
538
- const originalStop = e.stopImmediatePropagation;
539
- e.stopImmediatePropagation = () => {
540
- originalStop.call(e);
541
- e._stopped = true;
542
- };
543
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
544
- } else return value;
545
- }
546
550
  //#endregion
547
551
  //#region packages/runtime-dom/src/patchProp.ts
548
552
  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
  **/
@@ -514,22 +514,26 @@ function createInvoker(initialValue, instance) {
514
514
  const invoker = (e) => {
515
515
  if (!e._vts) e._vts = Date.now();
516
516
  else if (e._vts <= invoker.attached) return;
517
- (0, _vue_runtime_core.callWithAsyncErrorHandling)(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
517
+ const value = invoker.value;
518
+ if ((0, _vue_shared.isArray)(value)) {
519
+ const originalStop = e.stopImmediatePropagation;
520
+ e.stopImmediatePropagation = () => {
521
+ originalStop.call(e);
522
+ e._stopped = true;
523
+ };
524
+ const handlers = value.slice();
525
+ const args = [e];
526
+ for (let i = 0; i < handlers.length; i++) {
527
+ if (e._stopped) break;
528
+ const handler = handlers[i];
529
+ if (handler) (0, _vue_runtime_core.callWithAsyncErrorHandling)(handler, instance, 5, args);
530
+ }
531
+ } else (0, _vue_runtime_core.callWithAsyncErrorHandling)(value, instance, 5, [e]);
518
532
  };
519
533
  invoker.value = initialValue;
520
534
  invoker.attached = getNow();
521
535
  return invoker;
522
536
  }
523
- function patchStopImmediatePropagation(e, value) {
524
- if ((0, _vue_shared.isArray)(value)) {
525
- const originalStop = e.stopImmediatePropagation;
526
- e.stopImmediatePropagation = () => {
527
- originalStop.call(e);
528
- e._stopped = true;
529
- };
530
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
531
- } else return value;
532
- }
533
537
  //#endregion
534
538
  //#region packages/runtime-dom/src/patchProp.ts
535
539
  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
  **/
@@ -431,6 +431,13 @@ function warn$2(msg, ...args) {
431
431
  const notifyBuffer = [];
432
432
  let batchDepth = 0;
433
433
  let activeSub = void 0;
434
+ let runDepth = 0;
435
+ function incRunDepth() {
436
+ ++runDepth;
437
+ }
438
+ function decRunDepth() {
439
+ --runDepth;
440
+ }
434
441
  let globalVersion = 0;
435
442
  let notifyIndex = 0;
436
443
  let notifyBufferLength = 0;
@@ -504,8 +511,10 @@ function propagate(link) {
504
511
  const sub = link.sub;
505
512
  let flags = sub.flags;
506
513
  if (flags & 3) {
507
- if (!(flags & 60)) sub.flags = flags | 32;
508
- else if (!(flags & 12)) flags = 0;
514
+ if (!(flags & 60)) {
515
+ sub.flags = flags | 32;
516
+ if (runDepth) sub.flags |= 8;
517
+ } else if (!(flags & 12)) flags = 0;
509
518
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
510
519
  else if (!(flags & 48) && isValidLink(link, sub)) {
511
520
  sub.flags = flags | 40;
@@ -574,13 +583,13 @@ function checkDirty(link, sub) {
574
583
  let dirty = false;
575
584
  if (sub.flags & 16) dirty = true;
576
585
  else if ((depFlags & 17) === 17) {
586
+ const subs = dep.subs;
577
587
  if (dep.update()) {
578
- const subs = dep.subs;
579
588
  if (subs.nextSub !== void 0) shallowPropagate(subs);
580
589
  dirty = true;
581
590
  }
582
591
  } else if ((depFlags & 33) === 33) {
583
- if (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {
592
+ stack = {
584
593
  value: link,
585
594
  prev: stack
586
595
  };
@@ -595,15 +604,12 @@ function checkDirty(link, sub) {
595
604
  }
596
605
  while (checkDepth) {
597
606
  --checkDepth;
598
- const firstSub = sub.subs;
599
- const hasMultipleSubs = firstSub.nextSub !== void 0;
600
- if (hasMultipleSubs) {
601
- link = stack.value;
602
- stack = stack.prev;
603
- } else link = firstSub;
607
+ link = stack.value;
608
+ stack = stack.prev;
604
609
  if (dirty) {
610
+ const subs = sub.subs;
605
611
  if (sub.update()) {
606
- if (hasMultipleSubs) shallowPropagate(firstSub);
612
+ if (subs.nextSub !== void 0) shallowPropagate(subs);
607
613
  sub = link.sub;
608
614
  continue;
609
615
  }
@@ -615,7 +621,7 @@ function checkDirty(link, sub) {
615
621
  }
616
622
  dirty = false;
617
623
  }
618
- return dirty;
624
+ return dirty && !!sub.flags;
619
625
  } while (true);
620
626
  }
621
627
  function shallowPropagate(link) {
@@ -1216,9 +1222,6 @@ function targetTypeMap(rawType) {
1216
1222
  default: return 0;
1217
1223
  }
1218
1224
  }
1219
- function getTargetType(value) {
1220
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
1221
- }
1222
1225
  /* @__NO_SIDE_EFFECTS__ */
1223
1226
  function reactive(target) {
1224
1227
  if (/* @__PURE__ */ isReadonly(target)) return target;
@@ -1331,10 +1334,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1331
1334
  return target;
1332
1335
  }
1333
1336
  if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
1334
- const targetType = getTargetType(target);
1335
- if (targetType === 0) return target;
1337
+ if (target["__v_skip"] || !Object.isExtensible(target)) return target;
1336
1338
  const existingProxy = proxyMap.get(target);
1337
1339
  if (existingProxy) return existingProxy;
1340
+ const targetType = targetTypeMap(toRawType(target));
1341
+ if (targetType === 0) return target;
1338
1342
  const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
1339
1343
  proxyMap.set(target, proxy);
1340
1344
  return proxy;
@@ -1767,9 +1771,11 @@ var ReactiveEffect = class {
1767
1771
  if (!this.active) return this.fn();
1768
1772
  cleanup(this);
1769
1773
  const prevSub = startTracking(this);
1774
+ incRunDepth();
1770
1775
  try {
1771
1776
  return this.fn();
1772
1777
  } finally {
1778
+ decRunDepth();
1773
1779
  endTracking(this, prevSub);
1774
1780
  const flags = this.flags;
1775
1781
  if ((flags & 136) === 136) {
@@ -3151,17 +3157,16 @@ const TeleportImpl = {
3151
3157
  },
3152
3158
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
3153
3159
  const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
3154
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3160
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3155
3161
  const pendingMount = pendingMounts.get(vnode);
3156
3162
  if (pendingMount) {
3157
3163
  pendingMount.flags |= 4;
3158
3164
  pendingMounts.delete(vnode);
3159
- shouldRemove = false;
3160
3165
  }
3161
3166
  if (targetStart) hostRemove(targetStart);
3162
3167
  if (targetAnchor) hostRemove(targetAnchor);
3163
3168
  doRemove && hostRemove(anchor);
3164
- if (shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3169
+ if (!pendingMount && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3165
3170
  const child = children[i];
3166
3171
  unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3167
3172
  }
@@ -3813,15 +3818,11 @@ function createHydrationFunctions(rendererInternals) {
3813
3818
  }
3814
3819
  if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
3815
3820
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
3816
- let hasWarned = false;
3821
+ if (next && !isMismatchAllowed(el, 1)) {
3822
+ warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3823
+ logMismatchError();
3824
+ }
3817
3825
  while (next) {
3818
- if (!isMismatchAllowed(el, 1)) {
3819
- if (!hasWarned) {
3820
- warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3821
- hasWarned = true;
3822
- }
3823
- logMismatchError();
3824
- }
3825
3826
  const cur = next;
3826
3827
  next = next.nextSibling;
3827
3828
  remove(cur);
@@ -3860,7 +3861,7 @@ function createHydrationFunctions(rendererInternals) {
3860
3861
  optimized = optimized || !!parentVNode.dynamicChildren;
3861
3862
  const children = parentVNode.children;
3862
3863
  const l = children.length;
3863
- let hasWarned = false;
3864
+ let hasCheckedMismatch = false;
3864
3865
  for (let i = 0; i < l; i++) {
3865
3866
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
3866
3867
  const isText = vnode.type === Text;
@@ -3874,12 +3875,12 @@ function createHydrationFunctions(rendererInternals) {
3874
3875
  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3875
3876
  } else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
3876
3877
  else {
3877
- if (!isMismatchAllowed(container, 1)) {
3878
- if (!hasWarned) {
3878
+ if (!hasCheckedMismatch) {
3879
+ hasCheckedMismatch = true;
3880
+ if (!isMismatchAllowed(container, 1)) {
3879
3881
  warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
3880
- hasWarned = true;
3882
+ logMismatchError();
3881
3883
  }
3882
- logMismatchError();
3883
3884
  }
3884
3885
  patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
3885
3886
  }
@@ -6892,8 +6893,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6892
6893
  else hostInsert(el, container, anchor);
6893
6894
  };
6894
6895
  const performLeave = () => {
6896
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
6895
6897
  if (el._isLeaving) el[leaveCbKey](true);
6896
- leave(el, () => {
6898
+ if (transition.persisted && !wasLeaving) remove();
6899
+ else leave(el, () => {
6897
6900
  remove();
6898
6901
  afterLeave && afterLeave();
6899
6902
  });
@@ -7114,6 +7117,10 @@ function invalidateMount(hooks) {
7114
7117
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
7115
7118
  }
7116
7119
  function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
7120
+ if (force && transition.persisted && !el[leaveCbKey]) {
7121
+ insert();
7122
+ return;
7123
+ }
7117
7124
  if (force || needTransition(parentSuspense, transition)) {
7118
7125
  transition.beforeEnter(el);
7119
7126
  insert();
@@ -8360,7 +8367,7 @@ function isMemoSame(cached, memo) {
8360
8367
  }
8361
8368
  //#endregion
8362
8369
  //#region packages/runtime-core/src/index.ts
8363
- const version = "3.6.0-beta.11";
8370
+ const version = "3.6.0-beta.13";
8364
8371
  const warn = warn$1;
8365
8372
  /**
8366
8373
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8968,7 +8975,21 @@ function createInvoker(initialValue, instance) {
8968
8975
  const invoker = (e) => {
8969
8976
  if (!e._vts) e._vts = Date.now();
8970
8977
  else if (e._vts <= invoker.attached) return;
8971
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
8978
+ const value = invoker.value;
8979
+ if (isArray(value)) {
8980
+ const originalStop = e.stopImmediatePropagation;
8981
+ e.stopImmediatePropagation = () => {
8982
+ originalStop.call(e);
8983
+ e._stopped = true;
8984
+ };
8985
+ const handlers = value.slice();
8986
+ const args = [e];
8987
+ for (let i = 0; i < handlers.length; i++) {
8988
+ if (e._stopped) break;
8989
+ const handler = handlers[i];
8990
+ if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
8991
+ }
8992
+ } else callWithAsyncErrorHandling(value, instance, 5, [e]);
8972
8993
  };
8973
8994
  invoker.value = initialValue;
8974
8995
  invoker.attached = getNow();
@@ -8979,16 +9000,6 @@ function sanitizeEventValue(value, propName) {
8979
9000
  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}.`);
8980
9001
  return NOOP;
8981
9002
  }
8982
- function patchStopImmediatePropagation(e, value) {
8983
- if (isArray(value)) {
8984
- const originalStop = e.stopImmediatePropagation;
8985
- e.stopImmediatePropagation = () => {
8986
- originalStop.call(e);
8987
- e._stopped = true;
8988
- };
8989
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
8990
- } else return value;
8991
- }
8992
9003
  //#endregion
8993
9004
  //#region packages/runtime-dom/src/patchProp.ts
8994
9005
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {