@vue/runtime-core 3.6.0-beta.8 → 3.6.0-rc.1
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 +362 -158
- package/dist/runtime-core.cjs.prod.js +274 -108
- package/dist/runtime-core.d.ts +24 -13
- package/dist/runtime-core.esm-bundler.js +367 -162
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -169,8 +169,8 @@ function findInsertionIndex(order, queue, start, end) {
|
|
|
169
169
|
/**
|
|
170
170
|
* @internal for runtime-vapor only
|
|
171
171
|
*/
|
|
172
|
-
function queueJob(job, id, isPre = false) {
|
|
173
|
-
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
172
|
+
function queueJob(job, id, isPre = false, order = 0) {
|
|
173
|
+
if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : order ? id * 2 + 1 + order / (order + 1) : id * 2 + 1, jobs, jobsLength, flushIndex)) {
|
|
174
174
|
jobsLength++;
|
|
175
175
|
queueFlush();
|
|
176
176
|
}
|
|
@@ -273,6 +273,7 @@ function flushJobs(seen) {
|
|
|
273
273
|
}
|
|
274
274
|
flushIndex = 0;
|
|
275
275
|
jobsLength = 0;
|
|
276
|
+
jobs.length = 0;
|
|
276
277
|
flushPostFlushCbs(seen);
|
|
277
278
|
currentFlushPromise = null;
|
|
278
279
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -332,10 +333,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
332
333
|
const renderFnWithContext = (...args) => {
|
|
333
334
|
if (renderFnWithContext._d) setBlockTracking(-1);
|
|
334
335
|
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
336
|
+
const prevStackSize = blockStack.length;
|
|
335
337
|
let res;
|
|
336
338
|
try {
|
|
337
339
|
res = fn(...args);
|
|
338
340
|
} finally {
|
|
341
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
339
342
|
setCurrentRenderingInstance(prevInstance);
|
|
340
343
|
if (renderFnWithContext._d) setBlockTracking(1);
|
|
341
344
|
}
|
|
@@ -525,6 +528,7 @@ function createPathGetter(ctx, path) {
|
|
|
525
528
|
}
|
|
526
529
|
//#endregion
|
|
527
530
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
531
|
+
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
528
532
|
const TeleportEndKey = Symbol("_vte");
|
|
529
533
|
const isTeleport = (type) => type.__isTeleport;
|
|
530
534
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
@@ -541,51 +545,64 @@ const TeleportImpl = {
|
|
|
541
545
|
name: "Teleport",
|
|
542
546
|
__isTeleport: true,
|
|
543
547
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
544
|
-
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
|
|
548
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
545
549
|
const disabled = isTeleportDisabled(n2.props);
|
|
546
|
-
let {
|
|
550
|
+
let { dynamicChildren } = n2;
|
|
551
|
+
const mount = (vnode, container, anchor) => {
|
|
552
|
+
if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
553
|
+
};
|
|
554
|
+
const mountToTarget = (vnode = n2) => {
|
|
555
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
556
|
+
const target = vnode.target = resolveTarget(vnode.props, querySelector);
|
|
557
|
+
const targetAnchor = prepareAnchor(target, vnode, createText, insert);
|
|
558
|
+
if (target) {
|
|
559
|
+
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
560
|
+
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
561
|
+
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
562
|
+
if (!disabled) {
|
|
563
|
+
mount(vnode, target, targetAnchor);
|
|
564
|
+
updateCssVars(vnode, false);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
const queuePendingMount = (vnode) => {
|
|
569
|
+
const mountJob = () => {
|
|
570
|
+
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
571
|
+
pendingMounts.delete(vnode);
|
|
572
|
+
if (isTeleportDisabled(vnode.props)) {
|
|
573
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
574
|
+
updateCssVars(vnode, true);
|
|
575
|
+
}
|
|
576
|
+
mountToTarget(vnode);
|
|
577
|
+
};
|
|
578
|
+
pendingMounts.set(vnode, mountJob);
|
|
579
|
+
queuePostRenderEffect(mountJob, void 0, parentSuspense);
|
|
580
|
+
};
|
|
547
581
|
if (n1 == null) {
|
|
548
582
|
const placeholder = n2.el = createText("");
|
|
549
583
|
const mainAnchor = n2.anchor = createText("");
|
|
550
584
|
insert(placeholder, container, anchor);
|
|
551
585
|
insert(mainAnchor, container, anchor);
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
557
|
-
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
558
|
-
if (target) {
|
|
559
|
-
if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
|
|
560
|
-
else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
|
|
561
|
-
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
562
|
-
if (!disabled) {
|
|
563
|
-
mount(target, targetAnchor);
|
|
564
|
-
updateCssVars(n2, false);
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
};
|
|
586
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
587
|
+
queuePendingMount(n2);
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
568
590
|
if (disabled) {
|
|
569
|
-
mount(container, mainAnchor);
|
|
591
|
+
mount(n2, container, mainAnchor);
|
|
570
592
|
updateCssVars(n2, true);
|
|
571
593
|
}
|
|
572
|
-
|
|
573
|
-
n2.el.__isMounted = false;
|
|
574
|
-
queuePostRenderEffect(() => {
|
|
575
|
-
mountToTarget();
|
|
576
|
-
delete n2.el.__isMounted;
|
|
577
|
-
}, void 0, parentSuspense);
|
|
578
|
-
} else mountToTarget();
|
|
594
|
+
mountToTarget();
|
|
579
595
|
} else {
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
596
|
+
n2.el = n1.el;
|
|
597
|
+
const mainAnchor = n2.anchor = n1.anchor;
|
|
598
|
+
const pendingMount = pendingMounts.get(n1);
|
|
599
|
+
if (pendingMount) {
|
|
600
|
+
pendingMount.flags |= 4;
|
|
601
|
+
pendingMounts.delete(n1);
|
|
602
|
+
queuePendingMount(n2);
|
|
584
603
|
return;
|
|
585
604
|
}
|
|
586
|
-
n2.el = n1.el;
|
|
587
605
|
n2.targetStart = n1.targetStart;
|
|
588
|
-
const mainAnchor = n2.anchor = n1.anchor;
|
|
589
606
|
const target = n2.target = n1.target;
|
|
590
607
|
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
591
608
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
@@ -601,25 +618,30 @@ const TeleportImpl = {
|
|
|
601
618
|
if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
|
|
602
619
|
else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
|
|
603
620
|
} else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
|
|
604
|
-
const nextTarget =
|
|
605
|
-
if (nextTarget)
|
|
621
|
+
const nextTarget = resolveTarget(n2.props, querySelector);
|
|
622
|
+
if (nextTarget) {
|
|
623
|
+
n2.target = nextTarget;
|
|
624
|
+
moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
|
|
625
|
+
}
|
|
606
626
|
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
|
|
607
627
|
updateCssVars(n2, disabled);
|
|
608
628
|
}
|
|
609
629
|
},
|
|
610
630
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
611
631
|
const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
632
|
+
const disabled = isTeleportDisabled(props);
|
|
633
|
+
const shouldRemove = doRemove || !disabled;
|
|
634
|
+
const pendingMount = pendingMounts.get(vnode);
|
|
635
|
+
if (pendingMount) {
|
|
636
|
+
pendingMount.flags |= 4;
|
|
637
|
+
pendingMounts.delete(vnode);
|
|
615
638
|
}
|
|
639
|
+
if (targetStart) hostRemove(targetStart);
|
|
640
|
+
if (targetAnchor) hostRemove(targetAnchor);
|
|
616
641
|
doRemove && hostRemove(anchor);
|
|
617
|
-
if (shapeFlag & 16) {
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
const child = children[i];
|
|
621
|
-
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
622
|
-
}
|
|
642
|
+
if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
|
|
643
|
+
const child = children[i];
|
|
644
|
+
unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
|
|
623
645
|
}
|
|
624
646
|
},
|
|
625
647
|
move: moveTeleport,
|
|
@@ -630,7 +652,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
630
652
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
631
653
|
const isReorder = moveType === 2;
|
|
632
654
|
if (isReorder) insert(el, container, parentAnchor);
|
|
633
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
655
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
634
656
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
635
657
|
}
|
|
636
658
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -755,8 +777,8 @@ const BaseTransitionImpl = {
|
|
|
755
777
|
const state = useTransitionState();
|
|
756
778
|
return () => {
|
|
757
779
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
758
|
-
|
|
759
|
-
|
|
780
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
781
|
+
if (!child) return;
|
|
760
782
|
const rawProps = (0, _vue_reactivity.toRaw)(props);
|
|
761
783
|
const { mode } = rawProps;
|
|
762
784
|
if (state.isLeaving) return emptyPlaceholder(child);
|
|
@@ -1180,7 +1202,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1180
1202
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1181
1203
|
break;
|
|
1182
1204
|
case VaporSlot:
|
|
1183
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
|
|
1205
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
1184
1206
|
break;
|
|
1185
1207
|
default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
1186
1208
|
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
@@ -1190,16 +1212,31 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1190
1212
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
1191
1213
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
1192
1214
|
else nextNode = nextSibling(node);
|
|
1193
|
-
if (vnode.type.__vapor)
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1215
|
+
if (vnode.type.__vapor) {
|
|
1216
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
|
|
1217
|
+
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
1218
|
+
if (vnode.dirs) {
|
|
1219
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
1220
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
1221
|
+
}
|
|
1222
|
+
}, () => {
|
|
1223
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
1224
|
+
});
|
|
1225
|
+
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
1226
|
+
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
1227
|
+
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
1228
|
+
} else {
|
|
1229
|
+
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
1230
|
+
const component = vnode.component;
|
|
1231
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
|
|
1232
|
+
let subTree;
|
|
1233
|
+
if (isFragmentStart) {
|
|
1234
|
+
subTree = createVNode(Fragment);
|
|
1235
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1236
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1237
|
+
subTree.el = node;
|
|
1238
|
+
component.subTree = subTree;
|
|
1239
|
+
}
|
|
1203
1240
|
}
|
|
1204
1241
|
} else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
|
|
1205
1242
|
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
@@ -1210,9 +1247,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1210
1247
|
};
|
|
1211
1248
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
1212
1249
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
1213
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
1250
|
+
const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
1214
1251
|
const forcePatch = type === "input" || type === "option";
|
|
1215
|
-
|
|
1252
|
+
const hasDynamicProps = !!dynamicProps;
|
|
1253
|
+
if (forcePatch || hasDynamicProps || patchFlag !== -1) {
|
|
1216
1254
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
1217
1255
|
let needCallTransitionHooks = false;
|
|
1218
1256
|
if (isTemplateNode(el)) {
|
|
@@ -1228,8 +1266,8 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1228
1266
|
}
|
|
1229
1267
|
if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
|
|
1230
1268
|
let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1269
|
+
if (next && !isMismatchAllowed(el, 1)) logMismatchError();
|
|
1231
1270
|
while (next) {
|
|
1232
|
-
if (!isMismatchAllowed(el, 1)) logMismatchError();
|
|
1233
1271
|
const cur = next;
|
|
1234
1272
|
next = next.nextSibling;
|
|
1235
1273
|
remove(cur);
|
|
@@ -1244,9 +1282,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1244
1282
|
}
|
|
1245
1283
|
}
|
|
1246
1284
|
if (props) {
|
|
1247
|
-
if (forcePatch || !optimized || patchFlag & 48) {
|
|
1285
|
+
if (forcePatch || hasDynamicProps || !optimized || patchFlag & 48) {
|
|
1248
1286
|
const isCustomElement = el.tagName.includes("-");
|
|
1249
|
-
|
|
1287
|
+
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)) patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
1250
1289
|
} else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
|
|
1251
1290
|
else if (patchFlag & 4 && (0, _vue_reactivity.isReactive)(props.style)) for (const key in props.style) props.style[key];
|
|
1252
1291
|
}
|
|
@@ -1265,6 +1304,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1265
1304
|
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
1266
1305
|
const children = parentVNode.children;
|
|
1267
1306
|
const l = children.length;
|
|
1307
|
+
let hasCheckedMismatch = false;
|
|
1268
1308
|
for (let i = 0; i < l; i++) {
|
|
1269
1309
|
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
1270
1310
|
const isText = vnode.type === Text;
|
|
@@ -1278,7 +1318,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1278
1318
|
node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1279
1319
|
} else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
|
|
1280
1320
|
else {
|
|
1281
|
-
if (!
|
|
1321
|
+
if (!hasCheckedMismatch) {
|
|
1322
|
+
hasCheckedMismatch = true;
|
|
1323
|
+
if (!isMismatchAllowed(container, 1)) logMismatchError();
|
|
1324
|
+
}
|
|
1282
1325
|
patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
1283
1326
|
}
|
|
1284
1327
|
}
|
|
@@ -1297,7 +1340,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1297
1340
|
}
|
|
1298
1341
|
};
|
|
1299
1342
|
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
1300
|
-
if (!
|
|
1343
|
+
if (!isNodeMismatchAllowed(node, vnode)) logMismatchError();
|
|
1301
1344
|
vnode.el = null;
|
|
1302
1345
|
if (isFragment) {
|
|
1303
1346
|
const end = locateClosingAnchor(node);
|
|
@@ -1353,7 +1396,9 @@ const MismatchTypeString = {
|
|
|
1353
1396
|
};
|
|
1354
1397
|
function isMismatchAllowed(el, allowedType) {
|
|
1355
1398
|
if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
|
|
1356
|
-
|
|
1399
|
+
return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
|
|
1400
|
+
}
|
|
1401
|
+
function isMismatchAllowedByAttr(allowedAttr, allowedType) {
|
|
1357
1402
|
if (allowedAttr == null) return false;
|
|
1358
1403
|
else if (allowedAttr === "") return true;
|
|
1359
1404
|
else {
|
|
@@ -1362,6 +1407,16 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
1362
1407
|
return list.includes(MismatchTypeString[allowedType]);
|
|
1363
1408
|
}
|
|
1364
1409
|
}
|
|
1410
|
+
function isNodeMismatchAllowed(node, vnode) {
|
|
1411
|
+
return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
|
|
1412
|
+
}
|
|
1413
|
+
function isMismatchAllowedByNode(node) {
|
|
1414
|
+
return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
|
|
1415
|
+
}
|
|
1416
|
+
function isMismatchAllowedByVNode({ props }) {
|
|
1417
|
+
const allowedAttr = props && props[allowMismatchAttr];
|
|
1418
|
+
return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
|
|
1419
|
+
}
|
|
1365
1420
|
//#endregion
|
|
1366
1421
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
1367
1422
|
let requestIdleCallback;
|
|
@@ -1480,11 +1535,16 @@ function defineAsyncComponent(source) {
|
|
|
1480
1535
|
onError(err);
|
|
1481
1536
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
1482
1537
|
});
|
|
1483
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
1538
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
1484
1539
|
load().then(() => {
|
|
1540
|
+
if (instance.isUnmounted) return;
|
|
1485
1541
|
loaded.value = true;
|
|
1486
1542
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
1487
1543
|
}).catch((err) => {
|
|
1544
|
+
if (instance.isUnmounted) {
|
|
1545
|
+
setPendingRequest(null);
|
|
1546
|
+
return;
|
|
1547
|
+
}
|
|
1488
1548
|
onError(err);
|
|
1489
1549
|
error.value = err;
|
|
1490
1550
|
});
|
|
@@ -1540,14 +1600,22 @@ function createAsyncComponentContext(source) {
|
|
|
1540
1600
|
setPendingRequest: (request) => pendingRequest = request
|
|
1541
1601
|
};
|
|
1542
1602
|
}
|
|
1543
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
1603
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
1544
1604
|
const loaded = (0, _vue_reactivity.ref)(false);
|
|
1545
1605
|
const error = (0, _vue_reactivity.ref)();
|
|
1546
1606
|
const delayed = (0, _vue_reactivity.ref)(!!delay);
|
|
1547
|
-
|
|
1607
|
+
let timeoutTimer;
|
|
1608
|
+
let delayTimer;
|
|
1609
|
+
if (instance) onUnmounted(() => {
|
|
1610
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
1611
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
1612
|
+
}, instance);
|
|
1613
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
1614
|
+
if (instance && instance.isUnmounted) return;
|
|
1548
1615
|
delayed.value = false;
|
|
1549
1616
|
}, delay);
|
|
1550
|
-
if (timeout != null) setTimeout(() => {
|
|
1617
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
1618
|
+
if (instance && instance.isUnmounted) return;
|
|
1551
1619
|
if (!loaded.value && !error.value) {
|
|
1552
1620
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
1553
1621
|
onError(err);
|
|
@@ -1565,10 +1633,12 @@ const useAsyncComponentState = (delay, timeout, onError) => {
|
|
|
1565
1633
|
* @internal
|
|
1566
1634
|
*/
|
|
1567
1635
|
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
1636
|
+
const wasConnected = el.isConnected;
|
|
1568
1637
|
let patched = false;
|
|
1569
1638
|
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
1570
1639
|
const performHydrate = () => {
|
|
1571
1640
|
if (patched) return;
|
|
1641
|
+
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
1572
1642
|
hydrate();
|
|
1573
1643
|
};
|
|
1574
1644
|
const doHydrate = hydrateStrategy ? () => {
|
|
@@ -1926,8 +1996,9 @@ function createSlots(slots, dynamicSlots) {
|
|
|
1926
1996
|
* Compiler runtime helper for rendering `<slot/>`
|
|
1927
1997
|
* @private
|
|
1928
1998
|
*/
|
|
1929
|
-
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
1999
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
1930
2000
|
let slot = slots[name];
|
|
2001
|
+
if (fallback) fallback.__vdom = true;
|
|
1931
2002
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
1932
2003
|
if (vaporSlot) {
|
|
1933
2004
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -1935,21 +2006,31 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
1935
2006
|
slot: vaporSlot,
|
|
1936
2007
|
fallback
|
|
1937
2008
|
};
|
|
2009
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
1938
2010
|
return ret;
|
|
1939
2011
|
}
|
|
1940
2012
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
1941
|
-
const
|
|
1942
|
-
|
|
1943
|
-
|
|
2013
|
+
const slotProps = branchKey != null && props.key == null ? (0, _vue_shared.extend)({}, props, { key: branchKey }) : props;
|
|
2014
|
+
const hasProps = Object.keys(slotProps).length > 0;
|
|
2015
|
+
if (name !== "default") slotProps.name = name;
|
|
2016
|
+
return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
|
|
1944
2017
|
}
|
|
1945
2018
|
if (slot && slot._c) slot._d = false;
|
|
2019
|
+
const prevStackSize = blockStack.length;
|
|
1946
2020
|
openBlock();
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
2021
|
+
let rendered;
|
|
2022
|
+
try {
|
|
2023
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2024
|
+
ensureVaporSlotFallback(validSlotContent, fallback);
|
|
2025
|
+
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
2026
|
+
rendered = createBlock(Fragment, { key: (slotKey && !(0, _vue_shared.isSymbol)(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
2027
|
+
} catch (err) {
|
|
2028
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2029
|
+
throw err;
|
|
2030
|
+
} finally {
|
|
2031
|
+
if (slot && slot._c) slot._d = true;
|
|
2032
|
+
}
|
|
1951
2033
|
if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
1952
|
-
if (slot && slot._c) slot._d = true;
|
|
1953
2034
|
return rendered;
|
|
1954
2035
|
}
|
|
1955
2036
|
function ensureValidVNode(vnodes) {
|
|
@@ -1962,9 +2043,7 @@ function ensureValidVNode(vnodes) {
|
|
|
1962
2043
|
}
|
|
1963
2044
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
1964
2045
|
let vaporSlot;
|
|
1965
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
1966
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
1967
|
-
}
|
|
2046
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
1968
2047
|
}
|
|
1969
2048
|
//#endregion
|
|
1970
2049
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -2240,25 +2319,38 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
2240
2319
|
function withAsyncContext(getAwaitable) {
|
|
2241
2320
|
const ctx = getCurrentGenericInstance();
|
|
2242
2321
|
const inSSRSetup = isInSSRComponentSetup;
|
|
2322
|
+
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
2243
2323
|
let awaitable = getAwaitable();
|
|
2244
2324
|
setCurrentInstance(null, void 0);
|
|
2245
2325
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2246
2326
|
const restore = () => {
|
|
2327
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
2247
2328
|
setCurrentInstance(ctx);
|
|
2248
2329
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
2330
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
2331
|
+
return () => {
|
|
2332
|
+
if (reset) reset();
|
|
2333
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
2334
|
+
};
|
|
2249
2335
|
};
|
|
2250
2336
|
const cleanup = () => {
|
|
2251
2337
|
setCurrentInstance(null, void 0);
|
|
2252
2338
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2253
2339
|
};
|
|
2254
2340
|
if ((0, _vue_shared.isPromise)(awaitable)) awaitable = awaitable.catch((e) => {
|
|
2255
|
-
restore();
|
|
2256
|
-
Promise.resolve().then(() => Promise.resolve().then(
|
|
2341
|
+
const reset = restore();
|
|
2342
|
+
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
2343
|
+
if (reset) reset();
|
|
2344
|
+
cleanup();
|
|
2345
|
+
}));
|
|
2257
2346
|
throw e;
|
|
2258
2347
|
});
|
|
2259
2348
|
return [awaitable, () => {
|
|
2260
|
-
restore();
|
|
2261
|
-
Promise.resolve().then(
|
|
2349
|
+
const reset = restore();
|
|
2350
|
+
Promise.resolve().then(() => {
|
|
2351
|
+
if (reset) reset();
|
|
2352
|
+
cleanup();
|
|
2353
|
+
});
|
|
2262
2354
|
}];
|
|
2263
2355
|
}
|
|
2264
2356
|
//#endregion
|
|
@@ -2613,12 +2705,13 @@ function useModel(props, name, options = _vue_shared.EMPTY_OBJ) {
|
|
|
2613
2705
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
2614
2706
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
2615
2707
|
}
|
|
2616
|
-
|
|
2708
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
2709
|
+
if (!hasVModel) {
|
|
2617
2710
|
localValue = value;
|
|
2618
2711
|
trigger();
|
|
2619
2712
|
}
|
|
2620
2713
|
i.emit(`update:${name}`, emittedValue);
|
|
2621
|
-
if ((0, _vue_shared.hasChanged)(value,
|
|
2714
|
+
if ((0, _vue_shared.hasChanged)(value, prevSetValue) && ((0, _vue_shared.hasChanged)(value, emittedValue) && !(0, _vue_shared.hasChanged)(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== _vue_shared.EMPTY_OBJ && !(0, _vue_shared.hasChanged)(emittedValue, localValue))) trigger();
|
|
2622
2715
|
prevSetValue = value;
|
|
2623
2716
|
prevEmittedValue = emittedValue;
|
|
2624
2717
|
}
|
|
@@ -2709,7 +2802,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
|
|
2709
2802
|
*/
|
|
2710
2803
|
function isEmitListener(options, key) {
|
|
2711
2804
|
if (!options || !(0, _vue_shared.isOn)(key)) return false;
|
|
2712
|
-
key = key.slice(2)
|
|
2805
|
+
key = key.slice(2);
|
|
2806
|
+
key = key === "Once" ? key : key.replace(/Once$/, "");
|
|
2713
2807
|
return (0, _vue_shared.hasOwn)(options, key[0].toLowerCase() + key.slice(1)) || (0, _vue_shared.hasOwn)(options, (0, _vue_shared.hyphenate)(key)) || (0, _vue_shared.hasOwn)(options, key);
|
|
2714
2808
|
}
|
|
2715
2809
|
//#endregion
|
|
@@ -2823,15 +2917,19 @@ function hasPropValueChanged(nextProps, prevProps, key) {
|
|
|
2823
2917
|
if (key === "style" && (0, _vue_shared.isObject)(nextProp) && (0, _vue_shared.isObject)(prevProp)) return !(0, _vue_shared.looseEqual)(nextProp, prevProp);
|
|
2824
2918
|
return nextProp !== prevProp;
|
|
2825
2919
|
}
|
|
2826
|
-
function updateHOCHostEl({ vnode, parent }, el) {
|
|
2920
|
+
function updateHOCHostEl({ vnode, parent, suspense }, el) {
|
|
2827
2921
|
while (parent && !parent.vapor) {
|
|
2828
2922
|
const root = parent.subTree;
|
|
2829
|
-
if (root.suspense && root.suspense.activeBranch === vnode)
|
|
2923
|
+
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
2924
|
+
root.suspense.vnode.el = root.el = el;
|
|
2925
|
+
vnode = root;
|
|
2926
|
+
}
|
|
2830
2927
|
if (root === vnode) {
|
|
2831
2928
|
(vnode = parent.vnode).el = el;
|
|
2832
2929
|
parent = parent.parent;
|
|
2833
2930
|
} else break;
|
|
2834
2931
|
}
|
|
2932
|
+
if (suspense && suspense.activeBranch === vnode) suspense.vnode.el = el;
|
|
2835
2933
|
}
|
|
2836
2934
|
//#endregion
|
|
2837
2935
|
//#region packages/runtime-core/src/internalObject.ts
|
|
@@ -3230,8 +3328,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3230
3328
|
if (transition) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
|
|
3231
3329
|
else hostInsert(el, container, anchor);
|
|
3232
3330
|
if ((vnodeHook = props && props.onVnodeMounted) || dirs) queuePostRenderEffect(() => {
|
|
3233
|
-
|
|
3234
|
-
|
|
3331
|
+
try {
|
|
3332
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3333
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
3334
|
+
} finally {}
|
|
3235
3335
|
}, void 0, parentSuspense);
|
|
3236
3336
|
};
|
|
3237
3337
|
const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
|
|
@@ -3254,6 +3354,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3254
3354
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
3255
3355
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
3256
3356
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
3357
|
+
if (dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
3358
|
+
patchFlag = 0;
|
|
3359
|
+
optimized = false;
|
|
3360
|
+
dynamicChildren = null;
|
|
3361
|
+
}
|
|
3257
3362
|
if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) hostSetElementText(el, "");
|
|
3258
3363
|
if (dynamicChildren) patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, resolveChildrenNamespace(n2, namespace), slotScopeIds);
|
|
3259
3364
|
else if (!optimized) patchChildren(n1, n2, el, null, parentComponent, parentSuspense, resolveChildrenNamespace(n2, namespace), slotScopeIds, false);
|
|
@@ -3322,19 +3427,35 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3322
3427
|
n2.slotScopeIds = slotScopeIds;
|
|
3323
3428
|
if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
|
|
3324
3429
|
else {
|
|
3430
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
3325
3431
|
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
3326
3432
|
if (n2.dirs) {
|
|
3327
3433
|
invokeDirectiveHook(n2, null, parentComponent, "created");
|
|
3328
3434
|
invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
|
|
3329
3435
|
}
|
|
3436
|
+
}, () => {
|
|
3437
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
3330
3438
|
});
|
|
3331
3439
|
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
3440
|
+
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
3441
|
+
if (vnodeMountedHook) {
|
|
3442
|
+
const scopedVNode = n2;
|
|
3443
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
3444
|
+
}
|
|
3332
3445
|
}
|
|
3333
3446
|
else {
|
|
3334
|
-
|
|
3447
|
+
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
3448
|
+
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
3335
3449
|
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
3450
|
+
}, () => {
|
|
3451
|
+
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
3452
|
+
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
3336
3453
|
});
|
|
3337
|
-
|
|
3454
|
+
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
3455
|
+
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
3456
|
+
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
3457
|
+
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
3458
|
+
}, void 0, parentSuspense);
|
|
3338
3459
|
}
|
|
3339
3460
|
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
3340
3461
|
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
@@ -3647,8 +3768,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3647
3768
|
else hostInsert(el, container, anchor);
|
|
3648
3769
|
};
|
|
3649
3770
|
const performLeave = () => {
|
|
3771
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
3650
3772
|
if (el._isLeaving) el[leaveCbKey](true);
|
|
3651
|
-
|
|
3773
|
+
if (transition.persisted && !wasLeaving) remove();
|
|
3774
|
+
else leave(el, () => {
|
|
3652
3775
|
remove();
|
|
3653
3776
|
afterLeave && afterLeave();
|
|
3654
3777
|
});
|
|
@@ -3659,7 +3782,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3659
3782
|
else hostInsert(el, container, anchor);
|
|
3660
3783
|
};
|
|
3661
3784
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
3662
|
-
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex } = vnode;
|
|
3785
|
+
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
3663
3786
|
if (patchFlag === -2) optimized = false;
|
|
3664
3787
|
if (ref != null) {
|
|
3665
3788
|
const prevSub = (0, _vue_reactivity.setActiveSub)();
|
|
@@ -3679,7 +3802,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3679
3802
|
if (shapeFlag & 6) if (isVaporComponent(type)) {
|
|
3680
3803
|
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
3681
3804
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
3682
|
-
if (
|
|
3805
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
3806
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
3807
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3808
|
+
}, void 0, parentSuspense);
|
|
3683
3809
|
return;
|
|
3684
3810
|
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
3685
3811
|
else {
|
|
@@ -3697,9 +3823,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3697
3823
|
}
|
|
3698
3824
|
if (doRemove) remove(vnode);
|
|
3699
3825
|
}
|
|
3700
|
-
|
|
3826
|
+
const shouldInvalidateMemo = memo != null && cacheIndex == null;
|
|
3827
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) queuePostRenderEffect(() => {
|
|
3701
3828
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3702
3829
|
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
3830
|
+
if (shouldInvalidateMemo) vnode.el = null;
|
|
3703
3831
|
}, void 0, parentSuspense);
|
|
3704
3832
|
};
|
|
3705
3833
|
const remove = (vnode) => {
|
|
@@ -3733,7 +3861,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3733
3861
|
if (effect) {
|
|
3734
3862
|
effect.stop();
|
|
3735
3863
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
3736
|
-
}
|
|
3864
|
+
} else if (doRemove && subTree && instance.vnode.el) remove(subTree);
|
|
3737
3865
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
3738
3866
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
3739
3867
|
};
|
|
@@ -3852,6 +3980,10 @@ function invalidateMount(hooks) {
|
|
|
3852
3980
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
3853
3981
|
}
|
|
3854
3982
|
function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
|
|
3983
|
+
if (force && transition.persisted && !el[leaveCbKey]) {
|
|
3984
|
+
insert();
|
|
3985
|
+
return;
|
|
3986
|
+
}
|
|
3855
3987
|
if (force || needTransition(parentSuspense, transition)) {
|
|
3856
3988
|
transition.beforeEnter(el);
|
|
3857
3989
|
insert();
|
|
@@ -4029,6 +4161,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4029
4161
|
pendingId: suspenseId++,
|
|
4030
4162
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
4031
4163
|
activeBranch: null,
|
|
4164
|
+
isFallbackMountPending: false,
|
|
4032
4165
|
pendingBranch: null,
|
|
4033
4166
|
isInFallback: !isHydrating,
|
|
4034
4167
|
isHydrating,
|
|
@@ -4040,20 +4173,25 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4040
4173
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
4041
4174
|
else if (!resume) {
|
|
4042
4175
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
4176
|
+
let hasUpdatedAnchor = false;
|
|
4043
4177
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
4044
4178
|
if (pendingId === suspense.pendingId) {
|
|
4045
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
4179
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
4046
4180
|
queuePostFlushCb(effects);
|
|
4047
4181
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
4048
4182
|
}
|
|
4049
4183
|
};
|
|
4050
|
-
if (activeBranch) {
|
|
4051
|
-
if (parentNode(activeBranch.el) === container)
|
|
4184
|
+
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
4185
|
+
if (parentNode(activeBranch.el) === container) {
|
|
4186
|
+
anchor = next(activeBranch);
|
|
4187
|
+
hasUpdatedAnchor = true;
|
|
4188
|
+
}
|
|
4052
4189
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
4053
4190
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
4054
4191
|
}
|
|
4055
4192
|
if (!delayEnter) move(pendingBranch, container, anchor, 0, parentComponent);
|
|
4056
4193
|
}
|
|
4194
|
+
suspense.isFallbackMountPending = false;
|
|
4057
4195
|
setActiveBranch(suspense, pendingBranch);
|
|
4058
4196
|
suspense.pendingBranch = null;
|
|
4059
4197
|
suspense.isInFallback = false;
|
|
@@ -4083,12 +4221,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4083
4221
|
triggerEvent(vnode, "onFallback");
|
|
4084
4222
|
const anchor = next(activeBranch);
|
|
4085
4223
|
const mountFallback = () => {
|
|
4224
|
+
suspense.isFallbackMountPending = false;
|
|
4086
4225
|
if (!suspense.isInFallback) return;
|
|
4087
4226
|
patch(null, fallbackVNode, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
4088
4227
|
setActiveBranch(suspense, fallbackVNode);
|
|
4089
4228
|
};
|
|
4090
4229
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
4091
|
-
if (delayEnter)
|
|
4230
|
+
if (delayEnter) {
|
|
4231
|
+
suspense.isFallbackMountPending = true;
|
|
4232
|
+
activeBranch.transition.afterLeave = mountFallback;
|
|
4233
|
+
}
|
|
4092
4234
|
suspense.isInFallback = true;
|
|
4093
4235
|
unmount(activeBranch, parentComponent, null, true);
|
|
4094
4236
|
if (!delayEnter) mountFallback();
|
|
@@ -4107,6 +4249,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4107
4249
|
handleError(err, instance, 0);
|
|
4108
4250
|
}).then((asyncSetupResult) => {
|
|
4109
4251
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
4252
|
+
setCurrentInstance(null, void 0);
|
|
4110
4253
|
instance.asyncResolved = true;
|
|
4111
4254
|
onResolve(asyncSetupResult);
|
|
4112
4255
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -4370,11 +4513,29 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
4370
4513
|
el: vnode.el,
|
|
4371
4514
|
anchor: vnode.anchor,
|
|
4372
4515
|
ctx: vnode.ctx,
|
|
4373
|
-
ce: vnode.ce
|
|
4516
|
+
ce: vnode.ce,
|
|
4517
|
+
vi: vnode.vi,
|
|
4518
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
4519
|
+
vb: vnode.vb
|
|
4374
4520
|
};
|
|
4375
4521
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
4376
4522
|
return cloned;
|
|
4377
4523
|
}
|
|
4524
|
+
function cloneVaporSlotMeta(vnode) {
|
|
4525
|
+
const vaporSlot = vnode.vs;
|
|
4526
|
+
if (!vaporSlot) return vaporSlot;
|
|
4527
|
+
const cloned = {
|
|
4528
|
+
slot: vaporSlot.slot,
|
|
4529
|
+
fallback: vaporSlot.fallback,
|
|
4530
|
+
outletFallback: vaporSlot.outletFallback
|
|
4531
|
+
};
|
|
4532
|
+
if (vnode.el) {
|
|
4533
|
+
cloned.state = vaporSlot.state;
|
|
4534
|
+
cloned.ref = vaporSlot.ref;
|
|
4535
|
+
cloned.scope = vaporSlot.scope;
|
|
4536
|
+
}
|
|
4537
|
+
return cloned;
|
|
4538
|
+
}
|
|
4378
4539
|
/**
|
|
4379
4540
|
* @private
|
|
4380
4541
|
*/
|
|
@@ -4428,6 +4589,10 @@ function normalizeChildren(vnode, children) {
|
|
|
4428
4589
|
}
|
|
4429
4590
|
}
|
|
4430
4591
|
else if ((0, _vue_shared.isFunction)(children)) {
|
|
4592
|
+
if (shapeFlag & 65) {
|
|
4593
|
+
normalizeChildren(vnode, { default: children });
|
|
4594
|
+
return;
|
|
4595
|
+
}
|
|
4431
4596
|
children = {
|
|
4432
4597
|
default: children,
|
|
4433
4598
|
_ctx: currentRenderingInstance
|
|
@@ -4454,6 +4619,7 @@ function mergeProps(...args) {
|
|
|
4454
4619
|
const existing = ret[key];
|
|
4455
4620
|
const incoming = toMerge[key];
|
|
4456
4621
|
if (incoming && existing !== incoming && !((0, _vue_shared.isArray)(existing) && existing.includes(incoming))) ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
4622
|
+
else if (incoming == null && existing == null && !(0, _vue_shared.isModelListener)(key)) ret[key] = incoming;
|
|
4457
4623
|
} else if (key !== "") ret[key] = toMerge[key];
|
|
4458
4624
|
}
|
|
4459
4625
|
return ret;
|
|
@@ -4785,7 +4951,7 @@ function isMemoSame(cached, memo) {
|
|
|
4785
4951
|
}
|
|
4786
4952
|
//#endregion
|
|
4787
4953
|
//#region packages/runtime-core/src/index.ts
|
|
4788
|
-
const version = "3.6.0-
|
|
4954
|
+
const version = "3.6.0-rc.1";
|
|
4789
4955
|
const warn = _vue_shared.NOOP;
|
|
4790
4956
|
/**
|
|
4791
4957
|
* Runtime error messages. Only exposed in dev or esm builds.
|