@vue/runtime-core 3.5.44 → 3.5.45
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 +287 -96
- package/dist/runtime-core.cjs.prod.js +265 -92
- package/dist/runtime-core.d.ts +14 -3
- package/dist/runtime-core.esm-bundler.js +289 -98
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.45
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -93,7 +93,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
93
93
|
const res = callWithErrorHandling(fn, instance, type, args);
|
|
94
94
|
if (res && shared.isPromise(res)) {
|
|
95
95
|
res.catch((err) => {
|
|
96
|
-
handleError(err, instance, type);
|
|
96
|
+
handleError(err, instance, type, void 0, true);
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
return res;
|
|
@@ -106,7 +106,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
106
106
|
return values;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
function handleError(err, instance, type, throwInDev = true) {
|
|
109
|
+
function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
|
|
110
110
|
const contextVNode = instance ? instance.vnode : null;
|
|
111
111
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ;
|
|
112
112
|
if (instance) {
|
|
@@ -115,7 +115,9 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
115
115
|
const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
|
|
116
116
|
while (cur) {
|
|
117
117
|
const errorCapturedHooks = cur.ec;
|
|
118
|
-
if (errorCapturedHooks
|
|
118
|
+
if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
|
|
119
|
+
// are deferred or discarded by Suspense.
|
|
120
|
+
(!isAsyncError || cur.scope.active)) {
|
|
119
121
|
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
120
122
|
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
121
123
|
return;
|
|
@@ -388,12 +390,31 @@ function withDirectives(vnode, directives) {
|
|
|
388
390
|
return vnode;
|
|
389
391
|
}
|
|
390
392
|
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
391
|
-
|
|
393
|
+
let hookVNode = vnode;
|
|
394
|
+
if (name === "beforeMount") {
|
|
395
|
+
vnode._mount = vnode;
|
|
396
|
+
} else if (name === "beforeUpdate") {
|
|
397
|
+
const mount = prevVNode && prevVNode._mount;
|
|
398
|
+
if (mount) {
|
|
399
|
+
mount._latest = vnode;
|
|
400
|
+
vnode._mount = mount;
|
|
401
|
+
}
|
|
402
|
+
} else if (name === "mounted") {
|
|
403
|
+
const latest = vnode._latest;
|
|
404
|
+
vnode._mount = vnode._latest = void 0;
|
|
405
|
+
if (latest) {
|
|
406
|
+
hookVNode = latest;
|
|
407
|
+
latest._mount = void 0;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
const bindings = hookVNode.dirs;
|
|
392
411
|
const oldBindings = prevVNode && prevVNode.dirs;
|
|
393
412
|
for (let i = 0; i < bindings.length; i++) {
|
|
394
|
-
|
|
413
|
+
let binding = bindings[i];
|
|
395
414
|
if (oldBindings) {
|
|
396
415
|
binding.oldValue = oldBindings[i].value;
|
|
416
|
+
} else if (name === "mounted" && binding.oldValue !== void 0) {
|
|
417
|
+
binding = shared.extend({}, binding, { oldValue: void 0 });
|
|
397
418
|
}
|
|
398
419
|
let hook = binding.dir[name];
|
|
399
420
|
if (hook) {
|
|
@@ -401,7 +422,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
401
422
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
402
423
|
vnode.el,
|
|
403
424
|
binding,
|
|
404
|
-
|
|
425
|
+
hookVNode,
|
|
405
426
|
prevVNode
|
|
406
427
|
]);
|
|
407
428
|
reactivity.resetTracking();
|
|
@@ -962,13 +983,11 @@ const BaseTransitionImpl = {
|
|
|
962
983
|
if (!innerChild) {
|
|
963
984
|
return emptyPlaceholder(child);
|
|
964
985
|
}
|
|
965
|
-
|
|
986
|
+
const enterHooks = resolveTransitionHooks(
|
|
966
987
|
innerChild,
|
|
967
988
|
rawProps,
|
|
968
989
|
state,
|
|
969
|
-
instance
|
|
970
|
-
// #11061, ensure enterHooks is fresh after clone
|
|
971
|
-
(hooks) => enterHooks = hooks
|
|
990
|
+
instance
|
|
972
991
|
);
|
|
973
992
|
if (innerChild.type !== Comment) {
|
|
974
993
|
setTransitionHooks(innerChild, enterHooks);
|
|
@@ -987,7 +1006,17 @@ const BaseTransitionImpl = {
|
|
|
987
1006
|
leavingHooks.afterLeave = () => {
|
|
988
1007
|
state.isLeaving = false;
|
|
989
1008
|
if (!(instance.job.flags & 8)) {
|
|
990
|
-
instance.
|
|
1009
|
+
if (instance.effect.flags & 2) {
|
|
1010
|
+
const job = () => {
|
|
1011
|
+
if (!(instance.job.flags & 8)) {
|
|
1012
|
+
instance.update();
|
|
1013
|
+
}
|
|
1014
|
+
};
|
|
1015
|
+
job.i = instance;
|
|
1016
|
+
queueJob(job);
|
|
1017
|
+
} else {
|
|
1018
|
+
instance.update();
|
|
1019
|
+
}
|
|
991
1020
|
}
|
|
992
1021
|
delete leavingHooks.afterLeave;
|
|
993
1022
|
oldInnerChild = void 0;
|
|
@@ -1044,7 +1073,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
1044
1073
|
}
|
|
1045
1074
|
return leavingVNodesCache;
|
|
1046
1075
|
}
|
|
1047
|
-
function resolveTransitionHooks(vnode, props, state, instance
|
|
1076
|
+
function resolveTransitionHooks(vnode, props, state, instance) {
|
|
1048
1077
|
const {
|
|
1049
1078
|
appear,
|
|
1050
1079
|
mode,
|
|
@@ -1183,15 +1212,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1183
1212
|
}
|
|
1184
1213
|
},
|
|
1185
1214
|
clone(vnode2) {
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1215
|
+
const cloned = resolveTransitionHooks(vnode2, props, state, instance);
|
|
1216
|
+
cloned.afterLeave = () => {
|
|
1217
|
+
if (hooks.afterLeave) hooks.afterLeave();
|
|
1218
|
+
};
|
|
1219
|
+
cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1220
|
+
if (hooks.delayLeave) {
|
|
1221
|
+
hooks.delayLeave(el, earlyRemove, delayedLeave);
|
|
1222
|
+
} else {
|
|
1223
|
+
delayedLeave();
|
|
1224
|
+
}
|
|
1225
|
+
};
|
|
1226
|
+
cloned.delayedLeave = () => {
|
|
1227
|
+
if (hooks.delayedLeave) hooks.delayedLeave();
|
|
1228
|
+
};
|
|
1229
|
+
return cloned;
|
|
1195
1230
|
}
|
|
1196
1231
|
};
|
|
1197
1232
|
return hooks;
|
|
@@ -1232,8 +1267,16 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
1232
1267
|
hooks
|
|
1233
1268
|
);
|
|
1234
1269
|
} else if (vnode.shapeFlag & 128) {
|
|
1235
|
-
|
|
1236
|
-
|
|
1270
|
+
const suspense = vnode.suspense;
|
|
1271
|
+
if (suspense) {
|
|
1272
|
+
const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
|
|
1273
|
+
if (branch) {
|
|
1274
|
+
setTransitionHooks(branch, hooks.clone(branch));
|
|
1275
|
+
}
|
|
1276
|
+
} else {
|
|
1277
|
+
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1278
|
+
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1279
|
+
}
|
|
1237
1280
|
} else {
|
|
1238
1281
|
vnode.transition = hooks;
|
|
1239
1282
|
if (vnode.type === Fragment && shared.isArray(vnode.children)) {
|
|
@@ -1858,7 +1901,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1858
1901
|
getContainerType(container),
|
|
1859
1902
|
slotScopeIds
|
|
1860
1903
|
);
|
|
1861
|
-
if (parentComponent) {
|
|
1904
|
+
if (parentComponent && parentComponent.vnode.el === node) {
|
|
1862
1905
|
parentComponent.vnode.el = vnode.el;
|
|
1863
1906
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
1864
1907
|
}
|
|
@@ -2144,7 +2187,8 @@ function defineAsyncComponent(source) {
|
|
|
2144
2187
|
err,
|
|
2145
2188
|
instance,
|
|
2146
2189
|
13,
|
|
2147
|
-
!errorComponent
|
|
2190
|
+
!errorComponent,
|
|
2191
|
+
true
|
|
2148
2192
|
);
|
|
2149
2193
|
};
|
|
2150
2194
|
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
@@ -2162,7 +2206,7 @@ function defineAsyncComponent(source) {
|
|
|
2162
2206
|
const delayed = reactivity.ref(!!delay);
|
|
2163
2207
|
let timeoutTimer;
|
|
2164
2208
|
let delayTimer;
|
|
2165
|
-
|
|
2209
|
+
reactivity.onScopeDispose(() => {
|
|
2166
2210
|
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
2167
2211
|
if (delayTimer != null) clearTimeout(delayTimer);
|
|
2168
2212
|
});
|
|
@@ -2284,6 +2328,12 @@ const KeepAliveImpl = {
|
|
|
2284
2328
|
}, parentSuspense);
|
|
2285
2329
|
};
|
|
2286
2330
|
sharedContext.deactivate = (vnode) => {
|
|
2331
|
+
const cached = cache.get(
|
|
2332
|
+
vnode.key == null ? vnode.type : vnode.key
|
|
2333
|
+
);
|
|
2334
|
+
if (!cached || cached.component !== vnode.component) {
|
|
2335
|
+
return false;
|
|
2336
|
+
}
|
|
2287
2337
|
const instance2 = vnode.component;
|
|
2288
2338
|
invalidateMount(instance2.m);
|
|
2289
2339
|
invalidateMount(instance2.a);
|
|
@@ -2298,6 +2348,7 @@ const KeepAliveImpl = {
|
|
|
2298
2348
|
}
|
|
2299
2349
|
instance2.isDeactivated = true;
|
|
2300
2350
|
}, parentSuspense);
|
|
2351
|
+
return true;
|
|
2301
2352
|
};
|
|
2302
2353
|
function unmount(vnode) {
|
|
2303
2354
|
resetShapeFlag(vnode);
|
|
@@ -2337,12 +2388,17 @@ const KeepAliveImpl = {
|
|
|
2337
2388
|
const cacheSubtree = () => {
|
|
2338
2389
|
if (pendingCacheKey != null) {
|
|
2339
2390
|
if (isSuspense(instance.subTree.type)) {
|
|
2340
|
-
|
|
2391
|
+
const cacheInnerChild = () => {
|
|
2341
2392
|
const vnode = getInnerChild(instance.subTree);
|
|
2342
2393
|
if (vnode.component) {
|
|
2343
2394
|
cache.set(pendingCacheKey, vnode);
|
|
2344
2395
|
}
|
|
2345
|
-
}
|
|
2396
|
+
};
|
|
2397
|
+
if (instance.subTree.suspense.pendingBranch) {
|
|
2398
|
+
queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
|
|
2399
|
+
} else {
|
|
2400
|
+
cacheInnerChild();
|
|
2401
|
+
}
|
|
2346
2402
|
} else {
|
|
2347
2403
|
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
2348
2404
|
}
|
|
@@ -2470,9 +2526,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
2470
2526
|
true
|
|
2471
2527
|
/* prepend */
|
|
2472
2528
|
);
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2529
|
+
const removal = injectHook(
|
|
2530
|
+
"um",
|
|
2531
|
+
() => shared.remove(keepAliveRoot[type], injected),
|
|
2532
|
+
target
|
|
2533
|
+
);
|
|
2534
|
+
removal.flags = 16;
|
|
2476
2535
|
}
|
|
2477
2536
|
function resetShapeFlag(vnode) {
|
|
2478
2537
|
vnode.shapeFlag &= -257;
|
|
@@ -4434,6 +4493,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4434
4493
|
const needCallTransitionHooks = needTransition(parentSuspense, transition);
|
|
4435
4494
|
if (needCallTransitionHooks) {
|
|
4436
4495
|
transition.beforeEnter(el);
|
|
4496
|
+
} else if (transition && !transition.persisted) {
|
|
4497
|
+
el[deferredEnterKey] = true;
|
|
4437
4498
|
}
|
|
4438
4499
|
hostInsert(el, container, anchor);
|
|
4439
4500
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
@@ -4854,16 +4915,23 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4854
4915
|
} else {
|
|
4855
4916
|
let { next, bu, u, parent, vnode } = instance;
|
|
4856
4917
|
{
|
|
4857
|
-
const
|
|
4858
|
-
if (
|
|
4918
|
+
const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
|
|
4919
|
+
if (unresolvedAsyncRoot) {
|
|
4859
4920
|
if (next) {
|
|
4860
4921
|
next.el = vnode.el;
|
|
4861
4922
|
updateComponentPreRender(instance, next, optimized);
|
|
4862
4923
|
}
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
if (
|
|
4866
|
-
|
|
4924
|
+
unresolvedAsyncRoot.asyncDep.then(() => {
|
|
4925
|
+
const retry = () => {
|
|
4926
|
+
if (instance.job.flags & 8) return;
|
|
4927
|
+
if (parentSuspense && parentSuspense.pendingBranch) {
|
|
4928
|
+
queuePostRenderEffect(retry, parentSuspense);
|
|
4929
|
+
} else {
|
|
4930
|
+
update();
|
|
4931
|
+
}
|
|
4932
|
+
};
|
|
4933
|
+
retry.flags = 16 | 32;
|
|
4934
|
+
queuePostRenderEffect(retry, parentSuspense);
|
|
4867
4935
|
});
|
|
4868
4936
|
return;
|
|
4869
4937
|
}
|
|
@@ -4890,8 +4958,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4890
4958
|
patch(
|
|
4891
4959
|
prevTree,
|
|
4892
4960
|
nextTree,
|
|
4893
|
-
// parent may have changed if it's in a teleport
|
|
4894
|
-
|
|
4961
|
+
// parent may have changed if it's in a teleport. a root that is a
|
|
4962
|
+
// pending async component only has its placeholder comment
|
|
4963
|
+
hostParentNode(
|
|
4964
|
+
prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
|
|
4965
|
+
),
|
|
4895
4966
|
// anchor may have changed if it's in a fragment
|
|
4896
4967
|
getNextHostNode(prevTree),
|
|
4897
4968
|
instance,
|
|
@@ -5311,8 +5382,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5311
5382
|
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
|
|
5312
5383
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
5313
5384
|
}
|
|
5314
|
-
if (shapeFlag & 256) {
|
|
5315
|
-
parentComponent.ctx.deactivate(vnode);
|
|
5385
|
+
if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
|
|
5316
5386
|
return;
|
|
5317
5387
|
}
|
|
5318
5388
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
@@ -5431,16 +5501,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5431
5501
|
if (job) {
|
|
5432
5502
|
job.flags |= 8;
|
|
5433
5503
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5434
|
-
} else if (
|
|
5504
|
+
} else if (subTree) {
|
|
5435
5505
|
subTree.transition = instance.vnode.transition;
|
|
5436
5506
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5437
5507
|
}
|
|
5438
5508
|
if (um) {
|
|
5439
5509
|
queuePostRenderEffect(um, parentSuspense);
|
|
5440
5510
|
}
|
|
5441
|
-
|
|
5511
|
+
const markUnmounted = () => {
|
|
5442
5512
|
instance.isUnmounted = true;
|
|
5443
|
-
}
|
|
5513
|
+
};
|
|
5514
|
+
markUnmounted.flags = 16;
|
|
5515
|
+
queuePostRenderEffect(markUnmounted, parentSuspense);
|
|
5444
5516
|
};
|
|
5445
5517
|
const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
|
|
5446
5518
|
for (let i = start; i < children.length; i++) {
|
|
@@ -5586,13 +5658,13 @@ function getSequence(arr) {
|
|
|
5586
5658
|
}
|
|
5587
5659
|
return result;
|
|
5588
5660
|
}
|
|
5589
|
-
function
|
|
5661
|
+
function locateUnresolvedAsyncRoot(instance) {
|
|
5590
5662
|
const subComponent = instance.subTree.component;
|
|
5591
5663
|
if (subComponent) {
|
|
5592
5664
|
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
5593
5665
|
return subComponent;
|
|
5594
5666
|
} else {
|
|
5595
|
-
return
|
|
5667
|
+
return locateUnresolvedAsyncRoot(subComponent);
|
|
5596
5668
|
}
|
|
5597
5669
|
}
|
|
5598
5670
|
}
|
|
@@ -5610,11 +5682,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
|
5610
5682
|
if (instance) {
|
|
5611
5683
|
return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
5612
5684
|
}
|
|
5685
|
+
const suspense = anchorVnode.suspense;
|
|
5686
|
+
if (suspense && suspense.activeBranch) {
|
|
5687
|
+
return resolveAsyncComponentPlaceholder(suspense.activeBranch);
|
|
5688
|
+
}
|
|
5613
5689
|
return null;
|
|
5614
5690
|
}
|
|
5615
5691
|
|
|
5616
5692
|
const isSuspense = (type) => type.__isSuspense;
|
|
5617
5693
|
let suspenseId = 0;
|
|
5694
|
+
const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
|
|
5618
5695
|
const SuspenseImpl = {
|
|
5619
5696
|
name: "Suspense",
|
|
5620
5697
|
// In order to make Suspense tree-shakable, we need to avoid importing it
|
|
@@ -5636,11 +5713,22 @@ const SuspenseImpl = {
|
|
|
5636
5713
|
rendererInternals
|
|
5637
5714
|
);
|
|
5638
5715
|
} else {
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5716
|
+
const suspense = n1.suspense;
|
|
5717
|
+
if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
|
|
5718
|
+
const owner = suspense.parentComponent;
|
|
5719
|
+
const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
|
|
5720
|
+
if (retained ? (
|
|
5721
|
+
// deps can outlive the pending branch: skip only while it exists
|
|
5722
|
+
parentSuspense.pendingBranch && !isSameVNodeType(
|
|
5723
|
+
n2.ssContent,
|
|
5724
|
+
suspense.pendingBranch || suspense.activeBranch
|
|
5725
|
+
)
|
|
5726
|
+
) : !suspense.isInFallback) {
|
|
5727
|
+
n2.suspense = suspense;
|
|
5728
|
+
suspense.vnode = n2;
|
|
5729
|
+
n2.el = n1.el;
|
|
5730
|
+
return;
|
|
5731
|
+
}
|
|
5644
5732
|
}
|
|
5645
5733
|
patchSuspense(
|
|
5646
5734
|
n1,
|
|
@@ -5665,6 +5753,38 @@ function triggerEvent(vnode, name) {
|
|
|
5665
5753
|
eventListener();
|
|
5666
5754
|
}
|
|
5667
5755
|
}
|
|
5756
|
+
function enterDeferred(branch) {
|
|
5757
|
+
const enters = [];
|
|
5758
|
+
collectDeferredEnters(branch, enters, true);
|
|
5759
|
+
if (enters.length) {
|
|
5760
|
+
queuePostFlushCb(enters);
|
|
5761
|
+
}
|
|
5762
|
+
}
|
|
5763
|
+
function collectDeferredEnters(vnode, enters, isRoot) {
|
|
5764
|
+
const { el, transition, children, shapeFlag } = vnode;
|
|
5765
|
+
if (shapeFlag & 6) {
|
|
5766
|
+
collectDeferredEnters(vnode.component.subTree, enters, isRoot);
|
|
5767
|
+
return;
|
|
5768
|
+
}
|
|
5769
|
+
if (shapeFlag & (128 | 64)) {
|
|
5770
|
+
return;
|
|
5771
|
+
}
|
|
5772
|
+
if (shapeFlag & 1) {
|
|
5773
|
+
if (!isRoot && el && el[deferredEnterKey]) {
|
|
5774
|
+
el[deferredEnterKey] = void 0;
|
|
5775
|
+
if (transition && !transition.persisted) {
|
|
5776
|
+
transition.beforeEnter(el);
|
|
5777
|
+
enters.push(() => transition.enter(el));
|
|
5778
|
+
}
|
|
5779
|
+
}
|
|
5780
|
+
isRoot = false;
|
|
5781
|
+
}
|
|
5782
|
+
if (shapeFlag & 16) {
|
|
5783
|
+
for (let i = 0; i < children.length; i++) {
|
|
5784
|
+
collectDeferredEnters(children[i], enters, isRoot);
|
|
5785
|
+
}
|
|
5786
|
+
}
|
|
5787
|
+
}
|
|
5668
5788
|
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
5669
5789
|
const {
|
|
5670
5790
|
p: patch,
|
|
@@ -5764,7 +5884,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5764
5884
|
unmount(pendingBranch, parentComponent, suspense);
|
|
5765
5885
|
}
|
|
5766
5886
|
suspense.deps = 0;
|
|
5767
|
-
suspense
|
|
5887
|
+
discardEffects(suspense);
|
|
5768
5888
|
suspense.hiddenContainer = createElement("div");
|
|
5769
5889
|
if (isInFallback) {
|
|
5770
5890
|
patch(
|
|
@@ -5842,11 +5962,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5842
5962
|
} else {
|
|
5843
5963
|
triggerEvent(n2, "onPending");
|
|
5844
5964
|
suspense.pendingBranch = newBranch;
|
|
5845
|
-
|
|
5846
|
-
suspense.pendingId = newBranch.component.suspenseId;
|
|
5847
|
-
} else {
|
|
5848
|
-
suspense.pendingId = suspenseId++;
|
|
5849
|
-
}
|
|
5965
|
+
suspense.pendingId = suspenseId++;
|
|
5850
5966
|
patch(
|
|
5851
5967
|
null,
|
|
5852
5968
|
newBranch,
|
|
@@ -5861,12 +5977,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5861
5977
|
if (suspense.deps <= 0) {
|
|
5862
5978
|
suspense.resolve();
|
|
5863
5979
|
} else {
|
|
5864
|
-
const { timeout
|
|
5980
|
+
const { timeout } = suspense;
|
|
5865
5981
|
if (timeout > 0) {
|
|
5866
|
-
setTimeout(() => {
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
}
|
|
5982
|
+
suspense.timeoutTimer = setTimeout(() => {
|
|
5983
|
+
suspense.timeoutTimer = void 0;
|
|
5984
|
+
suspense.fallback(suspense.vnode.ssFallback);
|
|
5870
5985
|
}, timeout);
|
|
5871
5986
|
} else if (timeout === 0) {
|
|
5872
5987
|
suspense.fallback(newFallback);
|
|
@@ -5903,6 +6018,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5903
6018
|
deps: 0,
|
|
5904
6019
|
pendingId: suspenseId++,
|
|
5905
6020
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
6021
|
+
timeoutTimer: void 0,
|
|
5906
6022
|
activeBranch: null,
|
|
5907
6023
|
isFallbackMountPending: false,
|
|
5908
6024
|
pendingBranch: null,
|
|
@@ -5929,7 +6045,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5929
6045
|
let hasUpdatedAnchor = false;
|
|
5930
6046
|
if (delayEnter) {
|
|
5931
6047
|
activeBranch.transition.afterLeave = () => {
|
|
5932
|
-
if (pendingId === suspense.pendingId) {
|
|
6048
|
+
if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
|
|
6049
|
+
enterDeferred(pendingBranch);
|
|
5933
6050
|
move(
|
|
5934
6051
|
pendingBranch,
|
|
5935
6052
|
container2,
|
|
@@ -5944,7 +6061,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5944
6061
|
};
|
|
5945
6062
|
}
|
|
5946
6063
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
5947
|
-
if (parentNode(
|
|
6064
|
+
if (parentNode(
|
|
6065
|
+
activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
|
|
6066
|
+
) === container2) {
|
|
5948
6067
|
anchor = next(activeBranch);
|
|
5949
6068
|
hasUpdatedAnchor = true;
|
|
5950
6069
|
}
|
|
@@ -5954,13 +6073,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5954
6073
|
}
|
|
5955
6074
|
}
|
|
5956
6075
|
if (!delayEnter) {
|
|
6076
|
+
enterDeferred(pendingBranch);
|
|
5957
6077
|
move(pendingBranch, container2, anchor, 0);
|
|
5958
6078
|
}
|
|
5959
6079
|
}
|
|
6080
|
+
clearTimeout(suspense.timeoutTimer);
|
|
6081
|
+
suspense.timeoutTimer = void 0;
|
|
5960
6082
|
suspense.isFallbackMountPending = false;
|
|
5961
6083
|
setActiveBranch(suspense, pendingBranch);
|
|
5962
6084
|
suspense.pendingBranch = null;
|
|
5963
6085
|
suspense.isInFallback = false;
|
|
6086
|
+
let kept = 0;
|
|
6087
|
+
for (let i = 0; i < effects.length; i++) {
|
|
6088
|
+
const effect = effects[i];
|
|
6089
|
+
if (effect.flags & 32) {
|
|
6090
|
+
queuePostFlushCb(effect);
|
|
6091
|
+
} else {
|
|
6092
|
+
effects[kept++] = effect;
|
|
6093
|
+
}
|
|
6094
|
+
}
|
|
6095
|
+
effects.length = kept;
|
|
5964
6096
|
let parent = suspense.parent;
|
|
5965
6097
|
let hasUnresolvedAncestor = false;
|
|
5966
6098
|
while (parent) {
|
|
@@ -5989,7 +6121,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5989
6121
|
triggerEvent(vnode2, "onResolve");
|
|
5990
6122
|
},
|
|
5991
6123
|
fallback(fallbackVNode) {
|
|
5992
|
-
if (!suspense.pendingBranch) {
|
|
6124
|
+
if (suspense.isUnmounted || !suspense.pendingBranch) {
|
|
5993
6125
|
return;
|
|
5994
6126
|
}
|
|
5995
6127
|
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
|
|
@@ -5997,7 +6129,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5997
6129
|
const anchor2 = next(activeBranch);
|
|
5998
6130
|
const mountFallback = () => {
|
|
5999
6131
|
suspense.isFallbackMountPending = false;
|
|
6000
|
-
if (!suspense.isInFallback) {
|
|
6132
|
+
if (suspense.isUnmounted || !suspense.isInFallback) {
|
|
6001
6133
|
return;
|
|
6002
6134
|
}
|
|
6003
6135
|
const latestFallback = suspense.vnode.ssFallback;
|
|
@@ -6049,19 +6181,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
6049
6181
|
suspense.deps++;
|
|
6050
6182
|
}
|
|
6051
6183
|
const hydratedEl = instance.vnode.el;
|
|
6052
|
-
|
|
6053
|
-
handleError(err, instance, 0);
|
|
6054
|
-
}).then((asyncSetupResult) => {
|
|
6055
|
-
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
|
|
6056
|
-
return;
|
|
6057
|
-
}
|
|
6058
|
-
unsetCurrentInstance();
|
|
6059
|
-
if (!instance.scope.active) {
|
|
6060
|
-
if (isInPendingSuspense && --suspense.deps === 0) {
|
|
6061
|
-
suspense.resolve();
|
|
6062
|
-
}
|
|
6063
|
-
return;
|
|
6064
|
-
}
|
|
6184
|
+
const render = (asyncSetupResult) => {
|
|
6065
6185
|
instance.asyncResolved = true;
|
|
6066
6186
|
const { vnode: vnode2 } = instance;
|
|
6067
6187
|
handleSetupResult(instance, asyncSetupResult, false);
|
|
@@ -6088,13 +6208,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
6088
6208
|
remove(placeholder);
|
|
6089
6209
|
}
|
|
6090
6210
|
updateHOCHostEl(instance, vnode2.el);
|
|
6091
|
-
|
|
6211
|
+
};
|
|
6212
|
+
instance.asyncDep.catch((err) => {
|
|
6213
|
+
handleError(err, instance, 0, false, true);
|
|
6214
|
+
return () => null;
|
|
6215
|
+
}).then((asyncSetupResult) => {
|
|
6216
|
+
if (instance.isUnmounted || suspense.isUnmounted) {
|
|
6217
|
+
return;
|
|
6218
|
+
}
|
|
6219
|
+
const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
|
|
6220
|
+
unsetCurrentInstance();
|
|
6221
|
+
if (!instance.scope.active) {
|
|
6222
|
+
if (isPendingDep && --suspense.deps === 0) {
|
|
6223
|
+
suspense.resolve();
|
|
6224
|
+
}
|
|
6225
|
+
return;
|
|
6226
|
+
}
|
|
6227
|
+
if (!isPendingDep && suspense.pendingBranch) {
|
|
6228
|
+
const job = () => {
|
|
6229
|
+
if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
|
|
6230
|
+
return;
|
|
6231
|
+
}
|
|
6232
|
+
if (suspense.pendingBranch) {
|
|
6233
|
+
queueEffectWithSuspense(job, suspense);
|
|
6234
|
+
} else {
|
|
6235
|
+
render(asyncSetupResult);
|
|
6236
|
+
}
|
|
6237
|
+
};
|
|
6238
|
+
job.flags = 16 | 32;
|
|
6239
|
+
queueEffectWithSuspense(job, suspense);
|
|
6240
|
+
return;
|
|
6241
|
+
}
|
|
6242
|
+
render(asyncSetupResult);
|
|
6243
|
+
if (isPendingDep && --suspense.deps === 0) {
|
|
6092
6244
|
suspense.resolve();
|
|
6093
6245
|
}
|
|
6094
6246
|
});
|
|
6095
6247
|
},
|
|
6096
6248
|
unmount(parentSuspense2, doRemove) {
|
|
6097
6249
|
suspense.isUnmounted = true;
|
|
6250
|
+
clearTimeout(suspense.timeoutTimer);
|
|
6251
|
+
suspense.timeoutTimer = void 0;
|
|
6252
|
+
if (parentSuspenseId !== void 0) {
|
|
6253
|
+
const parent = suspense.parent;
|
|
6254
|
+
const pendingId = parentSuspenseId;
|
|
6255
|
+
parentSuspenseId = void 0;
|
|
6256
|
+
queuePostFlushCb(() => {
|
|
6257
|
+
if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
|
|
6258
|
+
parent.resolve();
|
|
6259
|
+
}
|
|
6260
|
+
});
|
|
6261
|
+
}
|
|
6098
6262
|
if (suspense.activeBranch) {
|
|
6099
6263
|
unmount(
|
|
6100
6264
|
suspense.activeBranch,
|
|
@@ -6104,12 +6268,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
6104
6268
|
);
|
|
6105
6269
|
}
|
|
6106
6270
|
if (suspense.pendingBranch) {
|
|
6107
|
-
unmount(
|
|
6108
|
-
|
|
6109
|
-
parentComponent,
|
|
6110
|
-
parentSuspense2,
|
|
6111
|
-
doRemove
|
|
6112
|
-
);
|
|
6271
|
+
unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
|
|
6272
|
+
discardEffects(suspense);
|
|
6113
6273
|
}
|
|
6114
6274
|
}
|
|
6115
6275
|
};
|
|
@@ -6176,6 +6336,16 @@ function normalizeSuspenseSlot(s) {
|
|
|
6176
6336
|
}
|
|
6177
6337
|
return s;
|
|
6178
6338
|
}
|
|
6339
|
+
function discardEffects(suspense) {
|
|
6340
|
+
const { effects } = suspense;
|
|
6341
|
+
for (let i = 0; i < effects.length; i++) {
|
|
6342
|
+
const effect = effects[i];
|
|
6343
|
+
if (effect.flags & 16) {
|
|
6344
|
+
queuePostFlushCb(effect);
|
|
6345
|
+
}
|
|
6346
|
+
}
|
|
6347
|
+
effects.length = 0;
|
|
6348
|
+
}
|
|
6179
6349
|
function queueEffectWithSuspense(fn, suspense) {
|
|
6180
6350
|
if (suspense && suspense.pendingBranch) {
|
|
6181
6351
|
if (shared.isArray(fn)) {
|
|
@@ -6384,7 +6554,8 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
6384
6554
|
}
|
|
6385
6555
|
function guardReactiveProps(props) {
|
|
6386
6556
|
if (!props) return null;
|
|
6387
|
-
|
|
6557
|
+
if (reactivity.isProxy(props)) return shared.extend({}, props);
|
|
6558
|
+
return isInternalObject(props) ? shared.extend({}, props[rawAttrsKey] || props) : props;
|
|
6388
6559
|
}
|
|
6389
6560
|
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
6390
6561
|
const { props, ref, patchFlag, children, transition } = vnode;
|
|
@@ -6556,7 +6727,7 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
6556
6727
|
]);
|
|
6557
6728
|
}
|
|
6558
6729
|
|
|
6559
|
-
const emptyAppContext = createAppContext();
|
|
6730
|
+
const emptyAppContext = /* @__PURE__ */ createAppContext();
|
|
6560
6731
|
let uid = 0;
|
|
6561
6732
|
function getNextUid() {
|
|
6562
6733
|
return uid;
|
|
@@ -6736,7 +6907,8 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6736
6907
|
setInSSRSetupState(false);
|
|
6737
6908
|
}
|
|
6738
6909
|
}).catch((e) => {
|
|
6739
|
-
handleError(e, instance, 0);
|
|
6910
|
+
handleError(e, instance, 0, void 0, true);
|
|
6911
|
+
instance.ssrRender = (_, push) => push("<!---->");
|
|
6740
6912
|
});
|
|
6741
6913
|
} else {
|
|
6742
6914
|
instance.asyncDep = setupResult;
|
|
@@ -6808,10 +6980,11 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
6808
6980
|
}
|
|
6809
6981
|
}
|
|
6810
6982
|
}
|
|
6983
|
+
const rawAttrsKey = /* @__PURE__ */ Symbol();
|
|
6811
6984
|
const attrsProxyHandlers = {
|
|
6812
6985
|
get(target, key) {
|
|
6813
6986
|
reactivity.track(target, "get", "");
|
|
6814
|
-
return target[key];
|
|
6987
|
+
return key === rawAttrsKey ? target : target[key];
|
|
6815
6988
|
}
|
|
6816
6989
|
};
|
|
6817
6990
|
function createSetupContext(instance) {
|
|
@@ -6915,7 +7088,7 @@ function isMemoSame(cached, memo) {
|
|
|
6915
7088
|
return true;
|
|
6916
7089
|
}
|
|
6917
7090
|
|
|
6918
|
-
const version = "3.5.
|
|
7091
|
+
const version = "3.5.45";
|
|
6919
7092
|
const warn$1 = shared.NOOP;
|
|
6920
7093
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6921
7094
|
const devtools = void 0;
|