@vue/runtime-core 3.6.0-rc.1 → 3.6.0-rc.3
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 +167 -67
- package/dist/runtime-core.cjs.prod.js +144 -65
- package/dist/runtime-core.d.ts +29 -8
- package/dist/runtime-core.esm-bundler.js +182 -69
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.3
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -200,7 +200,7 @@ function queueFlush() {
|
|
|
200
200
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
201
201
|
if (!(0, _vue_shared.isArray)(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
202
202
|
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
203
|
-
else for (
|
|
203
|
+
else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
204
204
|
queueFlush();
|
|
205
205
|
}
|
|
206
206
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -219,7 +219,7 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
219
219
|
function flushPostFlushCbs(seen) {
|
|
220
220
|
if (postJobs.length) {
|
|
221
221
|
if (activePostJobs) {
|
|
222
|
-
activePostJobs.push(
|
|
222
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
223
223
|
postJobs.length = 0;
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
@@ -515,7 +515,7 @@ function instanceWatch(source, value, options) {
|
|
|
515
515
|
}
|
|
516
516
|
const prev = setCurrentInstance(this);
|
|
517
517
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
518
|
-
|
|
518
|
+
restoreCurrentInstance(prev);
|
|
519
519
|
return res;
|
|
520
520
|
}
|
|
521
521
|
function createPathGetter(ctx, path) {
|
|
@@ -775,48 +775,15 @@ const BaseTransitionImpl = {
|
|
|
775
775
|
setup(props, { slots }) {
|
|
776
776
|
const instance = getCurrentInstance();
|
|
777
777
|
const state = useTransitionState();
|
|
778
|
+
let resumeAfterLeave;
|
|
778
779
|
return () => {
|
|
779
|
-
const
|
|
780
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
780
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
781
781
|
if (!child) return;
|
|
782
782
|
const rawProps = (0, _vue_reactivity.toRaw)(props);
|
|
783
783
|
const { mode } = rawProps;
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
788
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
789
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
790
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
791
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
792
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
793
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
794
|
-
state.isLeaving = true;
|
|
795
|
-
leavingHooks.afterLeave = () => {
|
|
796
|
-
state.isLeaving = false;
|
|
797
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
798
|
-
delete leavingHooks.afterLeave;
|
|
799
|
-
oldInnerChild = void 0;
|
|
800
|
-
};
|
|
801
|
-
return emptyPlaceholder(child);
|
|
802
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
803
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
804
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
805
|
-
el[leaveCbKey] = () => {
|
|
806
|
-
earlyRemove();
|
|
807
|
-
el[leaveCbKey] = void 0;
|
|
808
|
-
delete enterHooks.delayedLeave;
|
|
809
|
-
oldInnerChild = void 0;
|
|
810
|
-
};
|
|
811
|
-
enterHooks.delayedLeave = () => {
|
|
812
|
-
delayedLeave();
|
|
813
|
-
delete enterHooks.delayedLeave;
|
|
814
|
-
oldInnerChild = void 0;
|
|
815
|
-
};
|
|
816
|
-
};
|
|
817
|
-
else oldInnerChild = void 0;
|
|
818
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
819
|
-
return child;
|
|
784
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
785
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
786
|
+
}) : _vue_shared.NOOP);
|
|
820
787
|
};
|
|
821
788
|
}
|
|
822
789
|
};
|
|
@@ -953,16 +920,91 @@ function getInnerChild$1(vnode) {
|
|
|
953
920
|
if (shapeFlag & 32 && (0, _vue_shared.isFunction)(children.default)) return children.default();
|
|
954
921
|
}
|
|
955
922
|
}
|
|
923
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
924
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
925
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* @internal
|
|
929
|
+
*/
|
|
930
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
931
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
932
|
+
const nextInner = getInnerChild$1(next);
|
|
933
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
934
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
935
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
936
|
+
enterHooks = hooks;
|
|
937
|
+
});
|
|
938
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
939
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
940
|
+
const mode = props.mode;
|
|
941
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
942
|
+
if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
|
|
943
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
944
|
+
if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
|
|
945
|
+
}
|
|
946
|
+
return next;
|
|
947
|
+
}
|
|
948
|
+
function forwardDelayedLeave(hooks, source) {
|
|
949
|
+
const delayedLeave = source && source.delayedLeave;
|
|
950
|
+
if (!delayedLeave) return;
|
|
951
|
+
hooks.delayedLeave = () => {
|
|
952
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
953
|
+
delete hooks.delayedLeave;
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
957
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
958
|
+
}
|
|
959
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
960
|
+
if (props.mode === "out-in") {
|
|
961
|
+
state.isLeaving = true;
|
|
962
|
+
leavingHooks.afterLeave = () => {
|
|
963
|
+
state.isLeaving = false;
|
|
964
|
+
resumeAfterLeave();
|
|
965
|
+
delete leavingHooks.afterLeave;
|
|
966
|
+
};
|
|
967
|
+
return true;
|
|
968
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
969
|
+
let delayedLeavingVNode = leavingVNode;
|
|
970
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
971
|
+
const enterHooks = getEnterHooks();
|
|
972
|
+
if (!enterHooks) {
|
|
973
|
+
delayedLeave();
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
const vnode = delayedLeavingVNode;
|
|
977
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
978
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
979
|
+
el[leaveCbKey] = () => {
|
|
980
|
+
earlyRemove();
|
|
981
|
+
el[leaveCbKey] = void 0;
|
|
982
|
+
delete enterHooks.delayedLeave;
|
|
983
|
+
delayedLeavingVNode = void 0;
|
|
984
|
+
};
|
|
985
|
+
enterHooks.delayedLeave = () => {
|
|
986
|
+
delayedLeave();
|
|
987
|
+
delete enterHooks.delayedLeave;
|
|
988
|
+
delayedLeavingVNode = void 0;
|
|
989
|
+
};
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
return false;
|
|
993
|
+
}
|
|
956
994
|
function setTransitionHooks(vnode, hooks) {
|
|
957
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
958
|
-
else {
|
|
995
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
959
996
|
vnode.transition = hooks;
|
|
960
|
-
setTransitionHooks(vnode.component
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
997
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
998
|
+
else {
|
|
999
|
+
const subTree = vnode.component.subTree;
|
|
1000
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
1001
|
+
}
|
|
1002
|
+
} else if (vnode.shapeFlag & 128) {
|
|
1003
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1004
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1005
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
965
1006
|
} else vnode.transition = hooks;
|
|
1007
|
+
return hooks;
|
|
966
1008
|
}
|
|
967
1009
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
968
1010
|
let ret = [];
|
|
@@ -1285,7 +1327,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1285
1327
|
if (forcePatch || hasDynamicProps || !optimized || patchFlag & 48) {
|
|
1286
1328
|
const isCustomElement = el.tagName.includes("-");
|
|
1287
1329
|
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
1288
|
-
for (const key in props) if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key))
|
|
1330
|
+
for (const key in props) if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
1331
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
1332
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
1333
|
+
}
|
|
1289
1334
|
} else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
|
|
1290
1335
|
else if (patchFlag & 4 && (0, _vue_reactivity.isReactive)(props.style)) for (const key in props.style) props.style[key];
|
|
1291
1336
|
}
|
|
@@ -1386,6 +1431,19 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1386
1431
|
const isTemplateNode = (node) => {
|
|
1387
1432
|
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
1388
1433
|
};
|
|
1434
|
+
/**
|
|
1435
|
+
* Dev only
|
|
1436
|
+
*/
|
|
1437
|
+
const resourceProps = /* @__PURE__ */ new Set([
|
|
1438
|
+
"src",
|
|
1439
|
+
"srcset",
|
|
1440
|
+
"href",
|
|
1441
|
+
"poster"
|
|
1442
|
+
]);
|
|
1443
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
1444
|
+
if (!resourceProps.has(key)) return false;
|
|
1445
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
1446
|
+
}
|
|
1389
1447
|
const allowMismatchAttr = "data-allow-mismatch";
|
|
1390
1448
|
const MismatchTypeString = {
|
|
1391
1449
|
[0]: "text",
|
|
@@ -1875,7 +1933,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
1875
1933
|
try {
|
|
1876
1934
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
1877
1935
|
} finally {
|
|
1878
|
-
|
|
1936
|
+
restoreCurrentInstance(prev);
|
|
1879
1937
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
1880
1938
|
}
|
|
1881
1939
|
});
|
|
@@ -1996,7 +2054,8 @@ function createSlots(slots, dynamicSlots) {
|
|
|
1996
2054
|
* Compiler runtime helper for rendering `<slot/>`
|
|
1997
2055
|
* @private
|
|
1998
2056
|
*/
|
|
1999
|
-
function renderSlot(slots, name, props
|
|
2057
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2058
|
+
if (props == null) props = {};
|
|
2000
2059
|
let slot = slots[name];
|
|
2001
2060
|
if (fallback) fallback.__vdom = true;
|
|
2002
2061
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
@@ -2848,7 +2907,7 @@ function renderComponentRoot(instance) {
|
|
|
2848
2907
|
root = cloneVNode(root, null, false, true);
|
|
2849
2908
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
2850
2909
|
}
|
|
2851
|
-
if (vnode.transition) setTransitionHooks(root, vnode.transition);
|
|
2910
|
+
if (vnode.transition) setTransitionHooks(isTeleport(root.type) ? getInnerChild$1(root) || root : root, vnode.transition);
|
|
2852
2911
|
result = root;
|
|
2853
2912
|
setCurrentRenderingInstance(prev);
|
|
2854
2913
|
return result;
|
|
@@ -2864,9 +2923,10 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
2864
2923
|
}
|
|
2865
2924
|
return singleRoot;
|
|
2866
2925
|
}
|
|
2926
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || (0, _vue_shared.isOn)(key);
|
|
2867
2927
|
const getFunctionalFallthrough = (attrs) => {
|
|
2868
2928
|
let res;
|
|
2869
|
-
for (const key in attrs) if (
|
|
2929
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
2870
2930
|
return res;
|
|
2871
2931
|
};
|
|
2872
2932
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -3054,7 +3114,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
3054
3114
|
const prev = setCurrentInstance(instance);
|
|
3055
3115
|
const props = (0, _vue_reactivity.toRaw)(instance.props);
|
|
3056
3116
|
value = factory.call(null, props);
|
|
3057
|
-
|
|
3117
|
+
restoreCurrentInstance(prev);
|
|
3058
3118
|
return value;
|
|
3059
3119
|
}
|
|
3060
3120
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -3425,7 +3485,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3425
3485
|
};
|
|
3426
3486
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
3427
3487
|
n2.slotScopeIds = slotScopeIds;
|
|
3428
|
-
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
|
|
3488
|
+
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
3429
3489
|
else {
|
|
3430
3490
|
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
3431
3491
|
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
@@ -3735,7 +3795,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3735
3795
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
3736
3796
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
3737
3797
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
3738
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
3798
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
3739
3799
|
return;
|
|
3740
3800
|
}
|
|
3741
3801
|
if (shapeFlag & 6) {
|
|
@@ -3791,7 +3851,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3791
3851
|
}
|
|
3792
3852
|
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
3793
3853
|
if (shapeFlag & 256) {
|
|
3794
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
3854
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
3795
3855
|
else parentComponent.ctx.deactivate(vnode);
|
|
3796
3856
|
return;
|
|
3797
3857
|
}
|
|
@@ -3801,7 +3861,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3801
3861
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3802
3862
|
if (shapeFlag & 6) if (isVaporComponent(type)) {
|
|
3803
3863
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
3804
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
3864
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
3805
3865
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
3806
3866
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
3807
3867
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
@@ -3818,7 +3878,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3818
3878
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
3819
3879
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
3820
3880
|
if (type === VaporSlot) {
|
|
3821
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
3881
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
3822
3882
|
return;
|
|
3823
3883
|
}
|
|
3824
3884
|
if (doRemove) remove(vnode);
|
|
@@ -4101,6 +4161,10 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
4101
4161
|
suspense.activeBranch = pendingBranch;
|
|
4102
4162
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
4103
4163
|
suspense.deps = 0;
|
|
4164
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
4165
|
+
const effect = suspense.effects[i];
|
|
4166
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
4167
|
+
}
|
|
4104
4168
|
suspense.effects.length = 0;
|
|
4105
4169
|
suspense.hiddenContainer = createElement("div");
|
|
4106
4170
|
if (isInFallback) {
|
|
@@ -4199,7 +4263,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4199
4263
|
let hasUnresolvedAncestor = false;
|
|
4200
4264
|
while (parent) {
|
|
4201
4265
|
if (parent.pendingBranch) {
|
|
4202
|
-
parent.effects.push(
|
|
4266
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
4203
4267
|
hasUnresolvedAncestor = true;
|
|
4204
4268
|
break;
|
|
4205
4269
|
}
|
|
@@ -4665,6 +4729,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
4665
4729
|
simpleSetCurrentInstance(instance);
|
|
4666
4730
|
}
|
|
4667
4731
|
};
|
|
4732
|
+
/**
|
|
4733
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
4734
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
4735
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
4736
|
+
* @internal
|
|
4737
|
+
*/
|
|
4738
|
+
const restoreCurrentInstance = (prev) => {
|
|
4739
|
+
(0, _vue_reactivity.setCurrentScope)(prev[1]);
|
|
4740
|
+
simpleSetCurrentInstance(prev[0]);
|
|
4741
|
+
};
|
|
4668
4742
|
const internalOptions = [
|
|
4669
4743
|
"ce",
|
|
4670
4744
|
"type",
|
|
@@ -4793,7 +4867,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
4793
4867
|
const setupResult = callWithErrorHandling(setup, instance, 0, [instance.props, setupContext]);
|
|
4794
4868
|
const isAsyncSetup = (0, _vue_shared.isPromise)(setupResult);
|
|
4795
4869
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
4796
|
-
|
|
4870
|
+
restoreCurrentInstance(prev);
|
|
4797
4871
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
4798
4872
|
if (isAsyncSetup) {
|
|
4799
4873
|
const unsetCurrentInstance = () => {
|
|
@@ -4801,7 +4875,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
4801
4875
|
};
|
|
4802
4876
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
4803
4877
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
4804
|
-
|
|
4878
|
+
setInSSRSetupState(true);
|
|
4879
|
+
try {
|
|
4880
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
4881
|
+
} finally {
|
|
4882
|
+
setInSSRSetupState(false);
|
|
4883
|
+
}
|
|
4805
4884
|
}).catch((e) => {
|
|
4806
4885
|
handleError(e, instance, 0);
|
|
4807
4886
|
});
|
|
@@ -4853,7 +4932,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
4853
4932
|
applyOptions(instance);
|
|
4854
4933
|
} finally {
|
|
4855
4934
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
4856
|
-
|
|
4935
|
+
restoreCurrentInstance(prevInstance);
|
|
4857
4936
|
}
|
|
4858
4937
|
}
|
|
4859
4938
|
}
|
|
@@ -4951,7 +5030,7 @@ function isMemoSame(cached, memo) {
|
|
|
4951
5030
|
}
|
|
4952
5031
|
//#endregion
|
|
4953
5032
|
//#region packages/runtime-core/src/index.ts
|
|
4954
|
-
const version = "3.6.0-rc.
|
|
5033
|
+
const version = "3.6.0-rc.3";
|
|
4955
5034
|
const warn = _vue_shared.NOOP;
|
|
4956
5035
|
/**
|
|
4957
5036
|
* Runtime error messages. Only exposed in dev or esm builds.
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -40,7 +40,12 @@ declare enum SchedulerJobFlags {
|
|
|
40
40
|
* stabilizes (#1727).
|
|
41
41
|
*/
|
|
42
42
|
ALLOW_RECURSE = 2,
|
|
43
|
-
DISPOSED = 4
|
|
43
|
+
DISPOSED = 4,
|
|
44
|
+
/**
|
|
45
|
+
* Requeue a Suspense effect if its pending branch is discarded.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
REQUEUE_ON_SUSPENSE_DISCARD = 8
|
|
44
49
|
}
|
|
45
50
|
export interface SchedulerJob extends Function {
|
|
46
51
|
order?: number;
|
|
@@ -316,17 +321,17 @@ type DefineModelDefault<T> = InferDefault<Data, T>;
|
|
|
316
321
|
* const count = defineModel<number>('count', { default: 0 })
|
|
317
322
|
* ```
|
|
318
323
|
*/
|
|
319
|
-
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options: ({
|
|
324
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options: DefineModelRuntimeOptions<T, G, S> & ({
|
|
320
325
|
default: DefineModelDefault<T>;
|
|
321
326
|
} | {
|
|
322
327
|
required: true;
|
|
323
|
-
})
|
|
328
|
+
})): ModelRef<T, M, G, S>;
|
|
324
329
|
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options?: DefineModelRuntimeOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>;
|
|
325
|
-
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options: ({
|
|
330
|
+
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options: DefineModelRuntimeOptions<T, G, S> & ({
|
|
326
331
|
default: DefineModelDefault<T>;
|
|
327
332
|
} | {
|
|
328
333
|
required: true;
|
|
329
|
-
})
|
|
334
|
+
})): ModelRef<T, M, G, S>;
|
|
330
335
|
export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options?: DefineModelRuntimeOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>;
|
|
331
336
|
type NotUndefined<T> = T extends undefined ? never : T;
|
|
332
337
|
type MappedOmit<T, K extends keyof any> = { [P in keyof T as P extends K ? never : P]: T[P] };
|
|
@@ -623,7 +628,7 @@ export interface TransitionHooksContext {
|
|
|
623
628
|
cloneHooks: (node: any) => TransitionHooks;
|
|
624
629
|
}
|
|
625
630
|
export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: GenericComponentInstance, postClone?: (hooks: TransitionHooks) => void): TransitionHooks;
|
|
626
|
-
export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks):
|
|
631
|
+
export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): TransitionHooks;
|
|
627
632
|
export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode["key"]): VNode[];
|
|
628
633
|
//#endregion
|
|
629
634
|
//#region temp/packages/runtime-core/src/renderer.d.ts
|
|
@@ -815,7 +820,23 @@ declare function configureCompat(config: CompatConfig): void;
|
|
|
815
820
|
* ```
|
|
816
821
|
*/
|
|
817
822
|
export interface ComponentCustomOptions {}
|
|
818
|
-
|
|
823
|
+
/**
|
|
824
|
+
* Registry for additional render result types.
|
|
825
|
+
*
|
|
826
|
+
* @example
|
|
827
|
+
* ```ts
|
|
828
|
+
* import type { VaporRenderResult } from 'vue'
|
|
829
|
+
*
|
|
830
|
+
* declare module 'vue' {
|
|
831
|
+
* interface RenderResultExtensions {
|
|
832
|
+
* vapor: VaporRenderResult
|
|
833
|
+
* }
|
|
834
|
+
* }
|
|
835
|
+
* ```
|
|
836
|
+
*/
|
|
837
|
+
export interface RenderResultExtensions {}
|
|
838
|
+
type RenderResult = VNodeChild | RenderResultExtensions[keyof RenderResultExtensions] | RenderResult[];
|
|
839
|
+
export type RenderFunction = () => RenderResult;
|
|
819
840
|
export interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions> extends LegacyOptions<Props, D, C, M, Mixin, Extends, I, II, Provide>, ComponentInternalOptions, AsyncComponentInternalOptions, ComponentCustomOptions {
|
|
820
841
|
setup?: (this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "P">>>, ctx: SetupContext<E, S>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
|
|
821
842
|
name?: string;
|
|
@@ -1774,7 +1795,7 @@ type SlotFallback = {
|
|
|
1774
1795
|
* Compiler runtime helper for rendering `<slot/>`
|
|
1775
1796
|
* @private
|
|
1776
1797
|
*/
|
|
1777
|
-
export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: SlotFallback, noSlotted?: boolean, branchKey?: PropertyKey): VNode;
|
|
1798
|
+
export declare function renderSlot(slots: Slots, name: string, props?: Data | null, fallback?: SlotFallback, noSlotted?: boolean, branchKey?: PropertyKey): VNode;
|
|
1778
1799
|
//#endregion
|
|
1779
1800
|
//#region temp/packages/runtime-core/src/helpers/createSlots.d.ts
|
|
1780
1801
|
type SSRSlot = (...args: any[]) => VNode[] | undefined;
|