@vue/runtime-core 3.5.43 → 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 +424 -162
- package/dist/runtime-core.cjs.prod.js +400 -148
- package/dist/runtime-core.d.ts +17 -5
- package/dist/runtime-core.esm-bundler.js +427 -165
- 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;
|
|
@@ -205,15 +207,15 @@ function queuePostFlushCb(cb) {
|
|
|
205
207
|
}
|
|
206
208
|
queueFlush();
|
|
207
209
|
}
|
|
208
|
-
function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
|
|
210
|
+
function flushPreFlushCbs(instance, minUid, seen, i = flushIndex + 1) {
|
|
209
211
|
for (; i < queue.length; i++) {
|
|
210
212
|
const cb = queue[i];
|
|
211
213
|
if (cb && cb.flags & 2) {
|
|
212
|
-
if (instance && cb.id !== instance.uid) {
|
|
214
|
+
if (instance && cb.id !== instance.uid || minUid !== void 0 && !(cb.id >= minUid)) {
|
|
213
215
|
continue;
|
|
214
216
|
}
|
|
215
217
|
queue.splice(i, 1);
|
|
216
|
-
i
|
|
218
|
+
i = instance ? i - 1 : flushIndex;
|
|
217
219
|
if (cb.flags & 4) {
|
|
218
220
|
cb.flags &= -2;
|
|
219
221
|
}
|
|
@@ -224,12 +226,23 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
|
|
|
224
226
|
}
|
|
225
227
|
}
|
|
226
228
|
}
|
|
227
|
-
function flushPostFlushCbs(seen) {
|
|
229
|
+
function flushPostFlushCbs(seen, skip, minUid = 0) {
|
|
228
230
|
if (pendingPostFlushCbs.length) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
)
|
|
232
|
-
|
|
231
|
+
let cbs = pendingPostFlushCbs;
|
|
232
|
+
let kept = 0;
|
|
233
|
+
if (skip) {
|
|
234
|
+
cbs = [];
|
|
235
|
+
for (let i = 0; i < pendingPostFlushCbs.length; i++) {
|
|
236
|
+
const cb = pendingPostFlushCbs[i];
|
|
237
|
+
if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) {
|
|
238
|
+
pendingPostFlushCbs[kept++] = cb;
|
|
239
|
+
} else {
|
|
240
|
+
cbs.push(cb);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const deduped = [...new Set(cbs)].sort((a, b) => getId(a) - getId(b));
|
|
245
|
+
pendingPostFlushCbs.length = kept;
|
|
233
246
|
if (activePostFlushCbs) {
|
|
234
247
|
for (let i = 0; i < deduped.length; i++) {
|
|
235
248
|
activePostFlushCbs.push(deduped[i]);
|
|
@@ -249,6 +262,22 @@ function flushPostFlushCbs(seen) {
|
|
|
249
262
|
postFlushIndex = 0;
|
|
250
263
|
}
|
|
251
264
|
}
|
|
265
|
+
let isFlushing = false;
|
|
266
|
+
function flushOnAppMount(fn, minUid) {
|
|
267
|
+
if (isFlushing) {
|
|
268
|
+
fn();
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
const queued = minUid === void 0 ? void 0 : new Set(pendingPostFlushCbs);
|
|
272
|
+
fn();
|
|
273
|
+
isFlushing = true;
|
|
274
|
+
try {
|
|
275
|
+
flushPreFlushCbs(void 0, minUid);
|
|
276
|
+
flushPostFlushCbs(void 0, queued, minUid);
|
|
277
|
+
} finally {
|
|
278
|
+
isFlushing = false;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
252
281
|
const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
|
|
253
282
|
function flushJobs(seen) {
|
|
254
283
|
try {
|
|
@@ -361,12 +390,31 @@ function withDirectives(vnode, directives) {
|
|
|
361
390
|
return vnode;
|
|
362
391
|
}
|
|
363
392
|
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
364
|
-
|
|
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;
|
|
365
411
|
const oldBindings = prevVNode && prevVNode.dirs;
|
|
366
412
|
for (let i = 0; i < bindings.length; i++) {
|
|
367
|
-
|
|
413
|
+
let binding = bindings[i];
|
|
368
414
|
if (oldBindings) {
|
|
369
415
|
binding.oldValue = oldBindings[i].value;
|
|
416
|
+
} else if (name === "mounted" && binding.oldValue !== void 0) {
|
|
417
|
+
binding = shared.extend({}, binding, { oldValue: void 0 });
|
|
370
418
|
}
|
|
371
419
|
let hook = binding.dir[name];
|
|
372
420
|
if (hook) {
|
|
@@ -374,7 +422,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
374
422
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
375
423
|
vnode.el,
|
|
376
424
|
binding,
|
|
377
|
-
|
|
425
|
+
hookVNode,
|
|
378
426
|
prevVNode
|
|
379
427
|
]);
|
|
380
428
|
reactivity.resetTracking();
|
|
@@ -458,6 +506,7 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
|
458
506
|
let isPre = false;
|
|
459
507
|
if (flush === "post") {
|
|
460
508
|
baseWatchOptions.scheduler = (job) => {
|
|
509
|
+
job.i = instance;
|
|
461
510
|
queuePostRenderEffect(job, instance && instance.suspense);
|
|
462
511
|
};
|
|
463
512
|
} else if (flush !== "sync") {
|
|
@@ -736,7 +785,11 @@ const TeleportImpl = {
|
|
|
736
785
|
};
|
|
737
786
|
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
|
|
738
787
|
if (moveType === 0) {
|
|
788
|
+
if (vnode.targetStart) {
|
|
789
|
+
insert(vnode.targetStart, container, parentAnchor);
|
|
790
|
+
}
|
|
739
791
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
792
|
+
parentAnchor = vnode.targetAnchor;
|
|
740
793
|
}
|
|
741
794
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
742
795
|
const isReorder = moveType === 2;
|
|
@@ -905,10 +958,6 @@ const BaseTransitionPropsValidators = {
|
|
|
905
958
|
onAfterAppear: TransitionHookValidator,
|
|
906
959
|
onAppearCancelled: TransitionHookValidator
|
|
907
960
|
};
|
|
908
|
-
const recursiveGetSubtree = (instance) => {
|
|
909
|
-
const subTree = instance.subTree;
|
|
910
|
-
return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
|
|
911
|
-
};
|
|
912
961
|
const BaseTransitionImpl = {
|
|
913
962
|
name: `BaseTransition`,
|
|
914
963
|
props: BaseTransitionPropsValidators,
|
|
@@ -934,19 +983,17 @@ const BaseTransitionImpl = {
|
|
|
934
983
|
if (!innerChild) {
|
|
935
984
|
return emptyPlaceholder(child);
|
|
936
985
|
}
|
|
937
|
-
|
|
986
|
+
const enterHooks = resolveTransitionHooks(
|
|
938
987
|
innerChild,
|
|
939
988
|
rawProps,
|
|
940
989
|
state,
|
|
941
|
-
instance
|
|
942
|
-
// #11061, ensure enterHooks is fresh after clone
|
|
943
|
-
(hooks) => enterHooks = hooks
|
|
990
|
+
instance
|
|
944
991
|
);
|
|
945
992
|
if (innerChild.type !== Comment) {
|
|
946
993
|
setTransitionHooks(innerChild, enterHooks);
|
|
947
994
|
}
|
|
948
995
|
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
949
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) &&
|
|
996
|
+
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && getTransitionRoot(instance.subTree)) {
|
|
950
997
|
let leavingHooks = resolveTransitionHooks(
|
|
951
998
|
oldInnerChild,
|
|
952
999
|
rawProps,
|
|
@@ -959,7 +1006,17 @@ const BaseTransitionImpl = {
|
|
|
959
1006
|
leavingHooks.afterLeave = () => {
|
|
960
1007
|
state.isLeaving = false;
|
|
961
1008
|
if (!(instance.job.flags & 8)) {
|
|
962
|
-
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
|
+
}
|
|
963
1020
|
}
|
|
964
1021
|
delete leavingHooks.afterLeave;
|
|
965
1022
|
oldInnerChild = void 0;
|
|
@@ -1016,7 +1073,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
1016
1073
|
}
|
|
1017
1074
|
return leavingVNodesCache;
|
|
1018
1075
|
}
|
|
1019
|
-
function resolveTransitionHooks(vnode, props, state, instance
|
|
1076
|
+
function resolveTransitionHooks(vnode, props, state, instance) {
|
|
1020
1077
|
const {
|
|
1021
1078
|
appear,
|
|
1022
1079
|
mode,
|
|
@@ -1072,8 +1129,15 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1072
1129
|
);
|
|
1073
1130
|
}
|
|
1074
1131
|
const leavingVNode = leavingVNodesCache[key];
|
|
1075
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)
|
|
1076
|
-
leavingVNode.el[leaveCbKey]
|
|
1132
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
|
|
1133
|
+
let leavingCb = leavingVNode.el[leaveCbKey];
|
|
1134
|
+
if (!leavingCb) {
|
|
1135
|
+
const leavingRoot = getTransitionRoot(leavingVNode);
|
|
1136
|
+
leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
|
|
1137
|
+
}
|
|
1138
|
+
if (leavingCb) {
|
|
1139
|
+
leavingCb();
|
|
1140
|
+
}
|
|
1077
1141
|
}
|
|
1078
1142
|
callHook(hook, [el]);
|
|
1079
1143
|
},
|
|
@@ -1148,15 +1212,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1148
1212
|
}
|
|
1149
1213
|
},
|
|
1150
1214
|
clone(vnode2) {
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
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;
|
|
1160
1230
|
}
|
|
1161
1231
|
};
|
|
1162
1232
|
return hooks;
|
|
@@ -1197,10 +1267,24 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
1197
1267
|
hooks
|
|
1198
1268
|
);
|
|
1199
1269
|
} else if (vnode.shapeFlag & 128) {
|
|
1200
|
-
|
|
1201
|
-
|
|
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
|
+
}
|
|
1202
1280
|
} else {
|
|
1203
1281
|
vnode.transition = hooks;
|
|
1282
|
+
if (vnode.type === Fragment && shared.isArray(vnode.children)) {
|
|
1283
|
+
const child = filterSingleRoot(vnode.children, false);
|
|
1284
|
+
if (child) {
|
|
1285
|
+
setTransitionHooks(child, hooks);
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1204
1288
|
}
|
|
1205
1289
|
}
|
|
1206
1290
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
@@ -1225,6 +1309,18 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1225
1309
|
}
|
|
1226
1310
|
return ret;
|
|
1227
1311
|
}
|
|
1312
|
+
function getTransitionRoot(vnode) {
|
|
1313
|
+
if (vnode.component) {
|
|
1314
|
+
return getTransitionRoot(vnode.component.subTree);
|
|
1315
|
+
}
|
|
1316
|
+
if (vnode.type === Fragment) {
|
|
1317
|
+
const child = shared.isArray(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1318
|
+
return child ? getTransitionRoot(child) : void 0;
|
|
1319
|
+
}
|
|
1320
|
+
if (vnode.type !== Comment) {
|
|
1321
|
+
return vnode;
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1228
1324
|
|
|
1229
1325
|
// @__NO_SIDE_EFFECTS__
|
|
1230
1326
|
function defineComponent(options, extraOptions) {
|
|
@@ -1805,7 +1901,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1805
1901
|
getContainerType(container),
|
|
1806
1902
|
slotScopeIds
|
|
1807
1903
|
);
|
|
1808
|
-
if (parentComponent) {
|
|
1904
|
+
if (parentComponent && parentComponent.vnode.el === node) {
|
|
1809
1905
|
parentComponent.vnode.el = vnode.el;
|
|
1810
1906
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
1811
1907
|
}
|
|
@@ -1919,14 +2015,22 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
|
1919
2015
|
break;
|
|
1920
2016
|
}
|
|
1921
2017
|
}, opts);
|
|
1922
|
-
|
|
1923
|
-
if (!(el instanceof Element)) return;
|
|
2018
|
+
const observe = (el) => {
|
|
1924
2019
|
if (elementIsVisibleInViewport(el)) {
|
|
1925
2020
|
hydrate();
|
|
1926
2021
|
ob.disconnect();
|
|
1927
2022
|
return false;
|
|
1928
2023
|
}
|
|
2024
|
+
if (getComputedStyle(el).display === "contents") {
|
|
2025
|
+
for (let i = 0; i < el.children.length; i++) {
|
|
2026
|
+
if (observe(el.children[i]) === false) return false;
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
1929
2029
|
ob.observe(el);
|
|
2030
|
+
};
|
|
2031
|
+
forEach((el) => {
|
|
2032
|
+
if (!(el instanceof Element)) return;
|
|
2033
|
+
return observe(el);
|
|
1930
2034
|
});
|
|
1931
2035
|
return () => ob.disconnect();
|
|
1932
2036
|
};
|
|
@@ -2083,7 +2187,8 @@ function defineAsyncComponent(source) {
|
|
|
2083
2187
|
err,
|
|
2084
2188
|
instance,
|
|
2085
2189
|
13,
|
|
2086
|
-
!errorComponent
|
|
2190
|
+
!errorComponent,
|
|
2191
|
+
true
|
|
2087
2192
|
);
|
|
2088
2193
|
};
|
|
2089
2194
|
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
@@ -2101,7 +2206,7 @@ function defineAsyncComponent(source) {
|
|
|
2101
2206
|
const delayed = reactivity.ref(!!delay);
|
|
2102
2207
|
let timeoutTimer;
|
|
2103
2208
|
let delayTimer;
|
|
2104
|
-
|
|
2209
|
+
reactivity.onScopeDispose(() => {
|
|
2105
2210
|
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
2106
2211
|
if (delayTimer != null) clearTimeout(delayTimer);
|
|
2107
2212
|
});
|
|
@@ -2223,6 +2328,12 @@ const KeepAliveImpl = {
|
|
|
2223
2328
|
}, parentSuspense);
|
|
2224
2329
|
};
|
|
2225
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
|
+
}
|
|
2226
2337
|
const instance2 = vnode.component;
|
|
2227
2338
|
invalidateMount(instance2.m);
|
|
2228
2339
|
invalidateMount(instance2.a);
|
|
@@ -2237,6 +2348,7 @@ const KeepAliveImpl = {
|
|
|
2237
2348
|
}
|
|
2238
2349
|
instance2.isDeactivated = true;
|
|
2239
2350
|
}, parentSuspense);
|
|
2351
|
+
return true;
|
|
2240
2352
|
};
|
|
2241
2353
|
function unmount(vnode) {
|
|
2242
2354
|
resetShapeFlag(vnode);
|
|
@@ -2258,6 +2370,7 @@ const KeepAliveImpl = {
|
|
|
2258
2370
|
unmount(cached);
|
|
2259
2371
|
} else if (current) {
|
|
2260
2372
|
resetShapeFlag(current);
|
|
2373
|
+
if (cached) resetShapeFlag(cached);
|
|
2261
2374
|
}
|
|
2262
2375
|
cache.delete(key);
|
|
2263
2376
|
keys.delete(key);
|
|
@@ -2275,12 +2388,17 @@ const KeepAliveImpl = {
|
|
|
2275
2388
|
const cacheSubtree = () => {
|
|
2276
2389
|
if (pendingCacheKey != null) {
|
|
2277
2390
|
if (isSuspense(instance.subTree.type)) {
|
|
2278
|
-
|
|
2391
|
+
const cacheInnerChild = () => {
|
|
2279
2392
|
const vnode = getInnerChild(instance.subTree);
|
|
2280
2393
|
if (vnode.component) {
|
|
2281
2394
|
cache.set(pendingCacheKey, vnode);
|
|
2282
2395
|
}
|
|
2283
|
-
}
|
|
2396
|
+
};
|
|
2397
|
+
if (instance.subTree.suspense.pendingBranch) {
|
|
2398
|
+
queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
|
|
2399
|
+
} else {
|
|
2400
|
+
cacheInnerChild();
|
|
2401
|
+
}
|
|
2284
2402
|
} else {
|
|
2285
2403
|
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
2286
2404
|
}
|
|
@@ -2408,9 +2526,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
2408
2526
|
true
|
|
2409
2527
|
/* prepend */
|
|
2410
2528
|
);
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2529
|
+
const removal = injectHook(
|
|
2530
|
+
"um",
|
|
2531
|
+
() => shared.remove(keepAliveRoot[type], injected),
|
|
2532
|
+
target
|
|
2533
|
+
);
|
|
2534
|
+
removal.flags = 16;
|
|
2414
2535
|
}
|
|
2415
2536
|
function resetShapeFlag(vnode) {
|
|
2416
2537
|
vnode.shapeFlag &= -257;
|
|
@@ -2531,7 +2652,9 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2531
2652
|
);
|
|
2532
2653
|
}
|
|
2533
2654
|
} else if (typeof source === "number") {
|
|
2534
|
-
{
|
|
2655
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
2656
|
+
ret = [];
|
|
2657
|
+
} else {
|
|
2535
2658
|
ret = new Array(source);
|
|
2536
2659
|
for (let i = 0; i < source; i++) {
|
|
2537
2660
|
ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
@@ -3711,7 +3834,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3711
3834
|
}
|
|
3712
3835
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
3713
3836
|
const key = nextKeys[i];
|
|
3714
|
-
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
|
|
3837
|
+
if (!shared.hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
|
|
3715
3838
|
return true;
|
|
3716
3839
|
}
|
|
3717
3840
|
}
|
|
@@ -4370,6 +4493,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4370
4493
|
const needCallTransitionHooks = needTransition(parentSuspense, transition);
|
|
4371
4494
|
if (needCallTransitionHooks) {
|
|
4372
4495
|
transition.beforeEnter(el);
|
|
4496
|
+
} else if (transition && !transition.persisted) {
|
|
4497
|
+
el[deferredEnterKey] = true;
|
|
4373
4498
|
}
|
|
4374
4499
|
hostInsert(el, container, anchor);
|
|
4375
4500
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
@@ -4515,15 +4640,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4515
4640
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4516
4641
|
const oldVNode = oldChildren[i];
|
|
4517
4642
|
const newVNode = newChildren[i];
|
|
4643
|
+
const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
|
|
4518
4644
|
const container = (
|
|
4519
4645
|
// oldVNode may be an errored async setup() component inside Suspense
|
|
4520
4646
|
// which will not have a mounted element
|
|
4521
|
-
|
|
4647
|
+
oldEl && // - In the case of a Fragment, we need to provide the actual parent
|
|
4522
4648
|
// of the Fragment itself so it can move its children.
|
|
4523
4649
|
(oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
|
|
4524
4650
|
// which also requires the correct parent container
|
|
4525
4651
|
!isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
|
|
4526
|
-
oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(
|
|
4652
|
+
oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldEl) : (
|
|
4527
4653
|
// In other cases, the parent container is not actually used so we
|
|
4528
4654
|
// just pass the block element here to avoid a DOM parentNode call.
|
|
4529
4655
|
fallbackContainer
|
|
@@ -4676,7 +4802,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4676
4802
|
setupComponent(instance, false, optimized);
|
|
4677
4803
|
}
|
|
4678
4804
|
if (instance.asyncDep) {
|
|
4679
|
-
parentSuspense && parentSuspense.registerDep(
|
|
4805
|
+
parentSuspense && parentSuspense.registerDep(
|
|
4806
|
+
instance,
|
|
4807
|
+
setupRenderEffect,
|
|
4808
|
+
optimized,
|
|
4809
|
+
namespace
|
|
4810
|
+
);
|
|
4680
4811
|
if (!initialVNode.el) {
|
|
4681
4812
|
const placeholder = instance.subTree = createVNode(Comment);
|
|
4682
4813
|
processCommentNode(null, placeholder, container, anchor);
|
|
@@ -4699,6 +4830,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4699
4830
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
4700
4831
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4701
4832
|
n2.el = n1.el;
|
|
4833
|
+
n2.placeholder = n1.placeholder;
|
|
4702
4834
|
updateComponentPreRender(instance, n2, optimized);
|
|
4703
4835
|
return;
|
|
4704
4836
|
} else {
|
|
@@ -4707,6 +4839,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4707
4839
|
}
|
|
4708
4840
|
} else {
|
|
4709
4841
|
n2.el = n1.el;
|
|
4842
|
+
n2.placeholder = n1.placeholder;
|
|
4710
4843
|
instance.vnode = n2;
|
|
4711
4844
|
}
|
|
4712
4845
|
};
|
|
@@ -4782,16 +4915,23 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4782
4915
|
} else {
|
|
4783
4916
|
let { next, bu, u, parent, vnode } = instance;
|
|
4784
4917
|
{
|
|
4785
|
-
const
|
|
4786
|
-
if (
|
|
4918
|
+
const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
|
|
4919
|
+
if (unresolvedAsyncRoot) {
|
|
4787
4920
|
if (next) {
|
|
4788
4921
|
next.el = vnode.el;
|
|
4789
4922
|
updateComponentPreRender(instance, next, optimized);
|
|
4790
4923
|
}
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
if (
|
|
4794
|
-
|
|
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);
|
|
4795
4935
|
});
|
|
4796
4936
|
return;
|
|
4797
4937
|
}
|
|
@@ -4818,8 +4958,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4818
4958
|
patch(
|
|
4819
4959
|
prevTree,
|
|
4820
4960
|
nextTree,
|
|
4821
|
-
// parent may have changed if it's in a teleport
|
|
4822
|
-
|
|
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
|
+
),
|
|
4823
4966
|
// anchor may have changed if it's in a fragment
|
|
4824
4967
|
getNextHostNode(prevTree),
|
|
4825
4968
|
instance,
|
|
@@ -5239,8 +5382,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5239
5382
|
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
|
|
5240
5383
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
5241
5384
|
}
|
|
5242
|
-
if (shapeFlag & 256) {
|
|
5243
|
-
parentComponent.ctx.deactivate(vnode);
|
|
5385
|
+
if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
|
|
5244
5386
|
return;
|
|
5245
5387
|
}
|
|
5246
5388
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
@@ -5301,10 +5443,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5301
5443
|
};
|
|
5302
5444
|
const remove = (vnode) => {
|
|
5303
5445
|
const { type, el, anchor, transition } = vnode;
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
}
|
|
5446
|
+
const isFragment = type === Fragment;
|
|
5447
|
+
if (isFragment && !transition) {
|
|
5448
|
+
removeFragment(el, anchor);
|
|
5308
5449
|
return;
|
|
5309
5450
|
}
|
|
5310
5451
|
if (type === Static) {
|
|
@@ -5314,17 +5455,25 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5314
5455
|
}
|
|
5315
5456
|
return;
|
|
5316
5457
|
}
|
|
5458
|
+
const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
|
|
5317
5459
|
const performRemove = () => {
|
|
5318
|
-
|
|
5460
|
+
if (isFragment) {
|
|
5461
|
+
if (hostParentNode(el)) {
|
|
5462
|
+
removeFragment(el, anchor);
|
|
5463
|
+
}
|
|
5464
|
+
} else {
|
|
5465
|
+
hostRemove(el);
|
|
5466
|
+
}
|
|
5319
5467
|
if (transition && !transition.persisted && transition.afterLeave) {
|
|
5320
5468
|
transition.afterLeave();
|
|
5321
5469
|
}
|
|
5322
5470
|
};
|
|
5323
|
-
if (
|
|
5471
|
+
if (leavingNode && leavingNode.shapeFlag & 1 && transition && !transition.persisted) {
|
|
5324
5472
|
const { leave, delayLeave } = transition;
|
|
5325
|
-
const
|
|
5473
|
+
const leavingEl = leavingNode.el;
|
|
5474
|
+
const performLeave = () => leave(leavingEl, performRemove);
|
|
5326
5475
|
if (delayLeave) {
|
|
5327
|
-
delayLeave(
|
|
5476
|
+
delayLeave(leavingEl, performRemove, performLeave);
|
|
5328
5477
|
} else {
|
|
5329
5478
|
performLeave();
|
|
5330
5479
|
}
|
|
@@ -5352,16 +5501,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5352
5501
|
if (job) {
|
|
5353
5502
|
job.flags |= 8;
|
|
5354
5503
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5355
|
-
} else if (
|
|
5504
|
+
} else if (subTree) {
|
|
5356
5505
|
subTree.transition = instance.vnode.transition;
|
|
5357
5506
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
5358
5507
|
}
|
|
5359
5508
|
if (um) {
|
|
5360
5509
|
queuePostRenderEffect(um, parentSuspense);
|
|
5361
5510
|
}
|
|
5362
|
-
|
|
5511
|
+
const markUnmounted = () => {
|
|
5363
5512
|
instance.isUnmounted = true;
|
|
5364
|
-
}
|
|
5513
|
+
};
|
|
5514
|
+
markUnmounted.flags = 16;
|
|
5515
|
+
queuePostRenderEffect(markUnmounted, parentSuspense);
|
|
5365
5516
|
};
|
|
5366
5517
|
const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
|
|
5367
5518
|
for (let i = start; i < children.length; i++) {
|
|
@@ -5379,32 +5530,26 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5379
5530
|
const teleportEnd = el && el[TeleportEndKey];
|
|
5380
5531
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
5381
5532
|
};
|
|
5382
|
-
let isFlushing = false;
|
|
5383
5533
|
const render = (vnode, container, namespace) => {
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
if (
|
|
5387
|
-
|
|
5388
|
-
|
|
5534
|
+
const minUid = vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid();
|
|
5535
|
+
flushOnAppMount(() => {
|
|
5536
|
+
if (vnode == null) {
|
|
5537
|
+
if (container._vnode) {
|
|
5538
|
+
unmount(container._vnode, null, null, true);
|
|
5539
|
+
}
|
|
5540
|
+
} else {
|
|
5541
|
+
patch(
|
|
5542
|
+
container._vnode || null,
|
|
5543
|
+
vnode,
|
|
5544
|
+
container,
|
|
5545
|
+
null,
|
|
5546
|
+
null,
|
|
5547
|
+
null,
|
|
5548
|
+
namespace
|
|
5549
|
+
);
|
|
5389
5550
|
}
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
container._vnode || null,
|
|
5393
|
-
vnode,
|
|
5394
|
-
container,
|
|
5395
|
-
null,
|
|
5396
|
-
null,
|
|
5397
|
-
null,
|
|
5398
|
-
namespace
|
|
5399
|
-
);
|
|
5400
|
-
}
|
|
5401
|
-
container._vnode = vnode;
|
|
5402
|
-
if (!isFlushing) {
|
|
5403
|
-
isFlushing = true;
|
|
5404
|
-
flushPreFlushCbs(instance);
|
|
5405
|
-
flushPostFlushCbs();
|
|
5406
|
-
isFlushing = false;
|
|
5407
|
-
}
|
|
5551
|
+
container._vnode = vnode;
|
|
5552
|
+
}, minUid);
|
|
5408
5553
|
};
|
|
5409
5554
|
const internals = {
|
|
5410
5555
|
p: patch,
|
|
@@ -5513,13 +5658,13 @@ function getSequence(arr) {
|
|
|
5513
5658
|
}
|
|
5514
5659
|
return result;
|
|
5515
5660
|
}
|
|
5516
|
-
function
|
|
5661
|
+
function locateUnresolvedAsyncRoot(instance) {
|
|
5517
5662
|
const subComponent = instance.subTree.component;
|
|
5518
5663
|
if (subComponent) {
|
|
5519
5664
|
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
5520
5665
|
return subComponent;
|
|
5521
5666
|
} else {
|
|
5522
|
-
return
|
|
5667
|
+
return locateUnresolvedAsyncRoot(subComponent);
|
|
5523
5668
|
}
|
|
5524
5669
|
}
|
|
5525
5670
|
}
|
|
@@ -5537,11 +5682,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
|
5537
5682
|
if (instance) {
|
|
5538
5683
|
return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
5539
5684
|
}
|
|
5685
|
+
const suspense = anchorVnode.suspense;
|
|
5686
|
+
if (suspense && suspense.activeBranch) {
|
|
5687
|
+
return resolveAsyncComponentPlaceholder(suspense.activeBranch);
|
|
5688
|
+
}
|
|
5540
5689
|
return null;
|
|
5541
5690
|
}
|
|
5542
5691
|
|
|
5543
5692
|
const isSuspense = (type) => type.__isSuspense;
|
|
5544
5693
|
let suspenseId = 0;
|
|
5694
|
+
const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
|
|
5545
5695
|
const SuspenseImpl = {
|
|
5546
5696
|
name: "Suspense",
|
|
5547
5697
|
// In order to make Suspense tree-shakable, we need to avoid importing it
|
|
@@ -5563,11 +5713,22 @@ const SuspenseImpl = {
|
|
|
5563
5713
|
rendererInternals
|
|
5564
5714
|
);
|
|
5565
5715
|
} else {
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
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
|
+
}
|
|
5571
5732
|
}
|
|
5572
5733
|
patchSuspense(
|
|
5573
5734
|
n1,
|
|
@@ -5592,6 +5753,38 @@ function triggerEvent(vnode, name) {
|
|
|
5592
5753
|
eventListener();
|
|
5593
5754
|
}
|
|
5594
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
|
+
}
|
|
5595
5788
|
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
5596
5789
|
const {
|
|
5597
5790
|
p: patch,
|
|
@@ -5691,7 +5884,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5691
5884
|
unmount(pendingBranch, parentComponent, suspense);
|
|
5692
5885
|
}
|
|
5693
5886
|
suspense.deps = 0;
|
|
5694
|
-
suspense
|
|
5887
|
+
discardEffects(suspense);
|
|
5695
5888
|
suspense.hiddenContainer = createElement("div");
|
|
5696
5889
|
if (isInFallback) {
|
|
5697
5890
|
patch(
|
|
@@ -5769,11 +5962,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5769
5962
|
} else {
|
|
5770
5963
|
triggerEvent(n2, "onPending");
|
|
5771
5964
|
suspense.pendingBranch = newBranch;
|
|
5772
|
-
|
|
5773
|
-
suspense.pendingId = newBranch.component.suspenseId;
|
|
5774
|
-
} else {
|
|
5775
|
-
suspense.pendingId = suspenseId++;
|
|
5776
|
-
}
|
|
5965
|
+
suspense.pendingId = suspenseId++;
|
|
5777
5966
|
patch(
|
|
5778
5967
|
null,
|
|
5779
5968
|
newBranch,
|
|
@@ -5788,12 +5977,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
5788
5977
|
if (suspense.deps <= 0) {
|
|
5789
5978
|
suspense.resolve();
|
|
5790
5979
|
} else {
|
|
5791
|
-
const { timeout
|
|
5980
|
+
const { timeout } = suspense;
|
|
5792
5981
|
if (timeout > 0) {
|
|
5793
|
-
setTimeout(() => {
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
}
|
|
5982
|
+
suspense.timeoutTimer = setTimeout(() => {
|
|
5983
|
+
suspense.timeoutTimer = void 0;
|
|
5984
|
+
suspense.fallback(suspense.vnode.ssFallback);
|
|
5797
5985
|
}, timeout);
|
|
5798
5986
|
} else if (timeout === 0) {
|
|
5799
5987
|
suspense.fallback(newFallback);
|
|
@@ -5830,6 +6018,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5830
6018
|
deps: 0,
|
|
5831
6019
|
pendingId: suspenseId++,
|
|
5832
6020
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
6021
|
+
timeoutTimer: void 0,
|
|
5833
6022
|
activeBranch: null,
|
|
5834
6023
|
isFallbackMountPending: false,
|
|
5835
6024
|
pendingBranch: null,
|
|
@@ -5856,7 +6045,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5856
6045
|
let hasUpdatedAnchor = false;
|
|
5857
6046
|
if (delayEnter) {
|
|
5858
6047
|
activeBranch.transition.afterLeave = () => {
|
|
5859
|
-
if (pendingId === suspense.pendingId) {
|
|
6048
|
+
if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
|
|
6049
|
+
enterDeferred(pendingBranch);
|
|
5860
6050
|
move(
|
|
5861
6051
|
pendingBranch,
|
|
5862
6052
|
container2,
|
|
@@ -5871,7 +6061,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5871
6061
|
};
|
|
5872
6062
|
}
|
|
5873
6063
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
5874
|
-
if (parentNode(
|
|
6064
|
+
if (parentNode(
|
|
6065
|
+
activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
|
|
6066
|
+
) === container2) {
|
|
5875
6067
|
anchor = next(activeBranch);
|
|
5876
6068
|
hasUpdatedAnchor = true;
|
|
5877
6069
|
}
|
|
@@ -5881,13 +6073,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5881
6073
|
}
|
|
5882
6074
|
}
|
|
5883
6075
|
if (!delayEnter) {
|
|
6076
|
+
enterDeferred(pendingBranch);
|
|
5884
6077
|
move(pendingBranch, container2, anchor, 0);
|
|
5885
6078
|
}
|
|
5886
6079
|
}
|
|
6080
|
+
clearTimeout(suspense.timeoutTimer);
|
|
6081
|
+
suspense.timeoutTimer = void 0;
|
|
5887
6082
|
suspense.isFallbackMountPending = false;
|
|
5888
6083
|
setActiveBranch(suspense, pendingBranch);
|
|
5889
6084
|
suspense.pendingBranch = null;
|
|
5890
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;
|
|
5891
6096
|
let parent = suspense.parent;
|
|
5892
6097
|
let hasUnresolvedAncestor = false;
|
|
5893
6098
|
while (parent) {
|
|
@@ -5916,7 +6121,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5916
6121
|
triggerEvent(vnode2, "onResolve");
|
|
5917
6122
|
},
|
|
5918
6123
|
fallback(fallbackVNode) {
|
|
5919
|
-
if (!suspense.pendingBranch) {
|
|
6124
|
+
if (suspense.isUnmounted || !suspense.pendingBranch) {
|
|
5920
6125
|
return;
|
|
5921
6126
|
}
|
|
5922
6127
|
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
|
|
@@ -5924,7 +6129,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5924
6129
|
const anchor2 = next(activeBranch);
|
|
5925
6130
|
const mountFallback = () => {
|
|
5926
6131
|
suspense.isFallbackMountPending = false;
|
|
5927
|
-
if (!suspense.isInFallback) {
|
|
6132
|
+
if (suspense.isUnmounted || !suspense.isInFallback) {
|
|
5928
6133
|
return;
|
|
5929
6134
|
}
|
|
5930
6135
|
const latestFallback = suspense.vnode.ssFallback;
|
|
@@ -5967,25 +6172,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5967
6172
|
next() {
|
|
5968
6173
|
return suspense.activeBranch && next(suspense.activeBranch);
|
|
5969
6174
|
},
|
|
5970
|
-
|
|
6175
|
+
// `namespace` intentionally shadows the boundary's own: the dep must be
|
|
6176
|
+
// mounted with the namespace of the position it was rendered at, which can
|
|
6177
|
+
// differ from the boundary's (e.g. a component nested inside an <svg>).
|
|
6178
|
+
registerDep(instance, setupRenderEffect, optimized2, namespace2) {
|
|
5971
6179
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
5972
6180
|
if (isInPendingSuspense) {
|
|
5973
6181
|
suspense.deps++;
|
|
5974
6182
|
}
|
|
5975
6183
|
const hydratedEl = instance.vnode.el;
|
|
5976
|
-
|
|
5977
|
-
handleError(err, instance, 0);
|
|
5978
|
-
}).then((asyncSetupResult) => {
|
|
5979
|
-
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
|
|
5980
|
-
return;
|
|
5981
|
-
}
|
|
5982
|
-
unsetCurrentInstance();
|
|
5983
|
-
if (hydratedEl && !instance.scope.active) {
|
|
5984
|
-
if (isInPendingSuspense && --suspense.deps === 0) {
|
|
5985
|
-
suspense.resolve();
|
|
5986
|
-
}
|
|
5987
|
-
return;
|
|
5988
|
-
}
|
|
6184
|
+
const render = (asyncSetupResult) => {
|
|
5989
6185
|
instance.asyncResolved = true;
|
|
5990
6186
|
const { vnode: vnode2 } = instance;
|
|
5991
6187
|
handleSetupResult(instance, asyncSetupResult, false);
|
|
@@ -6004,7 +6200,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
6004
6200
|
// consider the comment placeholder case.
|
|
6005
6201
|
hydratedEl ? null : next(instance.subTree),
|
|
6006
6202
|
suspense,
|
|
6007
|
-
|
|
6203
|
+
namespace2,
|
|
6008
6204
|
optimized2
|
|
6009
6205
|
);
|
|
6010
6206
|
if (placeholder) {
|
|
@@ -6012,13 +6208,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
6012
6208
|
remove(placeholder);
|
|
6013
6209
|
}
|
|
6014
6210
|
updateHOCHostEl(instance, vnode2.el);
|
|
6015
|
-
|
|
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) {
|
|
6016
6244
|
suspense.resolve();
|
|
6017
6245
|
}
|
|
6018
6246
|
});
|
|
6019
6247
|
},
|
|
6020
6248
|
unmount(parentSuspense2, doRemove) {
|
|
6021
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
|
+
}
|
|
6022
6262
|
if (suspense.activeBranch) {
|
|
6023
6263
|
unmount(
|
|
6024
6264
|
suspense.activeBranch,
|
|
@@ -6028,12 +6268,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
6028
6268
|
);
|
|
6029
6269
|
}
|
|
6030
6270
|
if (suspense.pendingBranch) {
|
|
6031
|
-
unmount(
|
|
6032
|
-
|
|
6033
|
-
parentComponent,
|
|
6034
|
-
parentSuspense2,
|
|
6035
|
-
doRemove
|
|
6036
|
-
);
|
|
6271
|
+
unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
|
|
6272
|
+
discardEffects(suspense);
|
|
6037
6273
|
}
|
|
6038
6274
|
}
|
|
6039
6275
|
};
|
|
@@ -6100,6 +6336,16 @@ function normalizeSuspenseSlot(s) {
|
|
|
6100
6336
|
}
|
|
6101
6337
|
return s;
|
|
6102
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
|
+
}
|
|
6103
6349
|
function queueEffectWithSuspense(fn, suspense) {
|
|
6104
6350
|
if (suspense && suspense.pendingBranch) {
|
|
6105
6351
|
if (shared.isArray(fn)) {
|
|
@@ -6308,7 +6554,8 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
6308
6554
|
}
|
|
6309
6555
|
function guardReactiveProps(props) {
|
|
6310
6556
|
if (!props) return null;
|
|
6311
|
-
|
|
6557
|
+
if (reactivity.isProxy(props)) return shared.extend({}, props);
|
|
6558
|
+
return isInternalObject(props) ? shared.extend({}, props[rawAttrsKey] || props) : props;
|
|
6312
6559
|
}
|
|
6313
6560
|
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
6314
6561
|
const { props, ref, patchFlag, children, transition } = vnode;
|
|
@@ -6480,8 +6727,11 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
6480
6727
|
]);
|
|
6481
6728
|
}
|
|
6482
6729
|
|
|
6483
|
-
const emptyAppContext = createAppContext();
|
|
6730
|
+
const emptyAppContext = /* @__PURE__ */ createAppContext();
|
|
6484
6731
|
let uid = 0;
|
|
6732
|
+
function getNextUid() {
|
|
6733
|
+
return uid;
|
|
6734
|
+
}
|
|
6485
6735
|
function createComponentInstance(vnode, parent, suspense) {
|
|
6486
6736
|
const type = vnode.type;
|
|
6487
6737
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
@@ -6657,7 +6907,8 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6657
6907
|
setInSSRSetupState(false);
|
|
6658
6908
|
}
|
|
6659
6909
|
}).catch((e) => {
|
|
6660
|
-
handleError(e, instance, 0);
|
|
6910
|
+
handleError(e, instance, 0, void 0, true);
|
|
6911
|
+
instance.ssrRender = (_, push) => push("<!---->");
|
|
6661
6912
|
});
|
|
6662
6913
|
} else {
|
|
6663
6914
|
instance.asyncDep = setupResult;
|
|
@@ -6729,10 +6980,11 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
6729
6980
|
}
|
|
6730
6981
|
}
|
|
6731
6982
|
}
|
|
6983
|
+
const rawAttrsKey = /* @__PURE__ */ Symbol();
|
|
6732
6984
|
const attrsProxyHandlers = {
|
|
6733
6985
|
get(target, key) {
|
|
6734
6986
|
reactivity.track(target, "get", "");
|
|
6735
|
-
return target[key];
|
|
6987
|
+
return key === rawAttrsKey ? target : target[key];
|
|
6736
6988
|
}
|
|
6737
6989
|
};
|
|
6738
6990
|
function createSetupContext(instance) {
|
|
@@ -6836,7 +7088,7 @@ function isMemoSame(cached, memo) {
|
|
|
6836
7088
|
return true;
|
|
6837
7089
|
}
|
|
6838
7090
|
|
|
6839
|
-
const version = "3.5.
|
|
7091
|
+
const version = "3.5.45";
|
|
6840
7092
|
const warn$1 = shared.NOOP;
|
|
6841
7093
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6842
7094
|
const devtools = void 0;
|