@vue/runtime-core 3.5.42 → 3.5.44
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 +172 -75
- package/dist/runtime-core.cjs.prod.js +170 -65
- package/dist/runtime-core.d.ts +6 -7
- package/dist/runtime-core.esm-bundler.js +173 -76
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.44
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -205,15 +205,15 @@ function queuePostFlushCb(cb) {
|
|
|
205
205
|
}
|
|
206
206
|
queueFlush();
|
|
207
207
|
}
|
|
208
|
-
function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
|
|
208
|
+
function flushPreFlushCbs(instance, minUid, seen, i = flushIndex + 1) {
|
|
209
209
|
for (; i < queue.length; i++) {
|
|
210
210
|
const cb = queue[i];
|
|
211
211
|
if (cb && cb.flags & 2) {
|
|
212
|
-
if (instance && cb.id !== instance.uid) {
|
|
212
|
+
if (instance && cb.id !== instance.uid || minUid !== void 0 && !(cb.id >= minUid)) {
|
|
213
213
|
continue;
|
|
214
214
|
}
|
|
215
215
|
queue.splice(i, 1);
|
|
216
|
-
i
|
|
216
|
+
i = instance ? i - 1 : flushIndex;
|
|
217
217
|
if (cb.flags & 4) {
|
|
218
218
|
cb.flags &= -2;
|
|
219
219
|
}
|
|
@@ -224,12 +224,23 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
function flushPostFlushCbs(seen) {
|
|
227
|
+
function flushPostFlushCbs(seen, skip, minUid = 0) {
|
|
228
228
|
if (pendingPostFlushCbs.length) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
)
|
|
232
|
-
|
|
229
|
+
let cbs = pendingPostFlushCbs;
|
|
230
|
+
let kept = 0;
|
|
231
|
+
if (skip) {
|
|
232
|
+
cbs = [];
|
|
233
|
+
for (let i = 0; i < pendingPostFlushCbs.length; i++) {
|
|
234
|
+
const cb = pendingPostFlushCbs[i];
|
|
235
|
+
if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) {
|
|
236
|
+
pendingPostFlushCbs[kept++] = cb;
|
|
237
|
+
} else {
|
|
238
|
+
cbs.push(cb);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
const deduped = [...new Set(cbs)].sort((a, b) => getId(a) - getId(b));
|
|
243
|
+
pendingPostFlushCbs.length = kept;
|
|
233
244
|
if (activePostFlushCbs) {
|
|
234
245
|
for (let i = 0; i < deduped.length; i++) {
|
|
235
246
|
activePostFlushCbs.push(deduped[i]);
|
|
@@ -249,6 +260,22 @@ function flushPostFlushCbs(seen) {
|
|
|
249
260
|
postFlushIndex = 0;
|
|
250
261
|
}
|
|
251
262
|
}
|
|
263
|
+
let isFlushing = false;
|
|
264
|
+
function flushOnAppMount(fn, minUid) {
|
|
265
|
+
if (isFlushing) {
|
|
266
|
+
fn();
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
const queued = minUid === void 0 ? void 0 : new Set(pendingPostFlushCbs);
|
|
270
|
+
fn();
|
|
271
|
+
isFlushing = true;
|
|
272
|
+
try {
|
|
273
|
+
flushPreFlushCbs(void 0, minUid);
|
|
274
|
+
flushPostFlushCbs(void 0, queued, minUid);
|
|
275
|
+
} finally {
|
|
276
|
+
isFlushing = false;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
252
279
|
const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
|
|
253
280
|
function flushJobs(seen) {
|
|
254
281
|
try {
|
|
@@ -458,6 +485,7 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
|
458
485
|
let isPre = false;
|
|
459
486
|
if (flush === "post") {
|
|
460
487
|
baseWatchOptions.scheduler = (job) => {
|
|
488
|
+
job.i = instance;
|
|
461
489
|
queuePostRenderEffect(job, instance && instance.suspense);
|
|
462
490
|
};
|
|
463
491
|
} else if (flush !== "sync") {
|
|
@@ -736,7 +764,11 @@ const TeleportImpl = {
|
|
|
736
764
|
};
|
|
737
765
|
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
|
|
738
766
|
if (moveType === 0) {
|
|
767
|
+
if (vnode.targetStart) {
|
|
768
|
+
insert(vnode.targetStart, container, parentAnchor);
|
|
769
|
+
}
|
|
739
770
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
771
|
+
parentAnchor = vnode.targetAnchor;
|
|
740
772
|
}
|
|
741
773
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
742
774
|
const isReorder = moveType === 2;
|
|
@@ -905,10 +937,6 @@ const BaseTransitionPropsValidators = {
|
|
|
905
937
|
onAfterAppear: TransitionHookValidator,
|
|
906
938
|
onAppearCancelled: TransitionHookValidator
|
|
907
939
|
};
|
|
908
|
-
const recursiveGetSubtree = (instance) => {
|
|
909
|
-
const subTree = instance.subTree;
|
|
910
|
-
return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
|
|
911
|
-
};
|
|
912
940
|
const BaseTransitionImpl = {
|
|
913
941
|
name: `BaseTransition`,
|
|
914
942
|
props: BaseTransitionPropsValidators,
|
|
@@ -946,7 +974,7 @@ const BaseTransitionImpl = {
|
|
|
946
974
|
setTransitionHooks(innerChild, enterHooks);
|
|
947
975
|
}
|
|
948
976
|
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
949
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) &&
|
|
977
|
+
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && getTransitionRoot(instance.subTree)) {
|
|
950
978
|
let leavingHooks = resolveTransitionHooks(
|
|
951
979
|
oldInnerChild,
|
|
952
980
|
rawProps,
|
|
@@ -1072,8 +1100,15 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1072
1100
|
);
|
|
1073
1101
|
}
|
|
1074
1102
|
const leavingVNode = leavingVNodesCache[key];
|
|
1075
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)
|
|
1076
|
-
leavingVNode.el[leaveCbKey]
|
|
1103
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
|
|
1104
|
+
let leavingCb = leavingVNode.el[leaveCbKey];
|
|
1105
|
+
if (!leavingCb) {
|
|
1106
|
+
const leavingRoot = getTransitionRoot(leavingVNode);
|
|
1107
|
+
leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
|
|
1108
|
+
}
|
|
1109
|
+
if (leavingCb) {
|
|
1110
|
+
leavingCb();
|
|
1111
|
+
}
|
|
1077
1112
|
}
|
|
1078
1113
|
callHook(hook, [el]);
|
|
1079
1114
|
},
|
|
@@ -1201,6 +1236,12 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
1201
1236
|
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1202
1237
|
} else {
|
|
1203
1238
|
vnode.transition = hooks;
|
|
1239
|
+
if (vnode.type === Fragment && shared.isArray(vnode.children)) {
|
|
1240
|
+
const child = filterSingleRoot(vnode.children, false);
|
|
1241
|
+
if (child) {
|
|
1242
|
+
setTransitionHooks(child, hooks);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1204
1245
|
}
|
|
1205
1246
|
}
|
|
1206
1247
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
@@ -1225,6 +1266,18 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1225
1266
|
}
|
|
1226
1267
|
return ret;
|
|
1227
1268
|
}
|
|
1269
|
+
function getTransitionRoot(vnode) {
|
|
1270
|
+
if (vnode.component) {
|
|
1271
|
+
return getTransitionRoot(vnode.component.subTree);
|
|
1272
|
+
}
|
|
1273
|
+
if (vnode.type === Fragment) {
|
|
1274
|
+
const child = shared.isArray(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1275
|
+
return child ? getTransitionRoot(child) : void 0;
|
|
1276
|
+
}
|
|
1277
|
+
if (vnode.type !== Comment) {
|
|
1278
|
+
return vnode;
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1228
1281
|
|
|
1229
1282
|
// @__NO_SIDE_EFFECTS__
|
|
1230
1283
|
function defineComponent(options, extraOptions) {
|
|
@@ -1545,13 +1598,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1545
1598
|
getContainerType(container),
|
|
1546
1599
|
optimized
|
|
1547
1600
|
);
|
|
1548
|
-
if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
|
|
1601
|
+
if ((isAsyncWrapper(vnode) || vnode.component.asyncDep) && !vnode.component.subTree) {
|
|
1549
1602
|
let subTree;
|
|
1550
1603
|
if (isFragmentStart) {
|
|
1551
1604
|
subTree = createVNode(Static);
|
|
1552
1605
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1553
1606
|
} else {
|
|
1554
|
-
subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(
|
|
1607
|
+
subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(
|
|
1608
|
+
node.nodeType === 8 ? Comment : "div"
|
|
1609
|
+
);
|
|
1555
1610
|
}
|
|
1556
1611
|
subTree.el = node;
|
|
1557
1612
|
vnode.component.subTree = subTree;
|
|
@@ -1917,14 +1972,22 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
|
1917
1972
|
break;
|
|
1918
1973
|
}
|
|
1919
1974
|
}, opts);
|
|
1920
|
-
|
|
1921
|
-
if (!(el instanceof Element)) return;
|
|
1975
|
+
const observe = (el) => {
|
|
1922
1976
|
if (elementIsVisibleInViewport(el)) {
|
|
1923
1977
|
hydrate();
|
|
1924
1978
|
ob.disconnect();
|
|
1925
1979
|
return false;
|
|
1926
1980
|
}
|
|
1981
|
+
if (getComputedStyle(el).display === "contents") {
|
|
1982
|
+
for (let i = 0; i < el.children.length; i++) {
|
|
1983
|
+
if (observe(el.children[i]) === false) return false;
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1927
1986
|
ob.observe(el);
|
|
1987
|
+
};
|
|
1988
|
+
forEach((el) => {
|
|
1989
|
+
if (!(el instanceof Element)) return;
|
|
1990
|
+
return observe(el);
|
|
1928
1991
|
});
|
|
1929
1992
|
return () => ob.disconnect();
|
|
1930
1993
|
};
|
|
@@ -2256,6 +2319,7 @@ const KeepAliveImpl = {
|
|
|
2256
2319
|
unmount(cached);
|
|
2257
2320
|
} else if (current) {
|
|
2258
2321
|
resetShapeFlag(current);
|
|
2322
|
+
if (cached) resetShapeFlag(cached);
|
|
2259
2323
|
}
|
|
2260
2324
|
cache.delete(key);
|
|
2261
2325
|
keys.delete(key);
|
|
@@ -2529,7 +2593,9 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2529
2593
|
);
|
|
2530
2594
|
}
|
|
2531
2595
|
} else if (typeof source === "number") {
|
|
2532
|
-
{
|
|
2596
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
2597
|
+
ret = [];
|
|
2598
|
+
} else {
|
|
2533
2599
|
ret = new Array(source);
|
|
2534
2600
|
for (let i = 0; i < source; i++) {
|
|
2535
2601
|
ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
@@ -3709,7 +3775,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3709
3775
|
}
|
|
3710
3776
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
3711
3777
|
const key = nextKeys[i];
|
|
3712
|
-
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
|
|
3778
|
+
if (!shared.hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
|
|
3713
3779
|
return true;
|
|
3714
3780
|
}
|
|
3715
3781
|
}
|
|
@@ -4138,6 +4204,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4138
4204
|
optimized = false;
|
|
4139
4205
|
n2.dynamicChildren = null;
|
|
4140
4206
|
}
|
|
4207
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
4208
|
+
if (n2.dynamicChildren === shared.EMPTY_ARR) {
|
|
4209
|
+
n2.dynamicChildren = [];
|
|
4210
|
+
}
|
|
4211
|
+
n2.dynamicChildren.hasOnce = true;
|
|
4212
|
+
}
|
|
4141
4213
|
const { type, ref, shapeFlag } = n2;
|
|
4142
4214
|
switch (type) {
|
|
4143
4215
|
case Text:
|
|
@@ -4507,15 +4579,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4507
4579
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4508
4580
|
const oldVNode = oldChildren[i];
|
|
4509
4581
|
const newVNode = newChildren[i];
|
|
4582
|
+
const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
|
|
4510
4583
|
const container = (
|
|
4511
4584
|
// oldVNode may be an errored async setup() component inside Suspense
|
|
4512
4585
|
// which will not have a mounted element
|
|
4513
|
-
|
|
4586
|
+
oldEl && // - In the case of a Fragment, we need to provide the actual parent
|
|
4514
4587
|
// of the Fragment itself so it can move its children.
|
|
4515
4588
|
(oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
|
|
4516
4589
|
// which also requires the correct parent container
|
|
4517
4590
|
!isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
|
|
4518
|
-
oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(
|
|
4591
|
+
oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldEl) : (
|
|
4519
4592
|
// In other cases, the parent container is not actually used so we
|
|
4520
4593
|
// just pass the block element here to avoid a DOM parentNode call.
|
|
4521
4594
|
fallbackContainer
|
|
@@ -4668,7 +4741,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4668
4741
|
setupComponent(instance, false, optimized);
|
|
4669
4742
|
}
|
|
4670
4743
|
if (instance.asyncDep) {
|
|
4671
|
-
parentSuspense && parentSuspense.registerDep(
|
|
4744
|
+
parentSuspense && parentSuspense.registerDep(
|
|
4745
|
+
instance,
|
|
4746
|
+
setupRenderEffect,
|
|
4747
|
+
optimized,
|
|
4748
|
+
namespace
|
|
4749
|
+
);
|
|
4672
4750
|
if (!initialVNode.el) {
|
|
4673
4751
|
const placeholder = instance.subTree = createVNode(Comment);
|
|
4674
4752
|
processCommentNode(null, placeholder, container, anchor);
|
|
@@ -4690,6 +4768,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4690
4768
|
const instance = n2.component = n1.component;
|
|
4691
4769
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
4692
4770
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4771
|
+
n2.el = n1.el;
|
|
4772
|
+
n2.placeholder = n1.placeholder;
|
|
4693
4773
|
updateComponentPreRender(instance, n2, optimized);
|
|
4694
4774
|
return;
|
|
4695
4775
|
} else {
|
|
@@ -4698,6 +4778,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4698
4778
|
}
|
|
4699
4779
|
} else {
|
|
4700
4780
|
n2.el = n1.el;
|
|
4781
|
+
n2.placeholder = n1.placeholder;
|
|
4701
4782
|
instance.vnode = n2;
|
|
4702
4783
|
}
|
|
4703
4784
|
};
|
|
@@ -5219,7 +5300,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5219
5300
|
cacheIndex,
|
|
5220
5301
|
memo
|
|
5221
5302
|
} = vnode;
|
|
5222
|
-
if (patchFlag === -2) {
|
|
5303
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) {
|
|
5223
5304
|
optimized = false;
|
|
5224
5305
|
}
|
|
5225
5306
|
if (ref != null) {
|
|
@@ -5227,7 +5308,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5227
5308
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
5228
5309
|
reactivity.resetTracking();
|
|
5229
5310
|
}
|
|
5230
|
-
if (cacheIndex != null) {
|
|
5311
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
|
|
5231
5312
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
5232
5313
|
}
|
|
5233
5314
|
if (shapeFlag & 256) {
|
|
@@ -5292,27 +5373,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5292
5373
|
};
|
|
5293
5374
|
const remove = (vnode) => {
|
|
5294
5375
|
const { type, el, anchor, transition } = vnode;
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
}
|
|
5376
|
+
const isFragment = type === Fragment;
|
|
5377
|
+
if (isFragment && !transition) {
|
|
5378
|
+
removeFragment(el, anchor);
|
|
5299
5379
|
return;
|
|
5300
5380
|
}
|
|
5301
5381
|
if (type === Static) {
|
|
5302
5382
|
removeStaticNode(vnode);
|
|
5383
|
+
if (transition && !transition.persisted && transition.afterLeave) {
|
|
5384
|
+
transition.afterLeave();
|
|
5385
|
+
}
|
|
5303
5386
|
return;
|
|
5304
5387
|
}
|
|
5388
|
+
const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
|
|
5305
5389
|
const performRemove = () => {
|
|
5306
|
-
|
|
5390
|
+
if (isFragment) {
|
|
5391
|
+
if (hostParentNode(el)) {
|
|
5392
|
+
removeFragment(el, anchor);
|
|
5393
|
+
}
|
|
5394
|
+
} else {
|
|
5395
|
+
hostRemove(el);
|
|
5396
|
+
}
|
|
5307
5397
|
if (transition && !transition.persisted && transition.afterLeave) {
|
|
5308
5398
|
transition.afterLeave();
|
|
5309
5399
|
}
|
|
5310
5400
|
};
|
|
5311
|
-
if (
|
|
5401
|
+
if (leavingNode && leavingNode.shapeFlag & 1 && transition && !transition.persisted) {
|
|
5312
5402
|
const { leave, delayLeave } = transition;
|
|
5313
|
-
const
|
|
5403
|
+
const leavingEl = leavingNode.el;
|
|
5404
|
+
const performLeave = () => leave(leavingEl, performRemove);
|
|
5314
5405
|
if (delayLeave) {
|
|
5315
|
-
delayLeave(
|
|
5406
|
+
delayLeave(leavingEl, performRemove, performLeave);
|
|
5316
5407
|
} else {
|
|
5317
5408
|
performLeave();
|
|
5318
5409
|
}
|
|
@@ -5340,6 +5431,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5340
5431
|
if (job) {
|
|
5341
5432
|
job.flags |= 8;
|
|
5342
5433
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5434
|
+
} else if (instance.vnode.el && subTree) {
|
|
5435
|
+
subTree.transition = instance.vnode.transition;
|
|
5436
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5343
5437
|
}
|
|
5344
5438
|
if (um) {
|
|
5345
5439
|
queuePostRenderEffect(um, parentSuspense);
|
|
@@ -5364,32 +5458,26 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5364
5458
|
const teleportEnd = el && el[TeleportEndKey];
|
|
5365
5459
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
5366
5460
|
};
|
|
5367
|
-
let isFlushing = false;
|
|
5368
5461
|
const render = (vnode, container, namespace) => {
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
if (
|
|
5372
|
-
|
|
5373
|
-
|
|
5462
|
+
const minUid = vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid();
|
|
5463
|
+
flushOnAppMount(() => {
|
|
5464
|
+
if (vnode == null) {
|
|
5465
|
+
if (container._vnode) {
|
|
5466
|
+
unmount(container._vnode, null, null, true);
|
|
5467
|
+
}
|
|
5468
|
+
} else {
|
|
5469
|
+
patch(
|
|
5470
|
+
container._vnode || null,
|
|
5471
|
+
vnode,
|
|
5472
|
+
container,
|
|
5473
|
+
null,
|
|
5474
|
+
null,
|
|
5475
|
+
null,
|
|
5476
|
+
namespace
|
|
5477
|
+
);
|
|
5374
5478
|
}
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
container._vnode || null,
|
|
5378
|
-
vnode,
|
|
5379
|
-
container,
|
|
5380
|
-
null,
|
|
5381
|
-
null,
|
|
5382
|
-
null,
|
|
5383
|
-
namespace
|
|
5384
|
-
);
|
|
5385
|
-
}
|
|
5386
|
-
container._vnode = vnode;
|
|
5387
|
-
if (!isFlushing) {
|
|
5388
|
-
isFlushing = true;
|
|
5389
|
-
flushPreFlushCbs(instance);
|
|
5390
|
-
flushPostFlushCbs();
|
|
5391
|
-
isFlushing = false;
|
|
5392
|
-
}
|
|
5479
|
+
container._vnode = vnode;
|
|
5480
|
+
}, minUid);
|
|
5393
5481
|
};
|
|
5394
5482
|
const internals = {
|
|
5395
5483
|
p: patch,
|
|
@@ -5548,7 +5636,7 @@ const SuspenseImpl = {
|
|
|
5548
5636
|
rendererInternals
|
|
5549
5637
|
);
|
|
5550
5638
|
} else {
|
|
5551
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
5639
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
5552
5640
|
n2.suspense = n1.suspense;
|
|
5553
5641
|
n2.suspense.vnode = n2;
|
|
5554
5642
|
n2.el = n1.el;
|
|
@@ -5634,10 +5722,12 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5634
5722
|
if (pendingBranch) {
|
|
5635
5723
|
suspense.pendingBranch = newBranch;
|
|
5636
5724
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
5725
|
+
suspense.deps++;
|
|
5637
5726
|
patch(
|
|
5638
5727
|
pendingBranch,
|
|
5639
5728
|
newBranch,
|
|
5640
|
-
|
|
5729
|
+
// a hydrating pending branch is adopted SSR DOM, already in place
|
|
5730
|
+
isHydrating ? container : suspense.hiddenContainer,
|
|
5641
5731
|
null,
|
|
5642
5732
|
parentComponent,
|
|
5643
5733
|
suspense,
|
|
@@ -5645,6 +5735,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5645
5735
|
slotScopeIds,
|
|
5646
5736
|
optimized
|
|
5647
5737
|
);
|
|
5738
|
+
suspense.deps--;
|
|
5648
5739
|
if (suspense.deps <= 0) {
|
|
5649
5740
|
suspense.resolve();
|
|
5650
5741
|
} else if (isInFallback) {
|
|
@@ -5888,6 +5979,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5888
5979
|
suspense.effects = [];
|
|
5889
5980
|
if (isSuspensible) {
|
|
5890
5981
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
5982
|
+
parentSuspenseId = void 0;
|
|
5891
5983
|
parentSuspense.deps--;
|
|
5892
5984
|
if (parentSuspense.deps === 0 && !sync) {
|
|
5893
5985
|
parentSuspense.resolve();
|
|
@@ -5948,7 +6040,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5948
6040
|
next() {
|
|
5949
6041
|
return suspense.activeBranch && next(suspense.activeBranch);
|
|
5950
6042
|
},
|
|
5951
|
-
|
|
6043
|
+
// `namespace` intentionally shadows the boundary's own: the dep must be
|
|
6044
|
+
// mounted with the namespace of the position it was rendered at, which can
|
|
6045
|
+
// differ from the boundary's (e.g. a component nested inside an <svg>).
|
|
6046
|
+
registerDep(instance, setupRenderEffect, optimized2, namespace2) {
|
|
5952
6047
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
5953
6048
|
if (isInPendingSuspense) {
|
|
5954
6049
|
suspense.deps++;
|
|
@@ -5961,6 +6056,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5961
6056
|
return;
|
|
5962
6057
|
}
|
|
5963
6058
|
unsetCurrentInstance();
|
|
6059
|
+
if (!instance.scope.active) {
|
|
6060
|
+
if (isInPendingSuspense && --suspense.deps === 0) {
|
|
6061
|
+
suspense.resolve();
|
|
6062
|
+
}
|
|
6063
|
+
return;
|
|
6064
|
+
}
|
|
5964
6065
|
instance.asyncResolved = true;
|
|
5965
6066
|
const { vnode: vnode2 } = instance;
|
|
5966
6067
|
handleSetupResult(instance, asyncSetupResult, false);
|
|
@@ -5979,7 +6080,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5979
6080
|
// consider the comment placeholder case.
|
|
5980
6081
|
hydratedEl ? null : next(instance.subTree),
|
|
5981
6082
|
suspense,
|
|
5982
|
-
|
|
6083
|
+
namespace2,
|
|
5983
6084
|
optimized2
|
|
5984
6085
|
);
|
|
5985
6086
|
if (placeholder) {
|
|
@@ -6330,7 +6431,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
6330
6431
|
el: vnode.el,
|
|
6331
6432
|
anchor: vnode.anchor,
|
|
6332
6433
|
ctx: vnode.ctx,
|
|
6333
|
-
ce: vnode.ce
|
|
6434
|
+
ce: vnode.ce,
|
|
6435
|
+
cacheIndex: vnode.cacheIndex
|
|
6334
6436
|
};
|
|
6335
6437
|
if (transition && cloneTransition) {
|
|
6336
6438
|
setTransitionHooks(
|
|
@@ -6456,6 +6558,9 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
6456
6558
|
|
|
6457
6559
|
const emptyAppContext = createAppContext();
|
|
6458
6560
|
let uid = 0;
|
|
6561
|
+
function getNextUid() {
|
|
6562
|
+
return uid;
|
|
6563
|
+
}
|
|
6459
6564
|
function createComponentInstance(vnode, parent, suspense) {
|
|
6460
6565
|
const type = vnode.type;
|
|
6461
6566
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
@@ -6810,7 +6915,7 @@ function isMemoSame(cached, memo) {
|
|
|
6810
6915
|
return true;
|
|
6811
6916
|
}
|
|
6812
6917
|
|
|
6813
|
-
const version = "3.5.
|
|
6918
|
+
const version = "3.5.44";
|
|
6814
6919
|
const warn$1 = shared.NOOP;
|
|
6815
6920
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6816
6921
|
const devtools = void 0;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -54,8 +54,9 @@ interface SchedulerJob extends Function {
|
|
|
54
54
|
/**
|
|
55
55
|
* Attached by renderer.ts when setting up a component's render effect
|
|
56
56
|
* Used to obtain component information when reporting max recursive updates.
|
|
57
|
+
* Also set on watcher jobs: null marks a watcher without an owner component.
|
|
57
58
|
*/
|
|
58
|
-
i?: ComponentInternalInstance;
|
|
59
|
+
i?: ComponentInternalInstance | null;
|
|
59
60
|
}
|
|
60
61
|
type SchedulerJobs = SchedulerJob | SchedulerJob[];
|
|
61
62
|
export declare function nextTick(): Promise<void>;
|
|
@@ -80,13 +81,11 @@ type PropConstructor<T = any> = {
|
|
|
80
81
|
} | {
|
|
81
82
|
(): T;
|
|
82
83
|
} | PropMethod<T>;
|
|
83
|
-
type PropMethod<T, TConstructor = any> =
|
|
84
|
-
((...args: any) => any) | undefined
|
|
85
|
-
] ? {
|
|
84
|
+
type PropMethod<T, TConstructor = any> = {
|
|
86
85
|
new (): TConstructor;
|
|
87
86
|
(): T;
|
|
88
87
|
readonly prototype: TConstructor;
|
|
89
|
-
}
|
|
88
|
+
};
|
|
90
89
|
type RequiredKeys<T> = {
|
|
91
90
|
[K in keyof T]: T[K] extends {
|
|
92
91
|
required: true;
|
|
@@ -119,7 +118,7 @@ type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends
|
|
|
119
118
|
type: DateConstructor;
|
|
120
119
|
}] ? Date : [T] extends [(infer U)[] | {
|
|
121
120
|
type: (infer U)[];
|
|
122
|
-
}] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, D> : V : V : T;
|
|
121
|
+
}] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, unknown extends D ? V : D> : V : V : T;
|
|
123
122
|
/**
|
|
124
123
|
* Extract prop types from a runtime props options object.
|
|
125
124
|
* The extracted types are **internal** - i.e. the resolved props received by
|
|
@@ -592,7 +591,7 @@ export interface SuspenseBoundary {
|
|
|
592
591
|
fallback(fallbackVNode: VNode): void;
|
|
593
592
|
move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
|
|
594
593
|
next(): RendererNode | null;
|
|
595
|
-
registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn, optimized: boolean): void;
|
|
594
|
+
registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn, optimized: boolean, namespace: ElementNamespace): void;
|
|
596
595
|
unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
|
|
597
596
|
}
|
|
598
597
|
declare function hydrateSuspense(node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals, hydrateNode: (node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
|