@vue/runtime-core 3.6.0-rc.12 → 3.6.0-rc.14
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/runtime-core.cjs.js +106 -43
- package/dist/runtime-core.cjs.prod.js +107 -44
- package/dist/runtime-core.d.ts +14 -0
- package/dist/runtime-core.esm-bundler.js +82 -47
- package/package.json +3 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.14
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -930,6 +930,16 @@ function createPathGetter(ctx, path) {
|
|
|
930
930
|
};
|
|
931
931
|
}
|
|
932
932
|
//#endregion
|
|
933
|
+
//#region packages/runtime-core/src/vaporInteropState.ts
|
|
934
|
+
/**
|
|
935
|
+
* Set by `vaporInteropPlugin`. Stays false in apps that never import the
|
|
936
|
+
* plugin, so bundlers drop the vapor-in-vdom branches of the renderer.
|
|
937
|
+
*/
|
|
938
|
+
let isVaporInteropEnabled = false;
|
|
939
|
+
function setVaporInteropEnabled() {
|
|
940
|
+
isVaporInteropEnabled = true;
|
|
941
|
+
}
|
|
942
|
+
//#endregion
|
|
933
943
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
934
944
|
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
935
945
|
const TeleportEndKey = Symbol("_vte");
|
|
@@ -1189,13 +1199,18 @@ const BaseTransitionPropsValidators = {
|
|
|
1189
1199
|
onAfterAppear: TransitionHookValidator,
|
|
1190
1200
|
onAppearCancelled: TransitionHookValidator
|
|
1191
1201
|
};
|
|
1202
|
+
let isTransitionEnabled = false;
|
|
1203
|
+
function withTransitionEnabled(value) {
|
|
1204
|
+
isTransitionEnabled = true;
|
|
1205
|
+
return value;
|
|
1206
|
+
}
|
|
1192
1207
|
function isEmptyTransitionChild(vnode, instance) {
|
|
1193
1208
|
if (vnode.type === Comment) return true;
|
|
1194
1209
|
if (vnode.type === Fragment) {
|
|
1195
1210
|
const child = (0, _vue_shared.isArray)(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1196
1211
|
return !child || isEmptyTransitionChild(child, instance);
|
|
1197
1212
|
}
|
|
1198
|
-
if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
1213
|
+
if (isVaporInteropEnabled && (vnode.type === VaporSlot || isVaporComponent(vnode.type))) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
1199
1214
|
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
1200
1215
|
}
|
|
1201
1216
|
const BaseTransitionImpl = {
|
|
@@ -1212,7 +1227,7 @@ const BaseTransitionImpl = {
|
|
|
1212
1227
|
const { mode } = rawProps;
|
|
1213
1228
|
checkTransitionMode(mode);
|
|
1214
1229
|
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
1215
|
-
if (!(instance.
|
|
1230
|
+
if (!(instance.effect.flags & 1024)) instance.update();
|
|
1216
1231
|
}) : _vue_shared.NOOP);
|
|
1217
1232
|
};
|
|
1218
1233
|
}
|
|
@@ -1232,7 +1247,7 @@ function findNonCommentChild(children) {
|
|
|
1232
1247
|
}
|
|
1233
1248
|
return child;
|
|
1234
1249
|
}
|
|
1235
|
-
const BaseTransition = BaseTransitionImpl;
|
|
1250
|
+
const BaseTransition = /*@__PURE__*/ withTransitionEnabled(BaseTransitionImpl);
|
|
1236
1251
|
function getLeavingNodesForType(state, vnode) {
|
|
1237
1252
|
const { leavingNodes } = state;
|
|
1238
1253
|
let leavingVNodesCache = leavingNodes.get(vnode.type);
|
|
@@ -1270,7 +1285,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1270
1285
|
return hooks;
|
|
1271
1286
|
}
|
|
1272
1287
|
}, props, state, instance);
|
|
1273
|
-
if (vnode.type === VaporSlot) (0, _vue_shared.extend)(hooks, {
|
|
1288
|
+
if (isVaporInteropEnabled && vnode.type === VaporSlot) (0, _vue_shared.extend)(hooks, {
|
|
1274
1289
|
__vapor: true,
|
|
1275
1290
|
props,
|
|
1276
1291
|
state,
|
|
@@ -1447,7 +1462,7 @@ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, pr
|
|
|
1447
1462
|
function setTransitionHooks(vnode, hooks) {
|
|
1448
1463
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
1449
1464
|
vnode.transition = hooks;
|
|
1450
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
1465
|
+
if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
1451
1466
|
else {
|
|
1452
1467
|
const subTree = vnode.component.subTree;
|
|
1453
1468
|
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
@@ -1486,7 +1501,7 @@ function checkTransitionMode(mode) {
|
|
|
1486
1501
|
if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") warn$1(`invalid <transition> mode: ${mode}`);
|
|
1487
1502
|
}
|
|
1488
1503
|
function getTransitionRoot(vnode) {
|
|
1489
|
-
if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
|
|
1504
|
+
if (vnode.component && (!isVaporInteropEnabled || !isVaporComponent(vnode.type))) return getTransitionRoot(vnode.component.subTree);
|
|
1490
1505
|
if (vnode.type === Fragment) {
|
|
1491
1506
|
const child = (0, _vue_shared.isArray)(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1492
1507
|
return child ? getTransitionRoot(child) : void 0;
|
|
@@ -1673,6 +1688,8 @@ const getContainerType = (container) => {
|
|
|
1673
1688
|
if (isMathMLContainer(container)) return "mathml";
|
|
1674
1689
|
};
|
|
1675
1690
|
const isComment = (node) => node.nodeType === 8;
|
|
1691
|
+
/** The data of a comment opening a range a hydration steps over as one. */
|
|
1692
|
+
const isRangeStart = (data) => data === "[" || data === "(" || (0, _vue_shared.isVaporBranchStart)(data);
|
|
1676
1693
|
function createHydrationFunctions(rendererInternals) {
|
|
1677
1694
|
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
1678
1695
|
const hydrate = (vnode, container) => {
|
|
@@ -1690,7 +1707,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1690
1707
|
};
|
|
1691
1708
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
1692
1709
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
1693
|
-
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
|
|
1710
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && (0, _vue_shared.isVaporBranchStart)(node.data));
|
|
1694
1711
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
1695
1712
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
1696
1713
|
let domType = node.nodeType;
|
|
@@ -1746,7 +1763,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1746
1763
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1747
1764
|
break;
|
|
1748
1765
|
case VaporSlot:
|
|
1749
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
1766
|
+
if (isVaporInteropEnabled) nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
1750
1767
|
break;
|
|
1751
1768
|
default: if (shapeFlag & 1) {
|
|
1752
1769
|
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
@@ -1878,7 +1895,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1878
1895
|
if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
1879
1896
|
const container = parentNode(node);
|
|
1880
1897
|
const first = nextSibling(node);
|
|
1881
|
-
const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1898
|
+
const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1882
1899
|
if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
|
|
1883
1900
|
else {
|
|
1884
1901
|
logMismatchError();
|
|
@@ -1888,7 +1905,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1888
1905
|
};
|
|
1889
1906
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
1890
1907
|
if (!isNodeMismatchAllowed(node, vnode)) {
|
|
1891
|
-
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && (node.data
|
|
1908
|
+
warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && isRangeStart(node.data) ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
|
|
1892
1909
|
logMismatchError();
|
|
1893
1910
|
}
|
|
1894
1911
|
vnode.el = null;
|
|
@@ -1915,7 +1932,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1915
1932
|
while (node) {
|
|
1916
1933
|
node = nextSibling(node);
|
|
1917
1934
|
if (node && isComment(node)) {
|
|
1918
|
-
if (node.data === open) match++;
|
|
1935
|
+
if (node.data === open || isVaporInteropEnabled && open === "[" && (0, _vue_shared.isVaporBranchStart)(node.data)) match++;
|
|
1919
1936
|
if (node.data === close) {
|
|
1920
1937
|
if (match === 0) return nextSibling(node);
|
|
1921
1938
|
else match--;
|
|
@@ -2171,9 +2188,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
2171
2188
|
return teardown;
|
|
2172
2189
|
};
|
|
2173
2190
|
function forEachElement(node, cb) {
|
|
2174
|
-
if (isComment(node) && (node.data
|
|
2191
|
+
if (isComment(node) && isRangeStart(node.data)) {
|
|
2175
2192
|
const open = node.data;
|
|
2176
|
-
const close = open === "
|
|
2193
|
+
const close = open === "(" ? ")" : "]";
|
|
2177
2194
|
let depth = 1;
|
|
2178
2195
|
let next = node.nextSibling;
|
|
2179
2196
|
while (next) {
|
|
@@ -2182,7 +2199,7 @@ function forEachElement(node, cb) {
|
|
|
2182
2199
|
} else if (isComment(next)) {
|
|
2183
2200
|
if (next.data === close) {
|
|
2184
2201
|
if (--depth === 0) break;
|
|
2185
|
-
} else if (next.data === open) depth++;
|
|
2202
|
+
} else if (close === "]" ? next.data === "[" || (0, _vue_shared.isVaporBranchStart)(next.data) : next.data === open) depth++;
|
|
2186
2203
|
}
|
|
2187
2204
|
next = next.nextSibling;
|
|
2188
2205
|
}
|
|
@@ -2285,7 +2302,7 @@ function createAsyncComponentContext(source) {
|
|
|
2285
2302
|
setPendingRequest: (request) => pendingRequest = request
|
|
2286
2303
|
};
|
|
2287
2304
|
}
|
|
2288
|
-
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
2305
|
+
const useAsyncComponentState = (delay = 200, timeout, onError, instance = currentInstance) => {
|
|
2289
2306
|
const loaded = (0, _vue_reactivity.ref)(false);
|
|
2290
2307
|
const error = (0, _vue_reactivity.ref)();
|
|
2291
2308
|
const delayed = (0, _vue_reactivity.ref)(!!delay);
|
|
@@ -2342,7 +2359,12 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
2342
2359
|
//#endregion
|
|
2343
2360
|
//#region packages/runtime-core/src/components/KeepAlive.ts
|
|
2344
2361
|
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
2345
|
-
|
|
2362
|
+
let isKeepAliveEnabled = false;
|
|
2363
|
+
function withKeepAliveEnabled(value) {
|
|
2364
|
+
isKeepAliveEnabled = true;
|
|
2365
|
+
return value;
|
|
2366
|
+
}
|
|
2367
|
+
const KeepAlive = /*@__PURE__*/ withKeepAliveEnabled({
|
|
2346
2368
|
name: `KeepAlive`,
|
|
2347
2369
|
__isKeepAlive: true,
|
|
2348
2370
|
props: {
|
|
@@ -2485,7 +2507,7 @@ const KeepAlive = {
|
|
|
2485
2507
|
return isSuspense(rawVNode.type) ? rawVNode : vnode;
|
|
2486
2508
|
};
|
|
2487
2509
|
}
|
|
2488
|
-
};
|
|
2510
|
+
});
|
|
2489
2511
|
function matches(pattern, name) {
|
|
2490
2512
|
if ((0, _vue_shared.isArray)(pattern)) return pattern.some((p) => matches(p, name));
|
|
2491
2513
|
else if ((0, _vue_shared.isString)(pattern)) return pattern.split(",").includes(name);
|
|
@@ -2734,11 +2756,12 @@ function invokeSlotFallback(fallback, owner) {
|
|
|
2734
2756
|
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2735
2757
|
if (props == null) props = {};
|
|
2736
2758
|
let slot = slots[name];
|
|
2737
|
-
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
2759
|
+
const vaporSlot = isVaporInteropEnabled && slot && slot[rawVaporSlotKey];
|
|
2738
2760
|
if (vaporSlot) {
|
|
2739
2761
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
2740
2762
|
ret.vs = {
|
|
2741
2763
|
slot: vaporSlot,
|
|
2764
|
+
name,
|
|
2742
2765
|
outlets: fallback ? [{
|
|
2743
2766
|
fallback,
|
|
2744
2767
|
owner: currentRenderingInstance
|
|
@@ -2769,7 +2792,7 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
2769
2792
|
try {
|
|
2770
2793
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2771
2794
|
let attached = false;
|
|
2772
|
-
if (fallback && validSlotContent && currentRenderingInstance) {
|
|
2795
|
+
if (isVaporInteropEnabled && fallback && validSlotContent && currentRenderingInstance) {
|
|
2773
2796
|
const interop = currentRenderingInstance.appContext.vapor;
|
|
2774
2797
|
if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
|
|
2775
2798
|
}
|
|
@@ -4454,7 +4477,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4454
4477
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4455
4478
|
break;
|
|
4456
4479
|
case VaporSlot:
|
|
4457
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
4480
|
+
if (isVaporInteropEnabled) getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
4458
4481
|
break;
|
|
4459
4482
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4460
4483
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -4588,7 +4611,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4588
4611
|
let vnodeHook;
|
|
4589
4612
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
4590
4613
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4591
|
-
if (n2.ibu) n2.ibu();
|
|
4614
|
+
if (isVaporInteropEnabled && n2.ibu) n2.ibu();
|
|
4592
4615
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4593
4616
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
4594
4617
|
if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
@@ -4622,9 +4645,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4622
4645
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
4623
4646
|
}
|
|
4624
4647
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
4625
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
4648
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || isVaporInteropEnabled && n2.iu) queuePostRenderEffect(() => {
|
|
4626
4649
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4627
|
-
n2.iu && n2.iu();
|
|
4650
|
+
isVaporInteropEnabled && n2.iu && n2.iu();
|
|
4628
4651
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
4629
4652
|
}, void 0, parentSuspense);
|
|
4630
4653
|
};
|
|
@@ -4832,7 +4855,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4832
4855
|
} else next = vnode;
|
|
4833
4856
|
if (bu) (0, _vue_shared.invokeArrayFns)(bu);
|
|
4834
4857
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4835
|
-
if (next.ibu) next.ibu();
|
|
4858
|
+
if (isVaporInteropEnabled && next.ibu) next.ibu();
|
|
4836
4859
|
toggleRecurse(instance, true);
|
|
4837
4860
|
startMeasure(instance, `render`);
|
|
4838
4861
|
const nextTree = renderComponentRoot(instance);
|
|
@@ -4845,9 +4868,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4845
4868
|
next.el = nextTree.el;
|
|
4846
4869
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
4847
4870
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
4848
|
-
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
4871
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || isVaporInteropEnabled && next.iu) queuePostRenderEffect(() => {
|
|
4849
4872
|
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4850
|
-
next.iu && next.iu();
|
|
4873
|
+
isVaporInteropEnabled && next.iu && next.iu();
|
|
4851
4874
|
}, void 0, parentSuspense);
|
|
4852
4875
|
devtoolsComponentUpdated(instance);
|
|
4853
4876
|
popWarningContext();
|
|
@@ -4999,7 +5022,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4999
5022
|
};
|
|
5000
5023
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
5001
5024
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
5002
|
-
if (isVaporComponent(type) || type === VaporSlot) {
|
|
5025
|
+
if (isVaporInteropEnabled && (isVaporComponent(type) || type === VaporSlot)) {
|
|
5003
5026
|
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
5004
5027
|
return;
|
|
5005
5028
|
}
|
|
@@ -5043,11 +5066,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5043
5066
|
}
|
|
5044
5067
|
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
5045
5068
|
if (shapeFlag & 256) {
|
|
5046
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
5069
|
+
if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
5047
5070
|
else parentComponent.ctx.deactivate(vnode);
|
|
5048
5071
|
return;
|
|
5049
5072
|
}
|
|
5050
|
-
if (shapeFlag & 6 && isVaporComponent(type)) {
|
|
5073
|
+
if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
|
|
5051
5074
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
5052
5075
|
return;
|
|
5053
5076
|
}
|
|
@@ -5065,7 +5088,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5065
5088
|
if (shapeFlag & 64) vnode.type.remove(vnode, parentComponent, parentSuspense, internals, doRemove);
|
|
5066
5089
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
5067
5090
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
5068
|
-
if (type === VaporSlot) {
|
|
5091
|
+
if (isVaporInteropEnabled && type === VaporSlot) {
|
|
5069
5092
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
5070
5093
|
return;
|
|
5071
5094
|
}
|
|
@@ -5099,7 +5122,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5099
5122
|
if (transition) {
|
|
5100
5123
|
let leavingEl = leavingNode && leavingNode.el;
|
|
5101
5124
|
let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
|
|
5102
|
-
if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
|
|
5125
|
+
if (isVaporInteropEnabled && isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
|
|
5103
5126
|
leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
|
|
5104
5127
|
isElement = !!leavingEl;
|
|
5105
5128
|
}
|
|
@@ -5138,7 +5161,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5138
5161
|
};
|
|
5139
5162
|
const getNextHostNode = (vnode) => {
|
|
5140
5163
|
if (vnode.shapeFlag & 6) {
|
|
5141
|
-
if (isVaporComponent(vnode.type)) return hostNextSibling(vnode.anchor);
|
|
5164
|
+
if (isVaporInteropEnabled && isVaporComponent(vnode.type)) return hostNextSibling(vnode.anchor);
|
|
5142
5165
|
return getNextHostNode(vnode.component.subTree);
|
|
5143
5166
|
}
|
|
5144
5167
|
if (vnode.shapeFlag & 128) return vnode.suspense.next();
|
|
@@ -5199,7 +5222,7 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
5199
5222
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
5200
5223
|
}
|
|
5201
5224
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
5202
|
-
if (!vapor) {
|
|
5225
|
+
if (!isVaporInteropEnabled || !vapor) {
|
|
5203
5226
|
if (allowed) {
|
|
5204
5227
|
effect.flags |= 128;
|
|
5205
5228
|
job.flags |= 2;
|
|
@@ -5311,7 +5334,7 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
|
|
|
5311
5334
|
currentParent = currentParent.parent;
|
|
5312
5335
|
} else break;
|
|
5313
5336
|
}
|
|
5314
|
-
const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
5337
|
+
const vaporScopeIds = isVaporInteropEnabled && includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
5315
5338
|
if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
|
|
5316
5339
|
return inheritedScopeIds;
|
|
5317
5340
|
}
|
|
@@ -5324,8 +5347,13 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
|
5324
5347
|
//#endregion
|
|
5325
5348
|
//#region packages/runtime-core/src/components/Suspense.ts
|
|
5326
5349
|
const isSuspense = (type) => type.__isSuspense;
|
|
5350
|
+
let isSuspenseEnabled = false;
|
|
5351
|
+
function withSuspenseEnabled(value) {
|
|
5352
|
+
isSuspenseEnabled = true;
|
|
5353
|
+
return value;
|
|
5354
|
+
}
|
|
5327
5355
|
let suspenseId = 0;
|
|
5328
|
-
const Suspense = {
|
|
5356
|
+
const Suspense = /*@__PURE__*/ withSuspenseEnabled({
|
|
5329
5357
|
name: "Suspense",
|
|
5330
5358
|
__isSuspense: true,
|
|
5331
5359
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
@@ -5342,7 +5370,7 @@ const Suspense = {
|
|
|
5342
5370
|
},
|
|
5343
5371
|
hydrate: hydrateSuspense,
|
|
5344
5372
|
normalize: normalizeSuspenseChildren
|
|
5345
|
-
};
|
|
5373
|
+
});
|
|
5346
5374
|
function triggerEvent(vnode, name) {
|
|
5347
5375
|
const eventListener = vnode.props && vnode.props[name];
|
|
5348
5376
|
if ((0, _vue_shared.isFunction)(eventListener)) eventListener();
|
|
@@ -5877,16 +5905,23 @@ function cloneVaporSlotMeta(vnode, extraProps) {
|
|
|
5877
5905
|
if (!vaporSlot) return vaporSlot;
|
|
5878
5906
|
const cloned = {
|
|
5879
5907
|
slot: vaporSlot.slot,
|
|
5908
|
+
name: vaporSlot.name,
|
|
5880
5909
|
outlets: vaporSlot.outlets,
|
|
5881
|
-
props: vaporSlot.props
|
|
5910
|
+
props: vaporSlot.props,
|
|
5911
|
+
attrs: vaporSlot.attrs && vaporSlot.attrs === _vue_shared.EMPTY_OBJ ? {} : vaporSlot.attrs,
|
|
5912
|
+
group: vaporSlot.group
|
|
5882
5913
|
};
|
|
5883
|
-
|
|
5914
|
+
const attrs = cloned.attrs;
|
|
5915
|
+
if (extraProps && vaporSlot.props) {
|
|
5884
5916
|
let extraSlotProps;
|
|
5885
|
-
for (const key in extraProps) if (key !== "key") {
|
|
5917
|
+
for (const key in extraProps) if (attrs ? !(0, _vue_shared.isReservedProp)(key) : key !== "key") {
|
|
5886
5918
|
if (!extraSlotProps) extraSlotProps = {};
|
|
5887
5919
|
extraSlotProps[key] = extraProps[key];
|
|
5888
5920
|
}
|
|
5889
|
-
if (extraSlotProps)
|
|
5921
|
+
if (extraSlotProps) {
|
|
5922
|
+
if (attrs) cloned.attrs = mergeProps(attrs, extraSlotProps);
|
|
5923
|
+
else cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
|
|
5924
|
+
}
|
|
5890
5925
|
}
|
|
5891
5926
|
if (vnode.el) {
|
|
5892
5927
|
cloned.state = vaporSlot.state;
|
|
@@ -6168,7 +6203,7 @@ function setupComponent(instance, isSSR = false, optimized = false) {
|
|
|
6168
6203
|
isSSR && setInSSRSetupState(isSSR);
|
|
6169
6204
|
const { props, children, vi } = instance.vnode;
|
|
6170
6205
|
const isStateful = isStatefulComponent(instance);
|
|
6171
|
-
if (vi) vi(instance);
|
|
6206
|
+
if (isVaporInteropEnabled && vi) vi(instance);
|
|
6172
6207
|
else {
|
|
6173
6208
|
initProps(instance, props, isStateful, isSSR);
|
|
6174
6209
|
initSlots(instance, children, optimized || isSSR);
|
|
@@ -6588,7 +6623,7 @@ function isMemoSame(cached, memo) {
|
|
|
6588
6623
|
}
|
|
6589
6624
|
//#endregion
|
|
6590
6625
|
//#region packages/runtime-core/src/index.ts
|
|
6591
|
-
const version = "3.6.0-rc.
|
|
6626
|
+
const version = "3.6.0-rc.14";
|
|
6592
6627
|
const warn = warn$1;
|
|
6593
6628
|
/**
|
|
6594
6629
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -6689,6 +6724,12 @@ exports.hydrateOnMediaQuery = hydrateOnMediaQuery;
|
|
|
6689
6724
|
exports.hydrateOnVisible = hydrateOnVisible;
|
|
6690
6725
|
exports.initCustomFormatter = initCustomFormatter;
|
|
6691
6726
|
exports.inject = inject;
|
|
6727
|
+
Object.defineProperty(exports, "isKeepAliveEnabled", {
|
|
6728
|
+
enumerable: true,
|
|
6729
|
+
get: function() {
|
|
6730
|
+
return isKeepAliveEnabled;
|
|
6731
|
+
}
|
|
6732
|
+
});
|
|
6692
6733
|
exports.isMemoSame = isMemoSame;
|
|
6693
6734
|
exports.isProxy = _vue_reactivity.isProxy;
|
|
6694
6735
|
exports.isReactive = _vue_reactivity.isReactive;
|
|
@@ -6696,7 +6737,25 @@ exports.isReadonly = _vue_reactivity.isReadonly;
|
|
|
6696
6737
|
exports.isRef = _vue_reactivity.isRef;
|
|
6697
6738
|
exports.isRuntimeOnly = isRuntimeOnly;
|
|
6698
6739
|
exports.isShallow = _vue_reactivity.isShallow;
|
|
6740
|
+
Object.defineProperty(exports, "isSuspenseEnabled", {
|
|
6741
|
+
enumerable: true,
|
|
6742
|
+
get: function() {
|
|
6743
|
+
return isSuspenseEnabled;
|
|
6744
|
+
}
|
|
6745
|
+
});
|
|
6746
|
+
Object.defineProperty(exports, "isTransitionEnabled", {
|
|
6747
|
+
enumerable: true,
|
|
6748
|
+
get: function() {
|
|
6749
|
+
return isTransitionEnabled;
|
|
6750
|
+
}
|
|
6751
|
+
});
|
|
6699
6752
|
exports.isVNode = isVNode;
|
|
6753
|
+
Object.defineProperty(exports, "isVaporInteropEnabled", {
|
|
6754
|
+
enumerable: true,
|
|
6755
|
+
get: function() {
|
|
6756
|
+
return isVaporInteropEnabled;
|
|
6757
|
+
}
|
|
6758
|
+
});
|
|
6700
6759
|
exports.markRaw = _vue_reactivity.markRaw;
|
|
6701
6760
|
exports.mergeDefaults = mergeDefaults;
|
|
6702
6761
|
exports.mergeModels = mergeModels;
|
|
@@ -6740,6 +6799,7 @@ exports.setBlockTracking = setBlockTracking;
|
|
|
6740
6799
|
exports.setDevtoolsHook = setDevtoolsHook;
|
|
6741
6800
|
exports.setIsHydratingEnabled = setIsHydratingEnabled;
|
|
6742
6801
|
exports.setTransitionHooks = setTransitionHooks;
|
|
6802
|
+
exports.setVaporInteropEnabled = setVaporInteropEnabled;
|
|
6743
6803
|
exports.shallowReactive = _vue_reactivity.shallowReactive;
|
|
6744
6804
|
exports.shallowReadonly = _vue_reactivity.shallowReadonly;
|
|
6745
6805
|
exports.shallowRef = _vue_reactivity.shallowRef;
|
|
@@ -6774,5 +6834,8 @@ exports.withAsyncContext = withAsyncContext;
|
|
|
6774
6834
|
exports.withCtx = withCtx;
|
|
6775
6835
|
exports.withDefaults = withDefaults;
|
|
6776
6836
|
exports.withDirectives = withDirectives;
|
|
6837
|
+
exports.withKeepAliveEnabled = withKeepAliveEnabled;
|
|
6777
6838
|
exports.withMemo = withMemo;
|
|
6778
6839
|
exports.withScopeId = withScopeId;
|
|
6840
|
+
exports.withSuspenseEnabled = withSuspenseEnabled;
|
|
6841
|
+
exports.withTransitionEnabled = withTransitionEnabled;
|