@vue/compat 3.6.0-beta.10 → 3.6.0-beta.12

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.6.0-beta.10
2
+ * @vue/compat v3.6.0-beta.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -522,6 +522,13 @@ var Vue = (function() {
522
522
  const notifyBuffer = [];
523
523
  let batchDepth = 0;
524
524
  let activeSub = void 0;
525
+ let runDepth = 0;
526
+ function incRunDepth() {
527
+ ++runDepth;
528
+ }
529
+ function decRunDepth() {
530
+ --runDepth;
531
+ }
525
532
  let globalVersion = 0;
526
533
  let notifyIndex = 0;
527
534
  let notifyBufferLength = 0;
@@ -595,8 +602,10 @@ var Vue = (function() {
595
602
  const sub = link.sub;
596
603
  let flags = sub.flags;
597
604
  if (flags & 3) {
598
- if (!(flags & 60)) sub.flags = flags | 32;
599
- else if (!(flags & 12)) flags = 0;
605
+ if (!(flags & 60)) {
606
+ sub.flags = flags | 32;
607
+ if (runDepth) sub.flags |= 8;
608
+ } else if (!(flags & 12)) flags = 0;
600
609
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
601
610
  else if (!(flags & 48) && isValidLink(link, sub)) {
602
611
  sub.flags = flags | 40;
@@ -665,13 +674,13 @@ var Vue = (function() {
665
674
  let dirty = false;
666
675
  if (sub.flags & 16) dirty = true;
667
676
  else if ((depFlags & 17) === 17) {
677
+ const subs = dep.subs;
668
678
  if (dep.update()) {
669
- const subs = dep.subs;
670
679
  if (subs.nextSub !== void 0) shallowPropagate(subs);
671
680
  dirty = true;
672
681
  }
673
682
  } else if ((depFlags & 33) === 33) {
674
- if (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {
683
+ stack = {
675
684
  value: link,
676
685
  prev: stack
677
686
  };
@@ -686,15 +695,12 @@ var Vue = (function() {
686
695
  }
687
696
  while (checkDepth) {
688
697
  --checkDepth;
689
- const firstSub = sub.subs;
690
- const hasMultipleSubs = firstSub.nextSub !== void 0;
691
- if (hasMultipleSubs) {
692
- link = stack.value;
693
- stack = stack.prev;
694
- } else link = firstSub;
698
+ link = stack.value;
699
+ stack = stack.prev;
695
700
  if (dirty) {
701
+ const subs = sub.subs;
696
702
  if (sub.update()) {
697
- if (hasMultipleSubs) shallowPropagate(firstSub);
703
+ if (subs.nextSub !== void 0) shallowPropagate(subs);
698
704
  sub = link.sub;
699
705
  continue;
700
706
  }
@@ -706,7 +712,7 @@ var Vue = (function() {
706
712
  }
707
713
  dirty = false;
708
714
  }
709
- return dirty;
715
+ return dirty && !!sub.flags;
710
716
  } while (true);
711
717
  }
712
718
  function shallowPropagate(link) {
@@ -1858,9 +1864,11 @@ var Vue = (function() {
1858
1864
  if (!this.active) return this.fn();
1859
1865
  cleanup(this);
1860
1866
  const prevSub = startTracking(this);
1867
+ incRunDepth();
1861
1868
  try {
1862
1869
  return this.fn();
1863
1870
  } finally {
1871
+ decRunDepth();
1864
1872
  endTracking(this, prevSub);
1865
1873
  const flags = this.flags;
1866
1874
  if ((flags & 136) === 136) {
@@ -3503,7 +3511,7 @@ var Vue = (function() {
3503
3511
  name: "Teleport",
3504
3512
  __isTeleport: true,
3505
3513
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
3506
- const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
3514
+ const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
3507
3515
  const disabled = isTeleportDisabled(n2.props);
3508
3516
  let { dynamicChildren } = n2;
3509
3517
  if (isHmrUpdating) {
@@ -3532,7 +3540,7 @@ var Vue = (function() {
3532
3540
  if (pendingMounts.get(vnode) !== mountJob) return;
3533
3541
  pendingMounts.delete(vnode);
3534
3542
  if (isTeleportDisabled(vnode.props)) {
3535
- mount(vnode, container, vnode.anchor);
3543
+ mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
3536
3544
  updateCssVars(vnode, true);
3537
3545
  }
3538
3546
  mountToTarget(vnode);
@@ -3612,7 +3620,7 @@ var Vue = (function() {
3612
3620
  const { el, anchor, shapeFlag, children, props } = vnode;
3613
3621
  const isReorder = moveType === 2;
3614
3622
  if (isReorder) insert(el, container, parentAnchor);
3615
- if (!isReorder || isTeleportDisabled(props)) {
3623
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3616
3624
  if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
3617
3625
  }
3618
3626
  if (isReorder) insert(anchor, container, parentAnchor);
@@ -3737,8 +3745,8 @@ var Vue = (function() {
3737
3745
  const state = useTransitionState();
3738
3746
  return () => {
3739
3747
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3740
- if (!children || !children.length) return;
3741
- const child = findNonCommentChild(children);
3748
+ const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3749
+ if (!child) return;
3742
3750
  const rawProps = /* @__PURE__ */ toRaw(props);
3743
3751
  const { mode } = rawProps;
3744
3752
  checkTransitionMode(mode);
@@ -5308,6 +5316,7 @@ var Vue = (function() {
5308
5316
  */
5309
5317
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5310
5318
  let slot = slots[name];
5319
+ if (fallback) fallback.__vdom = true;
5311
5320
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
5312
5321
  if (vaporSlot) {
5313
5322
  const ret = (openBlock(), createBlock(VaporSlot, props));
@@ -5346,9 +5355,7 @@ var Vue = (function() {
5346
5355
  }
5347
5356
  function ensureVaporSlotFallback(vnodes, fallback) {
5348
5357
  let vaporSlot;
5349
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
5350
- if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
5351
- }
5358
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
5352
5359
  }
5353
5360
  //#endregion
5354
5361
  //#region packages/runtime-core/src/helpers/toHandlers.ts
@@ -5909,9 +5916,14 @@ var Vue = (function() {
5909
5916
  setCurrentInstance(null, void 0);
5910
5917
  if (inSSRSetup) setInSSRSetupState(false);
5911
5918
  const restore = () => {
5919
+ const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5912
5920
  setCurrentInstance(ctx);
5913
5921
  if (inSSRSetup) setInSSRSetupState(true);
5914
- return restoreAsyncContext && restoreAsyncContext();
5922
+ const reset = restoreAsyncContext && restoreAsyncContext();
5923
+ return () => {
5924
+ if (reset) reset();
5925
+ if (resetStoppedScope) resetStoppedScope.reset();
5926
+ };
5915
5927
  };
5916
5928
  const cleanup = () => {
5917
5929
  setCurrentInstance(null, void 0);
@@ -6248,7 +6260,7 @@ var Vue = (function() {
6248
6260
  if (options.el) return vm.$mount(options.el);
6249
6261
  else return vm;
6250
6262
  }
6251
- Vue.version = `2.6.14-compat:3.6.0-beta.10`;
6263
+ Vue.version = `2.6.14-compat:3.6.0-beta.12`;
6252
6264
  Vue.config = singletonApp.config;
6253
6265
  Vue.use = (plugin, ...options) => {
6254
6266
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -7384,7 +7396,7 @@ var Vue = (function() {
7384
7396
  const receivedType = toRawType(value);
7385
7397
  const expectedValue = styleValue(value, expectedType);
7386
7398
  const receivedValue = styleValue(value, receivedType);
7387
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
7399
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
7388
7400
  message += `, got ${receivedType} `;
7389
7401
  if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
7390
7402
  return message;
@@ -7393,7 +7405,8 @@ var Vue = (function() {
7393
7405
  * dev only
7394
7406
  */
7395
7407
  function styleValue(value, type) {
7396
- if (type === "String") return `"${value}"`;
7408
+ if (isSymbol(value)) return value.toString();
7409
+ else if (type === "String") return `"${value}"`;
7397
7410
  else if (type === "Number") return `${Number(value)}`;
7398
7411
  else return `${value}`;
7399
7412
  }
@@ -7410,8 +7423,11 @@ var Vue = (function() {
7410
7423
  /**
7411
7424
  * dev only
7412
7425
  */
7413
- function isBoolean(...args) {
7414
- return args.some((elem) => elem.toLowerCase() === "boolean");
7426
+ function isCoercible(...args) {
7427
+ return args.every((elem) => {
7428
+ const value = elem.toLowerCase();
7429
+ return value !== "boolean" && value !== "symbol";
7430
+ });
7415
7431
  }
7416
7432
  //#endregion
7417
7433
  //#region packages/runtime-core/src/componentSlots.ts
@@ -8606,15 +8622,19 @@ var Vue = (function() {
8606
8622
  if (suspense.isHydrating) suspense.isHydrating = false;
8607
8623
  else if (!resume) {
8608
8624
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
8625
+ let hasUpdatedAnchor = false;
8609
8626
  if (delayEnter) activeBranch.transition.afterLeave = () => {
8610
8627
  if (pendingId === suspense.pendingId) {
8611
- move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
8628
+ move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
8612
8629
  queuePostFlushCb(effects);
8613
8630
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
8614
8631
  }
8615
8632
  };
8616
8633
  if (activeBranch && !suspense.isFallbackMountPending) {
8617
- if (parentNode(activeBranch.el) === container) anchor = next(activeBranch);
8634
+ if (parentNode(activeBranch.el) === container) {
8635
+ anchor = next(activeBranch);
8636
+ hasUpdatedAnchor = true;
8637
+ }
8618
8638
  unmount(activeBranch, parentComponent, suspense, true);
8619
8639
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
8620
8640
  }
@@ -9011,12 +9031,30 @@ var Vue = (function() {
9011
9031
  el: vnode.el,
9012
9032
  anchor: vnode.anchor,
9013
9033
  ctx: vnode.ctx,
9014
- ce: vnode.ce
9034
+ ce: vnode.ce,
9035
+ vi: vnode.vi,
9036
+ vs: cloneVaporSlotMeta(vnode),
9037
+ vb: vnode.vb
9015
9038
  };
9016
9039
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
9017
9040
  defineLegacyVNodeProperties(cloned);
9018
9041
  return cloned;
9019
9042
  }
9043
+ function cloneVaporSlotMeta(vnode) {
9044
+ const vaporSlot = vnode.vs;
9045
+ if (!vaporSlot) return vaporSlot;
9046
+ const cloned = {
9047
+ slot: vaporSlot.slot,
9048
+ fallback: vaporSlot.fallback,
9049
+ outletFallback: vaporSlot.outletFallback
9050
+ };
9051
+ if (vnode.el) {
9052
+ cloned.state = vaporSlot.state;
9053
+ cloned.ref = vaporSlot.ref;
9054
+ cloned.scope = vaporSlot.scope;
9055
+ }
9056
+ return cloned;
9057
+ }
9020
9058
  /**
9021
9059
  * Dev only, for HMR of hoisted vnodes reused in v-for
9022
9060
  * https://github.com/vitejs/vite/issues/2022
@@ -9676,7 +9714,7 @@ var Vue = (function() {
9676
9714
  }
9677
9715
  //#endregion
9678
9716
  //#region packages/runtime-core/src/index.ts
9679
- const version = "3.6.0-beta.10";
9717
+ const version = "3.6.0-beta.12";
9680
9718
  const warn = warn$1;
9681
9719
  /**
9682
9720
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -10159,7 +10197,10 @@ var Vue = (function() {
10159
10197
  }
10160
10198
  for (const key in next) {
10161
10199
  if (key === "display") hasControlledDisplay = true;
10162
- setStyle(style, key, next[key]);
10200
+ const value = next[key];
10201
+ if (value != null) {
10202
+ if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
10203
+ } else setStyle(style, key, "");
10163
10204
  }
10164
10205
  } else if (isCssString) {
10165
10206
  if (prev !== next) {
@@ -10207,6 +10248,14 @@ var Vue = (function() {
10207
10248
  }
10208
10249
  return rawName;
10209
10250
  }
10251
+ /**
10252
+ * Browsers update textarea width/height directly during native resize.
10253
+ * Only special-case this common textarea path for now; other resize scenarios
10254
+ * still follow normal vnode style patching.
10255
+ */
10256
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
10257
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
10258
+ }
10210
10259
  //#endregion
10211
10260
  //#region packages/runtime-dom/src/modules/attrs.ts
10212
10261
  const xlinkNS = "http://www.w3.org/1999/xlink";
@@ -10666,7 +10715,10 @@ var Vue = (function() {
10666
10715
  replacementNodes.push(child);
10667
10716
  }
10668
10717
  parent.removeChild(o);
10669
- slotReplacements.set(o, replacementNodes);
10718
+ slotReplacements.set(o, {
10719
+ nodes: replacementNodes,
10720
+ usedFallback: !content
10721
+ });
10670
10722
  }
10671
10723
  this._updateSlotNodes(slotReplacements);
10672
10724
  }
@@ -13588,6 +13640,7 @@ var Vue = (function() {
13588
13640
  constantCache: /* @__PURE__ */ new WeakMap(),
13589
13641
  temps: 0,
13590
13642
  identifiers: Object.create(null),
13643
+ identifierScopes: Object.create(null),
13591
13644
  scopes: {
13592
13645
  vFor: 0,
13593
13646
  vSlot: 0,
@@ -13638,8 +13691,12 @@ var Vue = (function() {
13638
13691
  context.parent.children.splice(removalIndex, 1);
13639
13692
  },
13640
13693
  onNodeRemoved: NOOP,
13641
- addIdentifiers(exp) {},
13694
+ addIdentifiers(exp, type = "local") {},
13642
13695
  removeIdentifiers(exp) {},
13696
+ isSlotScopeIdentifier(name) {
13697
+ const scopes = context.identifierScopes[name];
13698
+ return scopes ? scopes[scopes.length - 1] === "slot" : false;
13699
+ },
13643
13700
  hoist(exp) {
13644
13701
  if (isString(exp)) exp = createSimpleExpression(exp);
13645
13702
  context.hoists.push(exp);