@vue/runtime-core 3.6.0-rc.11 → 3.6.0-rc.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-core.cjs.js +134 -50
- package/dist/runtime-core.cjs.prod.js +138 -47
- package/dist/runtime-core.d.ts +2 -1
- package/dist/runtime-core.esm-bundler.js +146 -55
- 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.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -309,15 +309,15 @@ function queuePostFlushCb(jobs, id = Infinity) {
|
|
|
309
309
|
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
310
310
|
queueFlush();
|
|
311
311
|
}
|
|
312
|
-
function flushPreFlushCbs(instance, seen) {
|
|
312
|
+
function flushPreFlushCbs(instance, minUid, seen) {
|
|
313
313
|
seen = seen || /* @__PURE__ */ new Map();
|
|
314
314
|
for (let i = flushIndex; i < jobsLength; i++) {
|
|
315
315
|
const cb = jobs[i];
|
|
316
316
|
if (cb.order & 1 || cb.order === Infinity) continue;
|
|
317
|
-
if (instance && cb.order !== instance.uid * 2) continue;
|
|
317
|
+
if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
|
|
318
318
|
if (checkRecursiveUpdates(seen, cb)) continue;
|
|
319
319
|
jobs.splice(i, 1);
|
|
320
|
-
i
|
|
320
|
+
i = instance ? i - 1 : flushIndex - 1;
|
|
321
321
|
jobsLength--;
|
|
322
322
|
if (cb.flags & 2) cb.flags &= -2;
|
|
323
323
|
try {
|
|
@@ -327,15 +327,24 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
function flushPostFlushCbs(seen) {
|
|
330
|
+
function flushPostFlushCbs(seen, skip, minUid = 0) {
|
|
331
331
|
if (postJobs.length) {
|
|
332
|
+
let cbs = postJobs;
|
|
333
|
+
if (skip) {
|
|
334
|
+
cbs = [];
|
|
335
|
+
let kept = 0;
|
|
336
|
+
for (let i = 0; i < postJobs.length; i++) {
|
|
337
|
+
const cb = postJobs[i];
|
|
338
|
+
if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
|
|
339
|
+
else cbs.push(cb);
|
|
340
|
+
}
|
|
341
|
+
postJobs.length = kept;
|
|
342
|
+
} else postJobs = [];
|
|
332
343
|
if (activePostJobs) {
|
|
333
|
-
for (let i = 0; i <
|
|
334
|
-
postJobs.length = 0;
|
|
344
|
+
for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
|
|
335
345
|
return;
|
|
336
346
|
}
|
|
337
|
-
activePostJobs =
|
|
338
|
-
postJobs = [];
|
|
347
|
+
activePostJobs = cbs;
|
|
339
348
|
seen = seen || /* @__PURE__ */ new Map();
|
|
340
349
|
try {
|
|
341
350
|
while (postFlushIndex < activePostJobs.length) {
|
|
@@ -357,17 +366,28 @@ function flushPostFlushCbs(seen) {
|
|
|
357
366
|
}
|
|
358
367
|
let isFlushing = false;
|
|
359
368
|
/**
|
|
369
|
+
* Run a root render, then flush the jobs it is responsible for. A mount or
|
|
370
|
+
* unmount (`minUid` given) only flushes the jobs of the components it created
|
|
371
|
+
* and the post cbs it queued, so pre watchers triggered in setup run before
|
|
372
|
+
* mounted (#5721) while the jobs of other components stay in the queue and
|
|
373
|
+
* keep their order (#6728). A root update keeps flushing all pending pre jobs
|
|
374
|
+
* and post cbs, as the jobs of the components it re-renders may predate it.
|
|
375
|
+
*
|
|
360
376
|
* @internal
|
|
361
377
|
*/
|
|
362
|
-
function flushOnAppMount(
|
|
363
|
-
if (
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
378
|
+
function flushOnAppMount(fn, minUid) {
|
|
379
|
+
if (isFlushing) {
|
|
380
|
+
fn();
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
const queued = minUid === void 0 ? void 0 : new Set(postJobs);
|
|
384
|
+
fn();
|
|
385
|
+
isFlushing = true;
|
|
386
|
+
try {
|
|
387
|
+
flushPreFlushCbs(void 0, minUid);
|
|
388
|
+
flushPostFlushCbs(void 0, queued, minUid);
|
|
389
|
+
} finally {
|
|
390
|
+
isFlushing = false;
|
|
371
391
|
}
|
|
372
392
|
}
|
|
373
393
|
function flushJobs(seen) {
|
|
@@ -835,7 +855,7 @@ var RenderWatcherEffect = class extends _vue_reactivity.WatcherEffect {
|
|
|
835
855
|
this.flags |= 128;
|
|
836
856
|
job.flags |= 2;
|
|
837
857
|
}
|
|
838
|
-
|
|
858
|
+
job.i = instance;
|
|
839
859
|
this.job = job;
|
|
840
860
|
}
|
|
841
861
|
notify() {
|
|
@@ -1046,7 +1066,11 @@ const TeleportImpl = {
|
|
|
1046
1066
|
hydrate: hydrateTeleport
|
|
1047
1067
|
};
|
|
1048
1068
|
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
|
|
1049
|
-
if (moveType === 0)
|
|
1069
|
+
if (moveType === 0) {
|
|
1070
|
+
if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
|
|
1071
|
+
insert(vnode.targetAnchor, container, parentAnchor);
|
|
1072
|
+
parentAnchor = vnode.targetAnchor;
|
|
1073
|
+
}
|
|
1050
1074
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
1051
1075
|
const isReorder = moveType === 2;
|
|
1052
1076
|
if (isReorder) insert(el, container, parentAnchor);
|
|
@@ -1167,6 +1191,10 @@ const BaseTransitionPropsValidators = {
|
|
|
1167
1191
|
};
|
|
1168
1192
|
function isEmptyTransitionChild(vnode, instance) {
|
|
1169
1193
|
if (vnode.type === Comment) return true;
|
|
1194
|
+
if (vnode.type === Fragment) {
|
|
1195
|
+
const child = (0, _vue_shared.isArray)(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1196
|
+
return !child || isEmptyTransitionChild(child, instance);
|
|
1197
|
+
}
|
|
1170
1198
|
if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
1171
1199
|
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
1172
1200
|
}
|
|
@@ -1227,7 +1255,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1227
1255
|
},
|
|
1228
1256
|
earlyRemove: () => {
|
|
1229
1257
|
const leavingVNode = leavingVNodesCache[key];
|
|
1230
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)
|
|
1258
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
|
|
1259
|
+
let leavingCb = leavingVNode.el[leaveCbKey];
|
|
1260
|
+
if (!leavingCb) {
|
|
1261
|
+
const leavingRoot = getTransitionRoot(leavingVNode);
|
|
1262
|
+
leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
|
|
1263
|
+
}
|
|
1264
|
+
if (leavingCb) leavingCb();
|
|
1265
|
+
}
|
|
1231
1266
|
},
|
|
1232
1267
|
cloneHooks: (vnode) => {
|
|
1233
1268
|
const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
|
|
@@ -1421,7 +1456,13 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
1421
1456
|
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1422
1457
|
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1423
1458
|
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
1424
|
-
} else
|
|
1459
|
+
} else {
|
|
1460
|
+
vnode.transition = hooks;
|
|
1461
|
+
if (vnode.type === Fragment && (0, _vue_shared.isArray)(vnode.children)) {
|
|
1462
|
+
const child = filterSingleRoot(vnode.children, false);
|
|
1463
|
+
if (child) setTransitionHooks(child, hooks);
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1425
1466
|
return hooks;
|
|
1426
1467
|
}
|
|
1427
1468
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
@@ -1444,6 +1485,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1444
1485
|
function checkTransitionMode(mode) {
|
|
1445
1486
|
if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") warn$1(`invalid <transition> mode: ${mode}`);
|
|
1446
1487
|
}
|
|
1488
|
+
function getTransitionRoot(vnode) {
|
|
1489
|
+
if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
|
|
1490
|
+
if (vnode.type === Fragment) {
|
|
1491
|
+
const child = (0, _vue_shared.isArray)(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1492
|
+
return child ? getTransitionRoot(child) : void 0;
|
|
1493
|
+
}
|
|
1494
|
+
if (vnode.type !== Comment) return vnode;
|
|
1495
|
+
}
|
|
1447
1496
|
//#endregion
|
|
1448
1497
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1449
1498
|
/*@__NO_SIDE_EFFECTS__*/
|
|
@@ -2073,14 +2122,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
|
2073
2122
|
break;
|
|
2074
2123
|
}
|
|
2075
2124
|
}, opts);
|
|
2076
|
-
|
|
2077
|
-
if (!(el instanceof Element)) return;
|
|
2125
|
+
const observe = (el) => {
|
|
2078
2126
|
if (elementIsVisibleInViewport(el)) {
|
|
2079
2127
|
hydrate();
|
|
2080
2128
|
ob.disconnect();
|
|
2081
2129
|
return false;
|
|
2082
2130
|
}
|
|
2131
|
+
if (getComputedStyle(el).display === "contents") {
|
|
2132
|
+
for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
|
|
2133
|
+
}
|
|
2083
2134
|
ob.observe(el);
|
|
2135
|
+
};
|
|
2136
|
+
forEach((el) => {
|
|
2137
|
+
if (!(el instanceof Element)) return;
|
|
2138
|
+
return observe(el);
|
|
2084
2139
|
});
|
|
2085
2140
|
return () => ob.disconnect();
|
|
2086
2141
|
};
|
|
@@ -2342,7 +2397,10 @@ const KeepAlive = {
|
|
|
2342
2397
|
function pruneCacheEntry(key) {
|
|
2343
2398
|
const cached = cache.get(key);
|
|
2344
2399
|
if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
|
|
2345
|
-
else if (current)
|
|
2400
|
+
else if (current) {
|
|
2401
|
+
resetShapeFlag(current);
|
|
2402
|
+
if (cached) resetShapeFlag(cached);
|
|
2403
|
+
}
|
|
2346
2404
|
cache.delete(key);
|
|
2347
2405
|
keys.delete(key);
|
|
2348
2406
|
}
|
|
@@ -2686,6 +2744,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
2686
2744
|
owner: currentRenderingInstance
|
|
2687
2745
|
}] : void 0
|
|
2688
2746
|
};
|
|
2747
|
+
if (branchKey != null && props.key == null) {
|
|
2748
|
+
ret.vs.props = ret.props;
|
|
2749
|
+
ret.props = (0, _vue_shared.extend)({}, ret.props, { key: branchKey });
|
|
2750
|
+
ret.key = branchKey;
|
|
2751
|
+
}
|
|
2689
2752
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2690
2753
|
return ret;
|
|
2691
2754
|
}
|
|
@@ -3878,7 +3941,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3878
3941
|
if (nextKeys.length !== Object.keys(prevProps).length) return true;
|
|
3879
3942
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
3880
3943
|
const key = nextKeys[i];
|
|
3881
|
-
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
3944
|
+
if (!(0, _vue_shared.hasOwn)(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
3882
3945
|
}
|
|
3883
3946
|
return false;
|
|
3884
3947
|
}
|
|
@@ -4569,7 +4632,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4569
4632
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4570
4633
|
const oldVNode = oldChildren[i];
|
|
4571
4634
|
const newVNode = newChildren[i];
|
|
4572
|
-
const
|
|
4635
|
+
const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
|
|
4636
|
+
const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
|
|
4573
4637
|
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4574
4638
|
}
|
|
4575
4639
|
};
|
|
@@ -4661,6 +4725,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4661
4725
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4662
4726
|
pushWarningContext(n2);
|
|
4663
4727
|
n2.el = n1.el;
|
|
4728
|
+
n2.placeholder = n1.placeholder;
|
|
4664
4729
|
updateComponentPreRender(instance, n2, optimized);
|
|
4665
4730
|
popWarningContext();
|
|
4666
4731
|
return;
|
|
@@ -4670,6 +4735,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4670
4735
|
}
|
|
4671
4736
|
} else {
|
|
4672
4737
|
n2.el = n1.el;
|
|
4738
|
+
n2.placeholder = n1.placeholder;
|
|
4673
4739
|
instance.vnode = n2;
|
|
4674
4740
|
}
|
|
4675
4741
|
};
|
|
@@ -5014,12 +5080,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5014
5080
|
};
|
|
5015
5081
|
const remove = (vnode) => {
|
|
5016
5082
|
const { type, el, anchor, transition } = vnode;
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
else remove(child);
|
|
5021
|
-
});
|
|
5022
|
-
else removeFragment(el, anchor);
|
|
5083
|
+
const isFragment = type === Fragment;
|
|
5084
|
+
if (isFragment && !transition) {
|
|
5085
|
+
removeFragment(el, anchor);
|
|
5023
5086
|
return;
|
|
5024
5087
|
}
|
|
5025
5088
|
if (type === Static) {
|
|
@@ -5027,8 +5090,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5027
5090
|
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5028
5091
|
return;
|
|
5029
5092
|
}
|
|
5030
|
-
|
|
5031
|
-
|
|
5093
|
+
const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
|
|
5094
|
+
const performRemove = () => {
|
|
5095
|
+
if (isFragment) {
|
|
5096
|
+
if (hostParentNode(el)) removeFragment(el, anchor);
|
|
5097
|
+
} else hostRemove(el);
|
|
5098
|
+
};
|
|
5099
|
+
if (transition) {
|
|
5100
|
+
let leavingEl = leavingNode && leavingNode.el;
|
|
5101
|
+
let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
|
|
5102
|
+
if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
|
|
5103
|
+
leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
|
|
5104
|
+
isElement = !!leavingEl;
|
|
5105
|
+
}
|
|
5106
|
+
performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
|
|
5107
|
+
} else performRemove();
|
|
5032
5108
|
};
|
|
5033
5109
|
const removeFragment = (cur, end) => {
|
|
5034
5110
|
let next;
|
|
@@ -5071,15 +5147,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5071
5147
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
5072
5148
|
};
|
|
5073
5149
|
const render = (vnode, container, namespace) => {
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
5081
|
-
container._vnode = vnode;
|
|
5082
|
-
flushOnAppMount(instance);
|
|
5150
|
+
flushOnAppMount(() => {
|
|
5151
|
+
if (vnode == null) {
|
|
5152
|
+
if (container._vnode) unmount(container._vnode, null, null, true);
|
|
5153
|
+
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
5154
|
+
container._vnode = vnode;
|
|
5155
|
+
}, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
|
|
5083
5156
|
};
|
|
5084
5157
|
const internals = {
|
|
5085
5158
|
p: patch,
|
|
@@ -5472,13 +5545,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5472
5545
|
registerDep(instance, onResolve) {
|
|
5473
5546
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
5474
5547
|
if (isInPendingSuspense) suspense.deps++;
|
|
5475
|
-
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
5476
5548
|
instance.asyncDep.catch((err) => {
|
|
5477
5549
|
handleError(err, instance, 0);
|
|
5478
5550
|
}).then((asyncSetupResult) => {
|
|
5479
5551
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
5480
5552
|
setCurrentInstance(null, void 0);
|
|
5481
|
-
if (
|
|
5553
|
+
if (!instance.scope.active) {
|
|
5482
5554
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
5483
5555
|
return;
|
|
5484
5556
|
}
|
|
@@ -5791,7 +5863,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5791
5863
|
ctx: vnode.ctx,
|
|
5792
5864
|
ce: vnode.ce,
|
|
5793
5865
|
vi: vnode.vi,
|
|
5794
|
-
vs: cloneVaporSlotMeta(vnode),
|
|
5866
|
+
vs: cloneVaporSlotMeta(vnode, extraProps),
|
|
5795
5867
|
vb: vnode.vb,
|
|
5796
5868
|
ibu: vnode.ibu,
|
|
5797
5869
|
iu: vnode.iu,
|
|
@@ -5800,13 +5872,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5800
5872
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5801
5873
|
return cloned;
|
|
5802
5874
|
}
|
|
5803
|
-
function cloneVaporSlotMeta(vnode) {
|
|
5875
|
+
function cloneVaporSlotMeta(vnode, extraProps) {
|
|
5804
5876
|
const vaporSlot = vnode.vs;
|
|
5805
5877
|
if (!vaporSlot) return vaporSlot;
|
|
5806
5878
|
const cloned = {
|
|
5807
5879
|
slot: vaporSlot.slot,
|
|
5808
|
-
outlets: vaporSlot.outlets
|
|
5880
|
+
outlets: vaporSlot.outlets,
|
|
5881
|
+
props: vaporSlot.props
|
|
5809
5882
|
};
|
|
5883
|
+
if (vaporSlot.props && extraProps) {
|
|
5884
|
+
let extraSlotProps;
|
|
5885
|
+
for (const key in extraProps) if (key !== "key") {
|
|
5886
|
+
if (!extraSlotProps) extraSlotProps = {};
|
|
5887
|
+
extraSlotProps[key] = extraProps[key];
|
|
5888
|
+
}
|
|
5889
|
+
if (extraSlotProps) cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
|
|
5890
|
+
}
|
|
5810
5891
|
if (vnode.el) {
|
|
5811
5892
|
cloned.state = vaporSlot.state;
|
|
5812
5893
|
cloned.ref = vaporSlot.ref;
|
|
@@ -5998,6 +6079,9 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
5998
6079
|
//#region packages/runtime-core/src/component.ts
|
|
5999
6080
|
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
6000
6081
|
let uid = 0;
|
|
6082
|
+
function getNextUid() {
|
|
6083
|
+
return uid;
|
|
6084
|
+
}
|
|
6001
6085
|
function createComponentInstance(vnode, parent, suspense) {
|
|
6002
6086
|
const type = vnode.type;
|
|
6003
6087
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
@@ -6504,7 +6588,7 @@ function isMemoSame(cached, memo) {
|
|
|
6504
6588
|
}
|
|
6505
6589
|
//#endregion
|
|
6506
6590
|
//#region packages/runtime-core/src/index.ts
|
|
6507
|
-
const version = "3.6.0-rc.
|
|
6591
|
+
const version = "3.6.0-rc.12";
|
|
6508
6592
|
const warn = warn$1;
|
|
6509
6593
|
/**
|
|
6510
6594
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -205,13 +205,13 @@ function queuePostFlushCb(jobs, id = Infinity) {
|
|
|
205
205
|
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
206
206
|
queueFlush();
|
|
207
207
|
}
|
|
208
|
-
function flushPreFlushCbs(instance, seen) {
|
|
208
|
+
function flushPreFlushCbs(instance, minUid, seen) {
|
|
209
209
|
for (let i = flushIndex; i < jobsLength; i++) {
|
|
210
210
|
const cb = jobs[i];
|
|
211
211
|
if (cb.order & 1 || cb.order === Infinity) continue;
|
|
212
|
-
if (instance && cb.order !== instance.uid * 2) continue;
|
|
212
|
+
if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
|
|
213
213
|
jobs.splice(i, 1);
|
|
214
|
-
i
|
|
214
|
+
i = instance ? i - 1 : flushIndex - 1;
|
|
215
215
|
jobsLength--;
|
|
216
216
|
if (cb.flags & 2) cb.flags &= -2;
|
|
217
217
|
try {
|
|
@@ -221,15 +221,24 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
function flushPostFlushCbs(seen) {
|
|
224
|
+
function flushPostFlushCbs(seen, skip, minUid = 0) {
|
|
225
225
|
if (postJobs.length) {
|
|
226
|
+
let cbs = postJobs;
|
|
227
|
+
if (skip) {
|
|
228
|
+
cbs = [];
|
|
229
|
+
let kept = 0;
|
|
230
|
+
for (let i = 0; i < postJobs.length; i++) {
|
|
231
|
+
const cb = postJobs[i];
|
|
232
|
+
if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
|
|
233
|
+
else cbs.push(cb);
|
|
234
|
+
}
|
|
235
|
+
postJobs.length = kept;
|
|
236
|
+
} else postJobs = [];
|
|
226
237
|
if (activePostJobs) {
|
|
227
|
-
for (let i = 0; i <
|
|
228
|
-
postJobs.length = 0;
|
|
238
|
+
for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
|
|
229
239
|
return;
|
|
230
240
|
}
|
|
231
|
-
activePostJobs =
|
|
232
|
-
postJobs = [];
|
|
241
|
+
activePostJobs = cbs;
|
|
233
242
|
try {
|
|
234
243
|
while (postFlushIndex < activePostJobs.length) {
|
|
235
244
|
const cb = activePostJobs[postFlushIndex++];
|
|
@@ -249,17 +258,28 @@ function flushPostFlushCbs(seen) {
|
|
|
249
258
|
}
|
|
250
259
|
let isFlushing = false;
|
|
251
260
|
/**
|
|
261
|
+
* Run a root render, then flush the jobs it is responsible for. A mount or
|
|
262
|
+
* unmount (`minUid` given) only flushes the jobs of the components it created
|
|
263
|
+
* and the post cbs it queued, so pre watchers triggered in setup run before
|
|
264
|
+
* mounted (#5721) while the jobs of other components stay in the queue and
|
|
265
|
+
* keep their order (#6728). A root update keeps flushing all pending pre jobs
|
|
266
|
+
* and post cbs, as the jobs of the components it re-renders may predate it.
|
|
267
|
+
*
|
|
252
268
|
* @internal
|
|
253
269
|
*/
|
|
254
|
-
function flushOnAppMount(
|
|
255
|
-
if (
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
270
|
+
function flushOnAppMount(fn, minUid) {
|
|
271
|
+
if (isFlushing) {
|
|
272
|
+
fn();
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const queued = minUid === void 0 ? void 0 : new Set(postJobs);
|
|
276
|
+
fn();
|
|
277
|
+
isFlushing = true;
|
|
278
|
+
try {
|
|
279
|
+
flushPreFlushCbs(void 0, minUid);
|
|
280
|
+
flushPostFlushCbs(void 0, queued, minUid);
|
|
281
|
+
} finally {
|
|
282
|
+
isFlushing = false;
|
|
263
283
|
}
|
|
264
284
|
}
|
|
265
285
|
function flushJobs(seen) {
|
|
@@ -470,7 +490,7 @@ var RenderWatcherEffect = class extends _vue_reactivity.WatcherEffect {
|
|
|
470
490
|
this.flags |= 128;
|
|
471
491
|
job.flags |= 2;
|
|
472
492
|
}
|
|
473
|
-
|
|
493
|
+
job.i = instance;
|
|
474
494
|
this.job = job;
|
|
475
495
|
}
|
|
476
496
|
notify() {
|
|
@@ -662,7 +682,11 @@ const TeleportImpl = {
|
|
|
662
682
|
hydrate: hydrateTeleport
|
|
663
683
|
};
|
|
664
684
|
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
|
|
665
|
-
if (moveType === 0)
|
|
685
|
+
if (moveType === 0) {
|
|
686
|
+
if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
|
|
687
|
+
insert(vnode.targetAnchor, container, parentAnchor);
|
|
688
|
+
parentAnchor = vnode.targetAnchor;
|
|
689
|
+
}
|
|
666
690
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
667
691
|
const isReorder = moveType === 2;
|
|
668
692
|
if (isReorder) insert(el, container, parentAnchor);
|
|
@@ -783,6 +807,10 @@ const BaseTransitionPropsValidators = {
|
|
|
783
807
|
};
|
|
784
808
|
function isEmptyTransitionChild(vnode, instance) {
|
|
785
809
|
if (vnode.type === Comment) return true;
|
|
810
|
+
if (vnode.type === Fragment) {
|
|
811
|
+
const child = (0, _vue_shared.isArray)(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
812
|
+
return !child || isEmptyTransitionChild(child, instance);
|
|
813
|
+
}
|
|
786
814
|
if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
787
815
|
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
788
816
|
}
|
|
@@ -837,7 +865,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
837
865
|
},
|
|
838
866
|
earlyRemove: () => {
|
|
839
867
|
const leavingVNode = leavingVNodesCache[key];
|
|
840
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)
|
|
868
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
|
|
869
|
+
let leavingCb = leavingVNode.el[leaveCbKey];
|
|
870
|
+
if (!leavingCb) {
|
|
871
|
+
const leavingRoot = getTransitionRoot(leavingVNode);
|
|
872
|
+
leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
|
|
873
|
+
}
|
|
874
|
+
if (leavingCb) leavingCb();
|
|
875
|
+
}
|
|
841
876
|
},
|
|
842
877
|
cloneHooks: (vnode) => {
|
|
843
878
|
const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
|
|
@@ -1031,7 +1066,13 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
1031
1066
|
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1032
1067
|
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1033
1068
|
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
1034
|
-
} else
|
|
1069
|
+
} else {
|
|
1070
|
+
vnode.transition = hooks;
|
|
1071
|
+
if (vnode.type === Fragment && (0, _vue_shared.isArray)(vnode.children)) {
|
|
1072
|
+
const child = filterSingleRoot(vnode.children, false);
|
|
1073
|
+
if (child) setTransitionHooks(child, hooks);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1035
1076
|
return hooks;
|
|
1036
1077
|
}
|
|
1037
1078
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
@@ -1048,6 +1089,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1048
1089
|
if (keyedFragmentCount > 1) for (let i = 0; i < ret.length; i++) ret[i].patchFlag = -2;
|
|
1049
1090
|
return ret;
|
|
1050
1091
|
}
|
|
1092
|
+
function getTransitionRoot(vnode) {
|
|
1093
|
+
if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
|
|
1094
|
+
if (vnode.type === Fragment) {
|
|
1095
|
+
const child = (0, _vue_shared.isArray)(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1096
|
+
return child ? getTransitionRoot(child) : void 0;
|
|
1097
|
+
}
|
|
1098
|
+
if (vnode.type !== Comment) return vnode;
|
|
1099
|
+
}
|
|
1051
1100
|
//#endregion
|
|
1052
1101
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1053
1102
|
/*@__NO_SIDE_EFFECTS__*/
|
|
@@ -1536,14 +1585,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
|
1536
1585
|
break;
|
|
1537
1586
|
}
|
|
1538
1587
|
}, opts);
|
|
1539
|
-
|
|
1540
|
-
if (!(el instanceof Element)) return;
|
|
1588
|
+
const observe = (el) => {
|
|
1541
1589
|
if (elementIsVisibleInViewport(el)) {
|
|
1542
1590
|
hydrate();
|
|
1543
1591
|
ob.disconnect();
|
|
1544
1592
|
return false;
|
|
1545
1593
|
}
|
|
1594
|
+
if (getComputedStyle(el).display === "contents") {
|
|
1595
|
+
for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
|
|
1596
|
+
}
|
|
1546
1597
|
ob.observe(el);
|
|
1598
|
+
};
|
|
1599
|
+
forEach((el) => {
|
|
1600
|
+
if (!(el instanceof Element)) return;
|
|
1601
|
+
return observe(el);
|
|
1547
1602
|
});
|
|
1548
1603
|
return () => ob.disconnect();
|
|
1549
1604
|
};
|
|
@@ -1796,7 +1851,10 @@ const KeepAlive = {
|
|
|
1796
1851
|
function pruneCacheEntry(key) {
|
|
1797
1852
|
const cached = cache.get(key);
|
|
1798
1853
|
if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
|
|
1799
|
-
else if (current)
|
|
1854
|
+
else if (current) {
|
|
1855
|
+
resetShapeFlag(current);
|
|
1856
|
+
if (cached) resetShapeFlag(cached);
|
|
1857
|
+
}
|
|
1800
1858
|
cache.delete(key);
|
|
1801
1859
|
keys.delete(key);
|
|
1802
1860
|
}
|
|
@@ -2051,8 +2109,11 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2051
2109
|
ret = new Array(source.length);
|
|
2052
2110
|
for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? (0, _vue_reactivity.toReadonly)((0, _vue_reactivity.toReactive)(source[i])) : (0, _vue_reactivity.toReactive)(source[i]) : source[i], i, void 0, cached && cached[i]);
|
|
2053
2111
|
} else if (typeof source === "number") {
|
|
2054
|
-
|
|
2055
|
-
|
|
2112
|
+
if (!Number.isInteger(source) || source < 0) ret = [];
|
|
2113
|
+
else {
|
|
2114
|
+
ret = new Array(source);
|
|
2115
|
+
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2116
|
+
}
|
|
2056
2117
|
} else if ((0, _vue_shared.isObject)(source)) {
|
|
2057
2118
|
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2058
2119
|
else {
|
|
@@ -2128,6 +2189,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
2128
2189
|
owner: currentRenderingInstance
|
|
2129
2190
|
}] : void 0
|
|
2130
2191
|
};
|
|
2192
|
+
if (branchKey != null && props.key == null) {
|
|
2193
|
+
ret.vs.props = ret.props;
|
|
2194
|
+
ret.props = (0, _vue_shared.extend)({}, ret.props, { key: branchKey });
|
|
2195
|
+
ret.key = branchKey;
|
|
2196
|
+
}
|
|
2131
2197
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2132
2198
|
return ret;
|
|
2133
2199
|
}
|
|
@@ -3039,7 +3105,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3039
3105
|
if (nextKeys.length !== Object.keys(prevProps).length) return true;
|
|
3040
3106
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
3041
3107
|
const key = nextKeys[i];
|
|
3042
|
-
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
3108
|
+
if (!(0, _vue_shared.hasOwn)(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
3043
3109
|
}
|
|
3044
3110
|
return false;
|
|
3045
3111
|
}
|
|
@@ -3538,7 +3604,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3538
3604
|
for (let i = 0; i < newChildren.length; i++) {
|
|
3539
3605
|
const oldVNode = oldChildren[i];
|
|
3540
3606
|
const newVNode = newChildren[i];
|
|
3541
|
-
const
|
|
3607
|
+
const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
|
|
3608
|
+
const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
|
|
3542
3609
|
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
3543
3610
|
}
|
|
3544
3611
|
};
|
|
@@ -3614,6 +3681,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3614
3681
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
3615
3682
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
3616
3683
|
n2.el = n1.el;
|
|
3684
|
+
n2.placeholder = n1.placeholder;
|
|
3617
3685
|
updateComponentPreRender(instance, n2, optimized);
|
|
3618
3686
|
return;
|
|
3619
3687
|
} else {
|
|
@@ -3622,6 +3690,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3622
3690
|
}
|
|
3623
3691
|
} else {
|
|
3624
3692
|
n2.el = n1.el;
|
|
3693
|
+
n2.placeholder = n1.placeholder;
|
|
3625
3694
|
instance.vnode = n2;
|
|
3626
3695
|
}
|
|
3627
3696
|
};
|
|
@@ -3945,7 +4014,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3945
4014
|
};
|
|
3946
4015
|
const remove = (vnode) => {
|
|
3947
4016
|
const { type, el, anchor, transition } = vnode;
|
|
3948
|
-
|
|
4017
|
+
const isFragment = type === Fragment;
|
|
4018
|
+
if (isFragment && !transition) {
|
|
3949
4019
|
removeFragment(el, anchor);
|
|
3950
4020
|
return;
|
|
3951
4021
|
}
|
|
@@ -3954,8 +4024,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3954
4024
|
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
3955
4025
|
return;
|
|
3956
4026
|
}
|
|
3957
|
-
|
|
3958
|
-
|
|
4027
|
+
const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
|
|
4028
|
+
const performRemove = () => {
|
|
4029
|
+
if (isFragment) {
|
|
4030
|
+
if (hostParentNode(el)) removeFragment(el, anchor);
|
|
4031
|
+
} else hostRemove(el);
|
|
4032
|
+
};
|
|
4033
|
+
if (transition) {
|
|
4034
|
+
let leavingEl = leavingNode && leavingNode.el;
|
|
4035
|
+
let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
|
|
4036
|
+
if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
|
|
4037
|
+
leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
|
|
4038
|
+
isElement = !!leavingEl;
|
|
4039
|
+
}
|
|
4040
|
+
performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
|
|
4041
|
+
} else performRemove();
|
|
3959
4042
|
};
|
|
3960
4043
|
const removeFragment = (cur, end) => {
|
|
3961
4044
|
let next;
|
|
@@ -3996,15 +4079,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3996
4079
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
3997
4080
|
};
|
|
3998
4081
|
const render = (vnode, container, namespace) => {
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
4006
|
-
container._vnode = vnode;
|
|
4007
|
-
flushOnAppMount(instance);
|
|
4082
|
+
flushOnAppMount(() => {
|
|
4083
|
+
if (vnode == null) {
|
|
4084
|
+
if (container._vnode) unmount(container._vnode, null, null, true);
|
|
4085
|
+
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
4086
|
+
container._vnode = vnode;
|
|
4087
|
+
}, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
|
|
4008
4088
|
};
|
|
4009
4089
|
const internals = {
|
|
4010
4090
|
p: patch,
|
|
@@ -4378,13 +4458,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4378
4458
|
registerDep(instance, onResolve) {
|
|
4379
4459
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
4380
4460
|
if (isInPendingSuspense) suspense.deps++;
|
|
4381
|
-
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
4382
4461
|
instance.asyncDep.catch((err) => {
|
|
4383
4462
|
handleError(err, instance, 0);
|
|
4384
4463
|
}).then((asyncSetupResult) => {
|
|
4385
4464
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
4386
4465
|
setCurrentInstance(null, void 0);
|
|
4387
|
-
if (
|
|
4466
|
+
if (!instance.scope.active) {
|
|
4388
4467
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
4389
4468
|
return;
|
|
4390
4469
|
}
|
|
@@ -4656,7 +4735,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
4656
4735
|
ctx: vnode.ctx,
|
|
4657
4736
|
ce: vnode.ce,
|
|
4658
4737
|
vi: vnode.vi,
|
|
4659
|
-
vs: cloneVaporSlotMeta(vnode),
|
|
4738
|
+
vs: cloneVaporSlotMeta(vnode, extraProps),
|
|
4660
4739
|
vb: vnode.vb,
|
|
4661
4740
|
ibu: vnode.ibu,
|
|
4662
4741
|
iu: vnode.iu,
|
|
@@ -4665,13 +4744,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
4665
4744
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
4666
4745
|
return cloned;
|
|
4667
4746
|
}
|
|
4668
|
-
function cloneVaporSlotMeta(vnode) {
|
|
4747
|
+
function cloneVaporSlotMeta(vnode, extraProps) {
|
|
4669
4748
|
const vaporSlot = vnode.vs;
|
|
4670
4749
|
if (!vaporSlot) return vaporSlot;
|
|
4671
4750
|
const cloned = {
|
|
4672
4751
|
slot: vaporSlot.slot,
|
|
4673
|
-
outlets: vaporSlot.outlets
|
|
4752
|
+
outlets: vaporSlot.outlets,
|
|
4753
|
+
props: vaporSlot.props
|
|
4674
4754
|
};
|
|
4755
|
+
if (vaporSlot.props && extraProps) {
|
|
4756
|
+
let extraSlotProps;
|
|
4757
|
+
for (const key in extraProps) if (key !== "key") {
|
|
4758
|
+
if (!extraSlotProps) extraSlotProps = {};
|
|
4759
|
+
extraSlotProps[key] = extraProps[key];
|
|
4760
|
+
}
|
|
4761
|
+
if (extraSlotProps) cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
|
|
4762
|
+
}
|
|
4675
4763
|
if (vnode.el) {
|
|
4676
4764
|
cloned.state = vaporSlot.state;
|
|
4677
4765
|
cloned.ref = vaporSlot.ref;
|
|
@@ -4848,6 +4936,9 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
4848
4936
|
//#region packages/runtime-core/src/component.ts
|
|
4849
4937
|
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
4850
4938
|
let uid = 0;
|
|
4939
|
+
function getNextUid() {
|
|
4940
|
+
return uid;
|
|
4941
|
+
}
|
|
4851
4942
|
function createComponentInstance(vnode, parent, suspense) {
|
|
4852
4943
|
const type = vnode.type;
|
|
4853
4944
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
@@ -5105,7 +5196,7 @@ function isMemoSame(cached, memo) {
|
|
|
5105
5196
|
}
|
|
5106
5197
|
//#endregion
|
|
5107
5198
|
//#region packages/runtime-core/src/index.ts
|
|
5108
|
-
const version = "3.6.0-rc.
|
|
5199
|
+
const version = "3.6.0-rc.12";
|
|
5109
5200
|
const warn = _vue_shared.NOOP;
|
|
5110
5201
|
/**
|
|
5111
5202
|
* Runtime error messages. Only exposed in dev or esm builds.
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -56,8 +56,9 @@ export interface SchedulerJob extends Function {
|
|
|
56
56
|
/**
|
|
57
57
|
* Attached by renderer.ts when setting up a component's render effect
|
|
58
58
|
* Used to obtain component information when reporting max recursive updates.
|
|
59
|
+
* Also set on watcher jobs: null marks a watcher without an owner component.
|
|
59
60
|
*/
|
|
60
|
-
i?: GenericComponentInstance;
|
|
61
|
+
i?: GenericComponentInstance | null;
|
|
61
62
|
}
|
|
62
63
|
type SchedulerJobs = SchedulerJob | SchedulerJob[];
|
|
63
64
|
export declare function nextTick(): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -317,15 +317,15 @@ function queuePostFlushCb(jobs, id = Infinity) {
|
|
|
317
317
|
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
318
318
|
queueFlush();
|
|
319
319
|
}
|
|
320
|
-
function flushPreFlushCbs(instance, seen) {
|
|
320
|
+
function flushPreFlushCbs(instance, minUid, seen) {
|
|
321
321
|
if (!!(process.env.NODE_ENV !== "production")) seen = seen || /* @__PURE__ */ new Map();
|
|
322
322
|
for (let i = flushIndex; i < jobsLength; i++) {
|
|
323
323
|
const cb = jobs[i];
|
|
324
324
|
if (cb.order & 1 || cb.order === Infinity) continue;
|
|
325
|
-
if (instance && cb.order !== instance.uid * 2) continue;
|
|
325
|
+
if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
|
|
326
326
|
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) continue;
|
|
327
327
|
jobs.splice(i, 1);
|
|
328
|
-
i
|
|
328
|
+
i = instance ? i - 1 : flushIndex - 1;
|
|
329
329
|
jobsLength--;
|
|
330
330
|
if (cb.flags & 2) cb.flags &= -2;
|
|
331
331
|
try {
|
|
@@ -335,15 +335,24 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
function flushPostFlushCbs(seen) {
|
|
338
|
+
function flushPostFlushCbs(seen, skip, minUid = 0) {
|
|
339
339
|
if (postJobs.length) {
|
|
340
|
+
let cbs = postJobs;
|
|
341
|
+
if (skip) {
|
|
342
|
+
cbs = [];
|
|
343
|
+
let kept = 0;
|
|
344
|
+
for (let i = 0; i < postJobs.length; i++) {
|
|
345
|
+
const cb = postJobs[i];
|
|
346
|
+
if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
|
|
347
|
+
else cbs.push(cb);
|
|
348
|
+
}
|
|
349
|
+
postJobs.length = kept;
|
|
350
|
+
} else postJobs = [];
|
|
340
351
|
if (activePostJobs) {
|
|
341
|
-
for (let i = 0; i <
|
|
342
|
-
postJobs.length = 0;
|
|
352
|
+
for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
|
|
343
353
|
return;
|
|
344
354
|
}
|
|
345
|
-
activePostJobs =
|
|
346
|
-
postJobs = [];
|
|
355
|
+
activePostJobs = cbs;
|
|
347
356
|
if (!!(process.env.NODE_ENV !== "production")) seen = seen || /* @__PURE__ */ new Map();
|
|
348
357
|
try {
|
|
349
358
|
while (postFlushIndex < activePostJobs.length) {
|
|
@@ -365,17 +374,28 @@ function flushPostFlushCbs(seen) {
|
|
|
365
374
|
}
|
|
366
375
|
let isFlushing = false;
|
|
367
376
|
/**
|
|
377
|
+
* Run a root render, then flush the jobs it is responsible for. A mount or
|
|
378
|
+
* unmount (`minUid` given) only flushes the jobs of the components it created
|
|
379
|
+
* and the post cbs it queued, so pre watchers triggered in setup run before
|
|
380
|
+
* mounted (#5721) while the jobs of other components stay in the queue and
|
|
381
|
+
* keep their order (#6728). A root update keeps flushing all pending pre jobs
|
|
382
|
+
* and post cbs, as the jobs of the components it re-renders may predate it.
|
|
383
|
+
*
|
|
368
384
|
* @internal
|
|
369
385
|
*/
|
|
370
|
-
function flushOnAppMount(
|
|
371
|
-
if (
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
386
|
+
function flushOnAppMount(fn, minUid) {
|
|
387
|
+
if (isFlushing) {
|
|
388
|
+
fn();
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
const queued = minUid === void 0 ? void 0 : new Set(postJobs);
|
|
392
|
+
fn();
|
|
393
|
+
isFlushing = true;
|
|
394
|
+
try {
|
|
395
|
+
flushPreFlushCbs(void 0, minUid);
|
|
396
|
+
flushPostFlushCbs(void 0, queued, minUid);
|
|
397
|
+
} finally {
|
|
398
|
+
isFlushing = false;
|
|
379
399
|
}
|
|
380
400
|
}
|
|
381
401
|
function flushJobs(seen) {
|
|
@@ -845,7 +865,7 @@ var RenderWatcherEffect = class extends WatcherEffect {
|
|
|
845
865
|
this.flags |= 128;
|
|
846
866
|
job.flags |= 2;
|
|
847
867
|
}
|
|
848
|
-
|
|
868
|
+
job.i = instance;
|
|
849
869
|
this.job = job;
|
|
850
870
|
}
|
|
851
871
|
notify() {
|
|
@@ -1056,7 +1076,11 @@ const TeleportImpl = {
|
|
|
1056
1076
|
hydrate: hydrateTeleport
|
|
1057
1077
|
};
|
|
1058
1078
|
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
|
|
1059
|
-
if (moveType === 0)
|
|
1079
|
+
if (moveType === 0) {
|
|
1080
|
+
if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
|
|
1081
|
+
insert(vnode.targetAnchor, container, parentAnchor);
|
|
1082
|
+
parentAnchor = vnode.targetAnchor;
|
|
1083
|
+
}
|
|
1060
1084
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
1061
1085
|
const isReorder = moveType === 2;
|
|
1062
1086
|
if (isReorder) insert(el, container, parentAnchor);
|
|
@@ -1177,6 +1201,10 @@ const BaseTransitionPropsValidators = {
|
|
|
1177
1201
|
};
|
|
1178
1202
|
function isEmptyTransitionChild(vnode, instance) {
|
|
1179
1203
|
if (vnode.type === Comment) return true;
|
|
1204
|
+
if (vnode.type === Fragment) {
|
|
1205
|
+
const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1206
|
+
return !child || isEmptyTransitionChild(child, instance);
|
|
1207
|
+
}
|
|
1180
1208
|
if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
1181
1209
|
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
1182
1210
|
}
|
|
@@ -1238,7 +1266,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1238
1266
|
},
|
|
1239
1267
|
earlyRemove: () => {
|
|
1240
1268
|
const leavingVNode = leavingVNodesCache[key];
|
|
1241
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)
|
|
1269
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
|
|
1270
|
+
let leavingCb = leavingVNode.el[leaveCbKey];
|
|
1271
|
+
if (!leavingCb) {
|
|
1272
|
+
const leavingRoot = getTransitionRoot(leavingVNode);
|
|
1273
|
+
leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
|
|
1274
|
+
}
|
|
1275
|
+
if (leavingCb) leavingCb();
|
|
1276
|
+
}
|
|
1242
1277
|
},
|
|
1243
1278
|
cloneHooks: (vnode) => {
|
|
1244
1279
|
const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
|
|
@@ -1384,14 +1419,21 @@ function forwardDelayedLeave(hooks, source) {
|
|
|
1384
1419
|
}
|
|
1385
1420
|
/**
|
|
1386
1421
|
* Prepares an outgoing VNode when the incoming branch belongs to another
|
|
1387
|
-
* renderer. Returns true
|
|
1422
|
+
* renderer. Returns true under out-in, where that branch is a comment
|
|
1423
|
+
* child's: no mode holds for it, the leave runs on its own and
|
|
1424
|
+
* `resumeAfterLeave` follows it.
|
|
1388
1425
|
*
|
|
1389
1426
|
* @internal
|
|
1390
1427
|
*/
|
|
1391
1428
|
function prepareTransitionLeave(previous, enterHooks, props, state, instance, resumeAfterLeave) {
|
|
1392
1429
|
const previousInner = getInnerChild$1(previous);
|
|
1393
1430
|
if (!previousInner || isEmptyTransitionChild(previousInner, instance)) return false;
|
|
1394
|
-
|
|
1431
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
1432
|
+
if (props.mode === "out-in") {
|
|
1433
|
+
leavingHooks.afterLeave = resumeAfterLeave;
|
|
1434
|
+
return true;
|
|
1435
|
+
}
|
|
1436
|
+
return applyTransitionModeSwitch(previousInner, leavingHooks, enterHooks ? () => enterHooks : void 0, props, state, resumeAfterLeave);
|
|
1395
1437
|
}
|
|
1396
1438
|
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
1397
1439
|
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
@@ -1443,7 +1485,13 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
1443
1485
|
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1444
1486
|
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1445
1487
|
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
1446
|
-
} else
|
|
1488
|
+
} else {
|
|
1489
|
+
vnode.transition = hooks;
|
|
1490
|
+
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
1491
|
+
const child = filterSingleRoot(vnode.children, false);
|
|
1492
|
+
if (child) setTransitionHooks(child, hooks);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1447
1495
|
return hooks;
|
|
1448
1496
|
}
|
|
1449
1497
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
@@ -1466,6 +1514,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1466
1514
|
function checkTransitionMode(mode) {
|
|
1467
1515
|
if (!!(process.env.NODE_ENV !== "production") && mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") warn$1(`invalid <transition> mode: ${mode}`);
|
|
1468
1516
|
}
|
|
1517
|
+
function getTransitionRoot(vnode) {
|
|
1518
|
+
if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
|
|
1519
|
+
if (vnode.type === Fragment) {
|
|
1520
|
+
const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1521
|
+
return child ? getTransitionRoot(child) : void 0;
|
|
1522
|
+
}
|
|
1523
|
+
if (vnode.type !== Comment) return vnode;
|
|
1524
|
+
}
|
|
1469
1525
|
//#endregion
|
|
1470
1526
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1471
1527
|
/*@__NO_SIDE_EFFECTS__*/
|
|
@@ -2124,14 +2180,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
|
2124
2180
|
break;
|
|
2125
2181
|
}
|
|
2126
2182
|
}, opts);
|
|
2127
|
-
|
|
2128
|
-
if (!(el instanceof Element)) return;
|
|
2183
|
+
const observe = (el) => {
|
|
2129
2184
|
if (elementIsVisibleInViewport(el)) {
|
|
2130
2185
|
hydrate();
|
|
2131
2186
|
ob.disconnect();
|
|
2132
2187
|
return false;
|
|
2133
2188
|
}
|
|
2189
|
+
if (getComputedStyle(el).display === "contents") {
|
|
2190
|
+
for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
|
|
2191
|
+
}
|
|
2134
2192
|
ob.observe(el);
|
|
2193
|
+
};
|
|
2194
|
+
forEach((el) => {
|
|
2195
|
+
if (!(el instanceof Element)) return;
|
|
2196
|
+
return observe(el);
|
|
2135
2197
|
});
|
|
2136
2198
|
return () => ob.disconnect();
|
|
2137
2199
|
};
|
|
@@ -2393,7 +2455,10 @@ const KeepAlive = {
|
|
|
2393
2455
|
function pruneCacheEntry(key) {
|
|
2394
2456
|
const cached = cache.get(key);
|
|
2395
2457
|
if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
|
|
2396
|
-
else if (current)
|
|
2458
|
+
else if (current) {
|
|
2459
|
+
resetShapeFlag(current);
|
|
2460
|
+
if (cached) resetShapeFlag(cached);
|
|
2461
|
+
}
|
|
2397
2462
|
cache.delete(key);
|
|
2398
2463
|
keys.delete(key);
|
|
2399
2464
|
}
|
|
@@ -2655,8 +2720,8 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2655
2720
|
ret = new Array(source.length);
|
|
2656
2721
|
for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i]);
|
|
2657
2722
|
} else if (typeof source === "number") {
|
|
2658
|
-
if (
|
|
2659
|
-
warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
2723
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
2724
|
+
if (!!(process.env.NODE_ENV !== "production")) warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
2660
2725
|
ret = [];
|
|
2661
2726
|
} else {
|
|
2662
2727
|
ret = new Array(source);
|
|
@@ -2737,6 +2802,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
2737
2802
|
owner: currentRenderingInstance
|
|
2738
2803
|
}] : void 0
|
|
2739
2804
|
};
|
|
2805
|
+
if (branchKey != null && props.key == null) {
|
|
2806
|
+
ret.vs.props = ret.props;
|
|
2807
|
+
ret.props = extend({}, ret.props, { key: branchKey });
|
|
2808
|
+
ret.key = branchKey;
|
|
2809
|
+
}
|
|
2740
2810
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2741
2811
|
return ret;
|
|
2742
2812
|
}
|
|
@@ -3940,7 +4010,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3940
4010
|
if (nextKeys.length !== Object.keys(prevProps).length) return true;
|
|
3941
4011
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
3942
4012
|
const key = nextKeys[i];
|
|
3943
|
-
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
4013
|
+
if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
3944
4014
|
}
|
|
3945
4015
|
return false;
|
|
3946
4016
|
}
|
|
@@ -4663,7 +4733,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4663
4733
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4664
4734
|
const oldVNode = oldChildren[i];
|
|
4665
4735
|
const newVNode = newChildren[i];
|
|
4666
|
-
const
|
|
4736
|
+
const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
|
|
4737
|
+
const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
|
|
4667
4738
|
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4668
4739
|
}
|
|
4669
4740
|
};
|
|
@@ -4760,6 +4831,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4760
4831
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4761
4832
|
if (!!(process.env.NODE_ENV !== "production")) pushWarningContext(n2);
|
|
4762
4833
|
n2.el = n1.el;
|
|
4834
|
+
n2.placeholder = n1.placeholder;
|
|
4763
4835
|
updateComponentPreRender(instance, n2, optimized);
|
|
4764
4836
|
if (!!(process.env.NODE_ENV !== "production")) popWarningContext();
|
|
4765
4837
|
return;
|
|
@@ -4769,6 +4841,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4769
4841
|
}
|
|
4770
4842
|
} else {
|
|
4771
4843
|
n2.el = n1.el;
|
|
4844
|
+
n2.placeholder = n1.placeholder;
|
|
4772
4845
|
instance.vnode = n2;
|
|
4773
4846
|
}
|
|
4774
4847
|
};
|
|
@@ -5115,12 +5188,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5115
5188
|
};
|
|
5116
5189
|
const remove = (vnode) => {
|
|
5117
5190
|
const { type, el, anchor, transition } = vnode;
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
else remove(child);
|
|
5122
|
-
});
|
|
5123
|
-
else removeFragment(el, anchor);
|
|
5191
|
+
const isFragment = type === Fragment;
|
|
5192
|
+
if (isFragment && !transition) {
|
|
5193
|
+
removeFragment(el, anchor);
|
|
5124
5194
|
return;
|
|
5125
5195
|
}
|
|
5126
5196
|
if (type === Static) {
|
|
@@ -5128,8 +5198,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5128
5198
|
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5129
5199
|
return;
|
|
5130
5200
|
}
|
|
5131
|
-
|
|
5132
|
-
|
|
5201
|
+
const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
|
|
5202
|
+
const performRemove = () => {
|
|
5203
|
+
if (isFragment) {
|
|
5204
|
+
if (hostParentNode(el)) removeFragment(el, anchor);
|
|
5205
|
+
} else hostRemove(el);
|
|
5206
|
+
};
|
|
5207
|
+
if (transition) {
|
|
5208
|
+
let leavingEl = leavingNode && leavingNode.el;
|
|
5209
|
+
let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
|
|
5210
|
+
if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
|
|
5211
|
+
leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
|
|
5212
|
+
isElement = !!leavingEl;
|
|
5213
|
+
}
|
|
5214
|
+
performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
|
|
5215
|
+
} else performRemove();
|
|
5133
5216
|
};
|
|
5134
5217
|
const removeFragment = (cur, end) => {
|
|
5135
5218
|
let next;
|
|
@@ -5172,15 +5255,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5172
5255
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
5173
5256
|
};
|
|
5174
5257
|
const render = (vnode, container, namespace) => {
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
5182
|
-
container._vnode = vnode;
|
|
5183
|
-
flushOnAppMount(instance);
|
|
5258
|
+
flushOnAppMount(() => {
|
|
5259
|
+
if (vnode == null) {
|
|
5260
|
+
if (container._vnode) unmount(container._vnode, null, null, true);
|
|
5261
|
+
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
5262
|
+
container._vnode = vnode;
|
|
5263
|
+
}, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
|
|
5184
5264
|
};
|
|
5185
5265
|
const internals = {
|
|
5186
5266
|
p: patch,
|
|
@@ -5575,13 +5655,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5575
5655
|
registerDep(instance, onResolve) {
|
|
5576
5656
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
5577
5657
|
if (isInPendingSuspense) suspense.deps++;
|
|
5578
|
-
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
5579
5658
|
instance.asyncDep.catch((err) => {
|
|
5580
5659
|
handleError(err, instance, 0);
|
|
5581
5660
|
}).then((asyncSetupResult) => {
|
|
5582
5661
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
5583
5662
|
setCurrentInstance(null, void 0);
|
|
5584
|
-
if (
|
|
5663
|
+
if (!instance.scope.active) {
|
|
5585
5664
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
5586
5665
|
return;
|
|
5587
5666
|
}
|
|
@@ -5894,7 +5973,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5894
5973
|
ctx: vnode.ctx,
|
|
5895
5974
|
ce: vnode.ce,
|
|
5896
5975
|
vi: vnode.vi,
|
|
5897
|
-
vs: cloneVaporSlotMeta(vnode),
|
|
5976
|
+
vs: cloneVaporSlotMeta(vnode, extraProps),
|
|
5898
5977
|
vb: vnode.vb,
|
|
5899
5978
|
ibu: vnode.ibu,
|
|
5900
5979
|
iu: vnode.iu,
|
|
@@ -5903,13 +5982,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5903
5982
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5904
5983
|
return cloned;
|
|
5905
5984
|
}
|
|
5906
|
-
function cloneVaporSlotMeta(vnode) {
|
|
5985
|
+
function cloneVaporSlotMeta(vnode, extraProps) {
|
|
5907
5986
|
const vaporSlot = vnode.vs;
|
|
5908
5987
|
if (!vaporSlot) return vaporSlot;
|
|
5909
5988
|
const cloned = {
|
|
5910
5989
|
slot: vaporSlot.slot,
|
|
5911
|
-
outlets: vaporSlot.outlets
|
|
5990
|
+
outlets: vaporSlot.outlets,
|
|
5991
|
+
props: vaporSlot.props
|
|
5912
5992
|
};
|
|
5993
|
+
if (vaporSlot.props && extraProps) {
|
|
5994
|
+
let extraSlotProps;
|
|
5995
|
+
for (const key in extraProps) if (key !== "key") {
|
|
5996
|
+
if (!extraSlotProps) extraSlotProps = {};
|
|
5997
|
+
extraSlotProps[key] = extraProps[key];
|
|
5998
|
+
}
|
|
5999
|
+
if (extraSlotProps) cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
|
|
6000
|
+
}
|
|
5913
6001
|
if (vnode.el) {
|
|
5914
6002
|
cloned.state = vaporSlot.state;
|
|
5915
6003
|
cloned.ref = vaporSlot.ref;
|
|
@@ -6101,6 +6189,9 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
6101
6189
|
//#region packages/runtime-core/src/component.ts
|
|
6102
6190
|
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
6103
6191
|
let uid = 0;
|
|
6192
|
+
function getNextUid() {
|
|
6193
|
+
return uid;
|
|
6194
|
+
}
|
|
6104
6195
|
/**
|
|
6105
6196
|
* @internal for vapor
|
|
6106
6197
|
*/
|
|
@@ -6626,7 +6717,7 @@ function isMemoSame(cached, memo) {
|
|
|
6626
6717
|
}
|
|
6627
6718
|
//#endregion
|
|
6628
6719
|
//#region packages/runtime-core/src/index.ts
|
|
6629
|
-
const version = "3.6.0-rc.
|
|
6720
|
+
const version = "3.6.0-rc.12";
|
|
6630
6721
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
6631
6722
|
/**
|
|
6632
6723
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -6664,4 +6755,4 @@ const resolveFilter = null;
|
|
|
6664
6755
|
const compatUtils = null;
|
|
6665
6756
|
const DeprecationTypes = null;
|
|
6666
6757
|
//#endregion
|
|
6667
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, VaporSlot, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defaultPropGetter, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, expose, filterModelListeners, filterSingleRoot, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, invokeSlotFallback, invokeVNodeHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isUnchangedResourceProp, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveCssVars, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
|
6758
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, VaporSlot, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defaultPropGetter, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, expose, filterModelListeners, filterSingleRoot, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getNextUid, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, invokeSlotFallback, invokeVNodeHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isUnchangedResourceProp, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveCssVars, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.6.0-rc.
|
|
3
|
+
"version": "3.6.0-rc.12",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@vue/shared": "3.6.0-rc.
|
|
50
|
-
"@vue/reactivity": "3.6.0-rc.
|
|
49
|
+
"@vue/shared": "3.6.0-rc.12",
|
|
50
|
+
"@vue/reactivity": "3.6.0-rc.12"
|
|
51
51
|
}
|
|
52
52
|
}
|