vue 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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.10
2
+ * vue v3.6.0-beta.12
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.10
2
+ * vue v3.6.0-beta.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
package/dist/vue.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CompilerOptions } from "@vue/compiler-dom";
2
2
  import { RenderFunction } from "@vue/runtime-dom";
3
- import { withAsyncContext } from "@vue/runtime-vapor";
3
+ import { VaporSlot, withAsyncContext } from "@vue/runtime-vapor";
4
4
  export * from "@vue/runtime-dom";
5
5
  export * from "@vue/runtime-vapor";
6
6
 
@@ -9,4 +9,4 @@ export * from "@vue/runtime-vapor";
9
9
  //#region temp/packages/vue/src/index.d.ts
10
10
  export declare function compileToFunction(template: string | HTMLElement, options?: CompilerOptions): RenderFunction;
11
11
  //#endregion
12
- export { compileToFunction as compile, withAsyncContext };
12
+ export { type VaporSlot, compileToFunction as compile, withAsyncContext };
package/dist/vue.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CompilerOptions } from "@vue/compiler-dom";
2
2
  import { RenderFunction } from "@vue/runtime-dom";
3
- import { withAsyncContext } from "@vue/runtime-vapor";
3
+ import { VaporSlot, withAsyncContext } from "@vue/runtime-vapor";
4
4
  export * from "@vue/runtime-dom";
5
5
  export * from "@vue/runtime-vapor";
6
6
 
@@ -9,4 +9,4 @@ export * from "@vue/runtime-vapor";
9
9
  //#region temp/packages/vue/src/index.d.ts
10
10
  export declare function compileToFunction(template: string | HTMLElement, options?: CompilerOptions): RenderFunction;
11
11
  //#endregion
12
- export { compileToFunction as compile, withAsyncContext };
12
+ export { type VaporSlot, compileToFunction as compile, withAsyncContext };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.10
2
+ * vue v3.6.0-beta.12
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) {
@@ -1857,9 +1863,11 @@ var ReactiveEffect = class {
1857
1863
  if (!this.active) return this.fn();
1858
1864
  cleanup(this);
1859
1865
  const prevSub = startTracking(this);
1866
+ incRunDepth();
1860
1867
  try {
1861
1868
  return this.fn();
1862
1869
  } finally {
1870
+ decRunDepth();
1863
1871
  endTracking(this, prevSub);
1864
1872
  const flags = this.flags;
1865
1873
  if ((flags & 136) === 136) {
@@ -3155,7 +3163,7 @@ const TeleportImpl = {
3155
3163
  name: "Teleport",
3156
3164
  __isTeleport: true,
3157
3165
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
3158
- const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
3166
+ const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
3159
3167
  const disabled = isTeleportDisabled(n2.props);
3160
3168
  let { dynamicChildren } = n2;
3161
3169
  if (isHmrUpdating) {
@@ -3184,7 +3192,7 @@ const TeleportImpl = {
3184
3192
  if (pendingMounts.get(vnode) !== mountJob) return;
3185
3193
  pendingMounts.delete(vnode);
3186
3194
  if (isTeleportDisabled(vnode.props)) {
3187
- mount(vnode, container, vnode.anchor);
3195
+ mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
3188
3196
  updateCssVars(vnode, true);
3189
3197
  }
3190
3198
  mountToTarget(vnode);
@@ -3264,7 +3272,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3264
3272
  const { el, anchor, shapeFlag, children, props } = vnode;
3265
3273
  const isReorder = moveType === 2;
3266
3274
  if (isReorder) insert(el, container, parentAnchor);
3267
- if (!isReorder || isTeleportDisabled(props)) {
3275
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3268
3276
  if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
3269
3277
  }
3270
3278
  if (isReorder) insert(anchor, container, parentAnchor);
@@ -3389,8 +3397,8 @@ const BaseTransitionImpl = {
3389
3397
  const state = useTransitionState();
3390
3398
  return () => {
3391
3399
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3392
- if (!children || !children.length) return;
3393
- const child = findNonCommentChild(children);
3400
+ const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3401
+ if (!child) return;
3394
3402
  const rawProps = /* @__PURE__ */ toRaw(props);
3395
3403
  const { mode } = rawProps;
3396
3404
  checkTransitionMode(mode);
@@ -4744,6 +4752,7 @@ function createSlots(slots, dynamicSlots) {
4744
4752
  */
4745
4753
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4746
4754
  let slot = slots[name];
4755
+ if (fallback) fallback.__vdom = true;
4747
4756
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
4748
4757
  if (vaporSlot) {
4749
4758
  const ret = (openBlock(), createBlock(VaporSlot, props));
@@ -4782,9 +4791,7 @@ function ensureValidVNode(vnodes) {
4782
4791
  }
4783
4792
  function ensureVaporSlotFallback(vnodes, fallback) {
4784
4793
  let vaporSlot;
4785
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
4786
- if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
4787
- }
4794
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
4788
4795
  }
4789
4796
  //#endregion
4790
4797
  //#region packages/runtime-core/src/helpers/toHandlers.ts
@@ -5156,9 +5163,14 @@ function withAsyncContext(getAwaitable) {
5156
5163
  setCurrentInstance(null, void 0);
5157
5164
  if (inSSRSetup) setInSSRSetupState(false);
5158
5165
  const restore = () => {
5166
+ const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5159
5167
  setCurrentInstance(ctx);
5160
5168
  if (inSSRSetup) setInSSRSetupState(true);
5161
- return restoreAsyncContext && restoreAsyncContext();
5169
+ const reset = restoreAsyncContext && restoreAsyncContext();
5170
+ return () => {
5171
+ if (reset) reset();
5172
+ if (resetStoppedScope) resetStoppedScope.reset();
5173
+ };
5162
5174
  };
5163
5175
  const cleanup = () => {
5164
5176
  setCurrentInstance(null, void 0);
@@ -6188,7 +6200,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
6188
6200
  const receivedType = toRawType(value);
6189
6201
  const expectedValue = styleValue(value, expectedType);
6190
6202
  const receivedValue = styleValue(value, receivedType);
6191
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
6203
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
6192
6204
  message += `, got ${receivedType} `;
6193
6205
  if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
6194
6206
  return message;
@@ -6197,7 +6209,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
6197
6209
  * dev only
6198
6210
  */
6199
6211
  function styleValue(value, type) {
6200
- if (type === "String") return `"${value}"`;
6212
+ if (isSymbol(value)) return value.toString();
6213
+ else if (type === "String") return `"${value}"`;
6201
6214
  else if (type === "Number") return `${Number(value)}`;
6202
6215
  else return `${value}`;
6203
6216
  }
@@ -6214,8 +6227,11 @@ function isExplicable(type) {
6214
6227
  /**
6215
6228
  * dev only
6216
6229
  */
6217
- function isBoolean(...args) {
6218
- return args.some((elem) => elem.toLowerCase() === "boolean");
6230
+ function isCoercible(...args) {
6231
+ return args.every((elem) => {
6232
+ const value = elem.toLowerCase();
6233
+ return value !== "boolean" && value !== "symbol";
6234
+ });
6219
6235
  }
6220
6236
  //#endregion
6221
6237
  //#region packages/runtime-core/src/componentSlots.ts
@@ -7398,15 +7414,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7398
7414
  if (suspense.isHydrating) suspense.isHydrating = false;
7399
7415
  else if (!resume) {
7400
7416
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
7417
+ let hasUpdatedAnchor = false;
7401
7418
  if (delayEnter) activeBranch.transition.afterLeave = () => {
7402
7419
  if (pendingId === suspense.pendingId) {
7403
- move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7420
+ move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7404
7421
  queuePostFlushCb(effects);
7405
7422
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
7406
7423
  }
7407
7424
  };
7408
7425
  if (activeBranch && !suspense.isFallbackMountPending) {
7409
- if (parentNode(activeBranch.el) === container) anchor = next(activeBranch);
7426
+ if (parentNode(activeBranch.el) === container) {
7427
+ anchor = next(activeBranch);
7428
+ hasUpdatedAnchor = true;
7429
+ }
7410
7430
  unmount(activeBranch, parentComponent, suspense, true);
7411
7431
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
7412
7432
  }
@@ -7760,11 +7780,29 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
7760
7780
  el: vnode.el,
7761
7781
  anchor: vnode.anchor,
7762
7782
  ctx: vnode.ctx,
7763
- ce: vnode.ce
7783
+ ce: vnode.ce,
7784
+ vi: vnode.vi,
7785
+ vs: cloneVaporSlotMeta(vnode),
7786
+ vb: vnode.vb
7764
7787
  };
7765
7788
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
7766
7789
  return cloned;
7767
7790
  }
7791
+ function cloneVaporSlotMeta(vnode) {
7792
+ const vaporSlot = vnode.vs;
7793
+ if (!vaporSlot) return vaporSlot;
7794
+ const cloned = {
7795
+ slot: vaporSlot.slot,
7796
+ fallback: vaporSlot.fallback,
7797
+ outletFallback: vaporSlot.outletFallback
7798
+ };
7799
+ if (vnode.el) {
7800
+ cloned.state = vaporSlot.state;
7801
+ cloned.ref = vaporSlot.ref;
7802
+ cloned.scope = vaporSlot.scope;
7803
+ }
7804
+ return cloned;
7805
+ }
7768
7806
  /**
7769
7807
  * Dev only, for HMR of hoisted vnodes reused in v-for
7770
7808
  * https://github.com/vitejs/vite/issues/2022
@@ -8420,7 +8458,7 @@ function isMemoSame(cached, memo) {
8420
8458
  }
8421
8459
  //#endregion
8422
8460
  //#region packages/runtime-core/src/index.ts
8423
- const version = "3.6.0-beta.10";
8461
+ const version = "3.6.0-beta.12";
8424
8462
  const warn = warn$1;
8425
8463
  /**
8426
8464
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8883,7 +8921,10 @@ function patchStyle(el, prev, next) {
8883
8921
  }
8884
8922
  for (const key in next) {
8885
8923
  if (key === "display") hasControlledDisplay = true;
8886
- setStyle(style, key, next[key]);
8924
+ const value = next[key];
8925
+ if (value != null) {
8926
+ if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
8927
+ } else setStyle(style, key, "");
8887
8928
  }
8888
8929
  } else if (isCssString) {
8889
8930
  if (prev !== next) {
@@ -8931,6 +8972,14 @@ function autoPrefix(style, rawName) {
8931
8972
  }
8932
8973
  return rawName;
8933
8974
  }
8975
+ /**
8976
+ * Browsers update textarea width/height directly during native resize.
8977
+ * Only special-case this common textarea path for now; other resize scenarios
8978
+ * still follow normal vnode style patching.
8979
+ */
8980
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
8981
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
8982
+ }
8934
8983
  //#endregion
8935
8984
  //#region packages/runtime-dom/src/modules/attrs.ts
8936
8985
  const xlinkNS = "http://www.w3.org/1999/xlink";
@@ -9365,7 +9414,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
9365
9414
  replacementNodes.push(child);
9366
9415
  }
9367
9416
  parent.removeChild(o);
9368
- slotReplacements.set(o, replacementNodes);
9417
+ slotReplacements.set(o, {
9418
+ nodes: replacementNodes,
9419
+ usedFallback: !content
9420
+ });
9369
9421
  }
9370
9422
  this._updateSlotNodes(slotReplacements);
9371
9423
  }
@@ -12163,6 +12215,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
12163
12215
  constantCache: /* @__PURE__ */ new WeakMap(),
12164
12216
  temps: 0,
12165
12217
  identifiers: Object.create(null),
12218
+ identifierScopes: Object.create(null),
12166
12219
  scopes: {
12167
12220
  vFor: 0,
12168
12221
  vSlot: 0,
@@ -12213,8 +12266,12 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
12213
12266
  context.parent.children.splice(removalIndex, 1);
12214
12267
  },
12215
12268
  onNodeRemoved: NOOP,
12216
- addIdentifiers(exp) {},
12269
+ addIdentifiers(exp, type = "local") {},
12217
12270
  removeIdentifiers(exp) {},
12271
+ isSlotScopeIdentifier(name) {
12272
+ const scopes = context.identifierScopes[name];
12273
+ return scopes ? scopes[scopes.length - 1] === "slot" : false;
12274
+ },
12218
12275
  hoist(exp) {
12219
12276
  if (isString(exp)) exp = createSimpleExpression(exp);
12220
12277
  context.hoists.push(exp);