@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,9 +1,9 @@
|
|
|
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
|
**/
|
|
6
|
-
import { pauseTracking, resetTracking, isRef, toRaw, traverse, watch as watch$1, shallowRef, readonly, isReactive, ref, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive, customRef, shallowReactive, trigger, ReactiveEffect, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1 } from '@vue/reactivity';
|
|
6
|
+
import { pauseTracking, resetTracking, isRef, toRaw, traverse, watch as watch$1, shallowRef, readonly, isReactive, ref, onScopeDispose, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive, customRef, shallowReactive, trigger, ReactiveEffect, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1 } from '@vue/reactivity';
|
|
7
7
|
export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
8
8
|
import { isString, isFunction, EMPTY_OBJ, isPromise, isArray, NOOP, getGlobalThis, extend, isBuiltInDirective, NO, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, normalizeCssVarValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, camelize, capitalize, isSymbol, isGloballyAllowed, hyphenate, hasChanged, looseToNumber, isModelListener, looseEqual, EMPTY_ARR, toRawType, makeMap, toNumber } from '@vue/shared';
|
|
9
9
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
@@ -206,7 +206,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
206
206
|
const res = callWithErrorHandling(fn, instance, type, args);
|
|
207
207
|
if (res && isPromise(res)) {
|
|
208
208
|
res.catch((err) => {
|
|
209
|
-
handleError(err, instance, type);
|
|
209
|
+
handleError(err, instance, type, void 0, true);
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
212
|
return res;
|
|
@@ -223,7 +223,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
-
function handleError(err, instance, type, throwInDev = true) {
|
|
226
|
+
function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
|
|
227
227
|
const contextVNode = instance ? instance.vnode : null;
|
|
228
228
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
|
|
229
229
|
if (instance) {
|
|
@@ -232,7 +232,9 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
232
232
|
const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;
|
|
233
233
|
while (cur) {
|
|
234
234
|
const errorCapturedHooks = cur.ec;
|
|
235
|
-
if (errorCapturedHooks
|
|
235
|
+
if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
|
|
236
|
+
// are deferred or discarded by Suspense.
|
|
237
|
+
(!isAsyncError || cur.scope.active)) {
|
|
236
238
|
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
237
239
|
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
238
240
|
return;
|
|
@@ -564,14 +566,32 @@ function reload(id, newComp) {
|
|
|
564
566
|
instance.ceReload(newComp.styles);
|
|
565
567
|
dirtyInstances.delete(instance);
|
|
566
568
|
} else if (instance.parent) {
|
|
567
|
-
|
|
568
|
-
if (!
|
|
569
|
-
|
|
569
|
+
const update = () => {
|
|
570
|
+
if (!instance.scope.active) return;
|
|
571
|
+
const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
|
|
572
|
+
if (pending) {
|
|
573
|
+
pending.asyncDep.catch(NOOP).then(() => {
|
|
574
|
+
if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
|
|
575
|
+
queueJob(update);
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
581
|
+
if (!dirtyInstances) {
|
|
582
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
583
|
+
}
|
|
584
|
+
dirtyInstances.add(instance);
|
|
585
|
+
isHmrUpdating = true;
|
|
586
|
+
try {
|
|
570
587
|
instance.parent.update();
|
|
588
|
+
} finally {
|
|
571
589
|
isHmrUpdating = false;
|
|
572
590
|
dirtyInstances.delete(instance);
|
|
591
|
+
queuePostFlushCb(() => hmrDirtyComponents.clear());
|
|
573
592
|
}
|
|
574
|
-
}
|
|
593
|
+
};
|
|
594
|
+
queueJob(update);
|
|
575
595
|
} else if (instance.appContext.reload) {
|
|
576
596
|
instance.appContext.reload();
|
|
577
597
|
} else if (typeof window !== "undefined") {
|
|
@@ -787,12 +807,31 @@ function withDirectives(vnode, directives) {
|
|
|
787
807
|
return vnode;
|
|
788
808
|
}
|
|
789
809
|
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
790
|
-
|
|
810
|
+
let hookVNode = vnode;
|
|
811
|
+
if (name === "beforeMount") {
|
|
812
|
+
vnode._mount = vnode;
|
|
813
|
+
} else if (name === "beforeUpdate") {
|
|
814
|
+
const mount = prevVNode && prevVNode._mount;
|
|
815
|
+
if (mount) {
|
|
816
|
+
mount._latest = vnode;
|
|
817
|
+
vnode._mount = mount;
|
|
818
|
+
}
|
|
819
|
+
} else if (name === "mounted") {
|
|
820
|
+
const latest = vnode._latest;
|
|
821
|
+
vnode._mount = vnode._latest = void 0;
|
|
822
|
+
if (latest) {
|
|
823
|
+
hookVNode = latest;
|
|
824
|
+
latest._mount = void 0;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
const bindings = hookVNode.dirs;
|
|
791
828
|
const oldBindings = prevVNode && prevVNode.dirs;
|
|
792
829
|
for (let i = 0; i < bindings.length; i++) {
|
|
793
|
-
|
|
830
|
+
let binding = bindings[i];
|
|
794
831
|
if (oldBindings) {
|
|
795
832
|
binding.oldValue = oldBindings[i].value;
|
|
833
|
+
} else if (name === "mounted" && binding.oldValue !== void 0) {
|
|
834
|
+
binding = extend({}, binding, { oldValue: void 0 });
|
|
796
835
|
}
|
|
797
836
|
let hook = binding.dir[name];
|
|
798
837
|
if (hook) {
|
|
@@ -800,7 +839,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
800
839
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
801
840
|
vnode.el,
|
|
802
841
|
binding,
|
|
803
|
-
|
|
842
|
+
hookVNode,
|
|
804
843
|
prevVNode
|
|
805
844
|
]);
|
|
806
845
|
resetTracking();
|
|
@@ -1424,13 +1463,11 @@ const BaseTransitionImpl = {
|
|
|
1424
1463
|
if (!innerChild) {
|
|
1425
1464
|
return emptyPlaceholder(child);
|
|
1426
1465
|
}
|
|
1427
|
-
|
|
1466
|
+
const enterHooks = resolveTransitionHooks(
|
|
1428
1467
|
innerChild,
|
|
1429
1468
|
rawProps,
|
|
1430
1469
|
state,
|
|
1431
|
-
instance
|
|
1432
|
-
// #11061, ensure enterHooks is fresh after clone
|
|
1433
|
-
(hooks) => enterHooks = hooks
|
|
1470
|
+
instance
|
|
1434
1471
|
);
|
|
1435
1472
|
if (innerChild.type !== Comment) {
|
|
1436
1473
|
setTransitionHooks(innerChild, enterHooks);
|
|
@@ -1449,7 +1486,17 @@ const BaseTransitionImpl = {
|
|
|
1449
1486
|
leavingHooks.afterLeave = () => {
|
|
1450
1487
|
state.isLeaving = false;
|
|
1451
1488
|
if (!(instance.job.flags & 8)) {
|
|
1452
|
-
instance.
|
|
1489
|
+
if (instance.effect.flags & 2) {
|
|
1490
|
+
const job = () => {
|
|
1491
|
+
if (!(instance.job.flags & 8)) {
|
|
1492
|
+
instance.update();
|
|
1493
|
+
}
|
|
1494
|
+
};
|
|
1495
|
+
job.i = instance;
|
|
1496
|
+
queueJob(job);
|
|
1497
|
+
} else {
|
|
1498
|
+
instance.update();
|
|
1499
|
+
}
|
|
1453
1500
|
}
|
|
1454
1501
|
delete leavingHooks.afterLeave;
|
|
1455
1502
|
oldInnerChild = void 0;
|
|
@@ -1514,7 +1561,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
1514
1561
|
}
|
|
1515
1562
|
return leavingVNodesCache;
|
|
1516
1563
|
}
|
|
1517
|
-
function resolveTransitionHooks(vnode, props, state, instance
|
|
1564
|
+
function resolveTransitionHooks(vnode, props, state, instance) {
|
|
1518
1565
|
const {
|
|
1519
1566
|
appear,
|
|
1520
1567
|
mode,
|
|
@@ -1653,15 +1700,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1653
1700
|
}
|
|
1654
1701
|
},
|
|
1655
1702
|
clone(vnode2) {
|
|
1656
|
-
const
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1703
|
+
const cloned = resolveTransitionHooks(vnode2, props, state, instance);
|
|
1704
|
+
cloned.afterLeave = () => {
|
|
1705
|
+
if (hooks.afterLeave) hooks.afterLeave();
|
|
1706
|
+
};
|
|
1707
|
+
cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
1708
|
+
if (hooks.delayLeave) {
|
|
1709
|
+
hooks.delayLeave(el, earlyRemove, delayedLeave);
|
|
1710
|
+
} else {
|
|
1711
|
+
delayedLeave();
|
|
1712
|
+
}
|
|
1713
|
+
};
|
|
1714
|
+
cloned.delayedLeave = () => {
|
|
1715
|
+
if (hooks.delayedLeave) hooks.delayedLeave();
|
|
1716
|
+
};
|
|
1717
|
+
return cloned;
|
|
1665
1718
|
}
|
|
1666
1719
|
};
|
|
1667
1720
|
return hooks;
|
|
@@ -1702,8 +1755,16 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
1702
1755
|
hooks
|
|
1703
1756
|
);
|
|
1704
1757
|
} else if (vnode.shapeFlag & 128) {
|
|
1705
|
-
|
|
1706
|
-
|
|
1758
|
+
const suspense = vnode.suspense;
|
|
1759
|
+
if (suspense) {
|
|
1760
|
+
const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
|
|
1761
|
+
if (branch) {
|
|
1762
|
+
setTransitionHooks(branch, hooks.clone(branch));
|
|
1763
|
+
}
|
|
1764
|
+
} else {
|
|
1765
|
+
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1766
|
+
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1767
|
+
}
|
|
1707
1768
|
} else {
|
|
1708
1769
|
vnode.transition = hooks;
|
|
1709
1770
|
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
@@ -2416,7 +2477,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
2416
2477
|
getContainerType(container),
|
|
2417
2478
|
slotScopeIds
|
|
2418
2479
|
);
|
|
2419
|
-
if (parentComponent) {
|
|
2480
|
+
if (parentComponent && parentComponent.vnode.el === node) {
|
|
2420
2481
|
parentComponent.vnode.el = vnode.el;
|
|
2421
2482
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
2422
2483
|
}
|
|
@@ -2850,7 +2911,8 @@ function defineAsyncComponent(source) {
|
|
|
2850
2911
|
err,
|
|
2851
2912
|
instance,
|
|
2852
2913
|
13,
|
|
2853
|
-
!errorComponent
|
|
2914
|
+
!errorComponent,
|
|
2915
|
+
true
|
|
2854
2916
|
);
|
|
2855
2917
|
};
|
|
2856
2918
|
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
@@ -2868,7 +2930,7 @@ function defineAsyncComponent(source) {
|
|
|
2868
2930
|
const delayed = ref(!!delay);
|
|
2869
2931
|
let timeoutTimer;
|
|
2870
2932
|
let delayTimer;
|
|
2871
|
-
|
|
2933
|
+
onScopeDispose(() => {
|
|
2872
2934
|
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
2873
2935
|
if (delayTimer != null) clearTimeout(delayTimer);
|
|
2874
2936
|
});
|
|
@@ -2996,6 +3058,12 @@ const KeepAliveImpl = {
|
|
|
2996
3058
|
}
|
|
2997
3059
|
};
|
|
2998
3060
|
sharedContext.deactivate = (vnode) => {
|
|
3061
|
+
const cached = cache.get(
|
|
3062
|
+
vnode.key == null ? vnode.type : vnode.key
|
|
3063
|
+
);
|
|
3064
|
+
if (!cached || cached.component !== vnode.component) {
|
|
3065
|
+
return false;
|
|
3066
|
+
}
|
|
2999
3067
|
const instance2 = vnode.component;
|
|
3000
3068
|
invalidateMount(instance2.m);
|
|
3001
3069
|
invalidateMount(instance2.a);
|
|
@@ -3016,6 +3084,7 @@ const KeepAliveImpl = {
|
|
|
3016
3084
|
if (!!(process.env.NODE_ENV !== "production") && true) {
|
|
3017
3085
|
instance2.__keepAliveStorageContainer = storageContainer;
|
|
3018
3086
|
}
|
|
3087
|
+
return true;
|
|
3019
3088
|
};
|
|
3020
3089
|
function unmount(vnode) {
|
|
3021
3090
|
resetShapeFlag(vnode);
|
|
@@ -3055,12 +3124,17 @@ const KeepAliveImpl = {
|
|
|
3055
3124
|
const cacheSubtree = () => {
|
|
3056
3125
|
if (pendingCacheKey != null) {
|
|
3057
3126
|
if (isSuspense(instance.subTree.type)) {
|
|
3058
|
-
|
|
3127
|
+
const cacheInnerChild = () => {
|
|
3059
3128
|
const vnode = getInnerChild(instance.subTree);
|
|
3060
3129
|
if (vnode.component) {
|
|
3061
3130
|
cache.set(pendingCacheKey, vnode);
|
|
3062
3131
|
}
|
|
3063
|
-
}
|
|
3132
|
+
};
|
|
3133
|
+
if (instance.subTree.suspense.pendingBranch) {
|
|
3134
|
+
queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
|
|
3135
|
+
} else {
|
|
3136
|
+
cacheInnerChild();
|
|
3137
|
+
}
|
|
3064
3138
|
} else {
|
|
3065
3139
|
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
3066
3140
|
}
|
|
@@ -3191,9 +3265,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
3191
3265
|
true
|
|
3192
3266
|
/* prepend */
|
|
3193
3267
|
);
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3268
|
+
const removal = injectHook(
|
|
3269
|
+
"um",
|
|
3270
|
+
() => remove(keepAliveRoot[type], injected),
|
|
3271
|
+
target
|
|
3272
|
+
);
|
|
3273
|
+
removal.flags = 16;
|
|
3197
3274
|
}
|
|
3198
3275
|
function resetShapeFlag(vnode) {
|
|
3199
3276
|
vnode.shapeFlag &= -257;
|
|
@@ -5882,6 +5959,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5882
5959
|
const needCallTransitionHooks = needTransition(parentSuspense, transition);
|
|
5883
5960
|
if (needCallTransitionHooks) {
|
|
5884
5961
|
transition.beforeEnter(el);
|
|
5962
|
+
} else if (transition && !transition.persisted) {
|
|
5963
|
+
el[deferredEnterKey] = true;
|
|
5885
5964
|
}
|
|
5886
5965
|
hostInsert(el, container, anchor);
|
|
5887
5966
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
@@ -6375,16 +6454,23 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6375
6454
|
} else {
|
|
6376
6455
|
let { next, bu, u, parent, vnode } = instance;
|
|
6377
6456
|
{
|
|
6378
|
-
const
|
|
6379
|
-
if (
|
|
6457
|
+
const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
|
|
6458
|
+
if (unresolvedAsyncRoot) {
|
|
6380
6459
|
if (next) {
|
|
6381
6460
|
next.el = vnode.el;
|
|
6382
6461
|
updateComponentPreRender(instance, next, optimized);
|
|
6383
6462
|
}
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
if (
|
|
6387
|
-
|
|
6463
|
+
unresolvedAsyncRoot.asyncDep.then(() => {
|
|
6464
|
+
const retry = () => {
|
|
6465
|
+
if (instance.job.flags & 8) return;
|
|
6466
|
+
if (parentSuspense && parentSuspense.pendingBranch) {
|
|
6467
|
+
queuePostRenderEffect(retry, parentSuspense);
|
|
6468
|
+
} else {
|
|
6469
|
+
update();
|
|
6470
|
+
}
|
|
6471
|
+
};
|
|
6472
|
+
retry.flags = 16 | 32;
|
|
6473
|
+
queuePostRenderEffect(retry, parentSuspense);
|
|
6388
6474
|
});
|
|
6389
6475
|
return;
|
|
6390
6476
|
}
|
|
@@ -6423,8 +6509,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6423
6509
|
patch(
|
|
6424
6510
|
prevTree,
|
|
6425
6511
|
nextTree,
|
|
6426
|
-
// parent may have changed if it's in a teleport
|
|
6427
|
-
|
|
6512
|
+
// parent may have changed if it's in a teleport. a root that is a
|
|
6513
|
+
// pending async component only has its placeholder comment
|
|
6514
|
+
hostParentNode(
|
|
6515
|
+
prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
|
|
6516
|
+
),
|
|
6428
6517
|
// anchor may have changed if it's in a fragment
|
|
6429
6518
|
getNextHostNode(prevTree),
|
|
6430
6519
|
instance,
|
|
@@ -6864,8 +6953,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6864
6953
|
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
|
|
6865
6954
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
6866
6955
|
}
|
|
6867
|
-
if (shapeFlag & 256) {
|
|
6868
|
-
parentComponent.ctx.deactivate(vnode);
|
|
6956
|
+
if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
|
|
6869
6957
|
return;
|
|
6870
6958
|
}
|
|
6871
6959
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
@@ -6987,16 +7075,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6987
7075
|
if (job) {
|
|
6988
7076
|
job.flags |= 8;
|
|
6989
7077
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
6990
|
-
} else if (
|
|
7078
|
+
} else if (subTree) {
|
|
6991
7079
|
subTree.transition = instance.vnode.transition;
|
|
6992
7080
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
6993
7081
|
}
|
|
6994
7082
|
if (um) {
|
|
6995
7083
|
queuePostRenderEffect(um, parentSuspense);
|
|
6996
7084
|
}
|
|
6997
|
-
|
|
7085
|
+
const markUnmounted = () => {
|
|
6998
7086
|
instance.isUnmounted = true;
|
|
6999
|
-
}
|
|
7087
|
+
};
|
|
7088
|
+
markUnmounted.flags = 16;
|
|
7089
|
+
queuePostRenderEffect(markUnmounted, parentSuspense);
|
|
7000
7090
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
7001
7091
|
devtoolsComponentRemoved(instance);
|
|
7002
7092
|
}
|
|
@@ -7148,13 +7238,13 @@ function getSequence(arr) {
|
|
|
7148
7238
|
}
|
|
7149
7239
|
return result;
|
|
7150
7240
|
}
|
|
7151
|
-
function
|
|
7241
|
+
function locateUnresolvedAsyncRoot(instance) {
|
|
7152
7242
|
const subComponent = instance.subTree.component;
|
|
7153
7243
|
if (subComponent) {
|
|
7154
7244
|
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
7155
7245
|
return subComponent;
|
|
7156
7246
|
} else {
|
|
7157
|
-
return
|
|
7247
|
+
return locateUnresolvedAsyncRoot(subComponent);
|
|
7158
7248
|
}
|
|
7159
7249
|
}
|
|
7160
7250
|
}
|
|
@@ -7172,11 +7262,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
|
7172
7262
|
if (instance) {
|
|
7173
7263
|
return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
7174
7264
|
}
|
|
7265
|
+
const suspense = anchorVnode.suspense;
|
|
7266
|
+
if (suspense && suspense.activeBranch) {
|
|
7267
|
+
return resolveAsyncComponentPlaceholder(suspense.activeBranch);
|
|
7268
|
+
}
|
|
7175
7269
|
return null;
|
|
7176
7270
|
}
|
|
7177
7271
|
|
|
7178
7272
|
const isSuspense = (type) => type.__isSuspense;
|
|
7179
7273
|
let suspenseId = 0;
|
|
7274
|
+
const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
|
|
7180
7275
|
const SuspenseImpl = {
|
|
7181
7276
|
name: "Suspense",
|
|
7182
7277
|
// In order to make Suspense tree-shakable, we need to avoid importing it
|
|
@@ -7198,11 +7293,22 @@ const SuspenseImpl = {
|
|
|
7198
7293
|
rendererInternals
|
|
7199
7294
|
);
|
|
7200
7295
|
} else {
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7296
|
+
const suspense = n1.suspense;
|
|
7297
|
+
if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
|
|
7298
|
+
const owner = suspense.parentComponent;
|
|
7299
|
+
const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
|
|
7300
|
+
if (retained ? (
|
|
7301
|
+
// deps can outlive the pending branch: skip only while it exists
|
|
7302
|
+
parentSuspense.pendingBranch && !isSameVNodeType(
|
|
7303
|
+
n2.ssContent,
|
|
7304
|
+
suspense.pendingBranch || suspense.activeBranch
|
|
7305
|
+
)
|
|
7306
|
+
) : !suspense.isInFallback) {
|
|
7307
|
+
n2.suspense = suspense;
|
|
7308
|
+
suspense.vnode = n2;
|
|
7309
|
+
n2.el = n1.el;
|
|
7310
|
+
return;
|
|
7311
|
+
}
|
|
7206
7312
|
}
|
|
7207
7313
|
patchSuspense(
|
|
7208
7314
|
n1,
|
|
@@ -7227,6 +7333,38 @@ function triggerEvent(vnode, name) {
|
|
|
7227
7333
|
eventListener();
|
|
7228
7334
|
}
|
|
7229
7335
|
}
|
|
7336
|
+
function enterDeferred(branch) {
|
|
7337
|
+
const enters = [];
|
|
7338
|
+
collectDeferredEnters(branch, enters, true);
|
|
7339
|
+
if (enters.length) {
|
|
7340
|
+
queuePostFlushCb(enters);
|
|
7341
|
+
}
|
|
7342
|
+
}
|
|
7343
|
+
function collectDeferredEnters(vnode, enters, isRoot) {
|
|
7344
|
+
const { el, transition, children, shapeFlag } = vnode;
|
|
7345
|
+
if (shapeFlag & 6) {
|
|
7346
|
+
collectDeferredEnters(vnode.component.subTree, enters, isRoot);
|
|
7347
|
+
return;
|
|
7348
|
+
}
|
|
7349
|
+
if (shapeFlag & (128 | 64)) {
|
|
7350
|
+
return;
|
|
7351
|
+
}
|
|
7352
|
+
if (shapeFlag & 1) {
|
|
7353
|
+
if (!isRoot && el && el[deferredEnterKey]) {
|
|
7354
|
+
el[deferredEnterKey] = void 0;
|
|
7355
|
+
if (transition && !transition.persisted) {
|
|
7356
|
+
transition.beforeEnter(el);
|
|
7357
|
+
enters.push(() => transition.enter(el));
|
|
7358
|
+
}
|
|
7359
|
+
}
|
|
7360
|
+
isRoot = false;
|
|
7361
|
+
}
|
|
7362
|
+
if (shapeFlag & 16) {
|
|
7363
|
+
for (let i = 0; i < children.length; i++) {
|
|
7364
|
+
collectDeferredEnters(children[i], enters, isRoot);
|
|
7365
|
+
}
|
|
7366
|
+
}
|
|
7367
|
+
}
|
|
7230
7368
|
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
7231
7369
|
const {
|
|
7232
7370
|
p: patch,
|
|
@@ -7326,7 +7464,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7326
7464
|
unmount(pendingBranch, parentComponent, suspense);
|
|
7327
7465
|
}
|
|
7328
7466
|
suspense.deps = 0;
|
|
7329
|
-
suspense
|
|
7467
|
+
discardEffects(suspense);
|
|
7330
7468
|
suspense.hiddenContainer = createElement("div");
|
|
7331
7469
|
if (isInFallback) {
|
|
7332
7470
|
patch(
|
|
@@ -7404,11 +7542,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7404
7542
|
} else {
|
|
7405
7543
|
triggerEvent(n2, "onPending");
|
|
7406
7544
|
suspense.pendingBranch = newBranch;
|
|
7407
|
-
|
|
7408
|
-
suspense.pendingId = newBranch.component.suspenseId;
|
|
7409
|
-
} else {
|
|
7410
|
-
suspense.pendingId = suspenseId++;
|
|
7411
|
-
}
|
|
7545
|
+
suspense.pendingId = suspenseId++;
|
|
7412
7546
|
patch(
|
|
7413
7547
|
null,
|
|
7414
7548
|
newBranch,
|
|
@@ -7423,12 +7557,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
7423
7557
|
if (suspense.deps <= 0) {
|
|
7424
7558
|
suspense.resolve();
|
|
7425
7559
|
} else {
|
|
7426
|
-
const { timeout
|
|
7560
|
+
const { timeout } = suspense;
|
|
7427
7561
|
if (timeout > 0) {
|
|
7428
|
-
setTimeout(() => {
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
}
|
|
7562
|
+
suspense.timeoutTimer = setTimeout(() => {
|
|
7563
|
+
suspense.timeoutTimer = void 0;
|
|
7564
|
+
suspense.fallback(suspense.vnode.ssFallback);
|
|
7432
7565
|
}, timeout);
|
|
7433
7566
|
} else if (timeout === 0) {
|
|
7434
7567
|
suspense.fallback(newFallback);
|
|
@@ -7475,6 +7608,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7475
7608
|
deps: 0,
|
|
7476
7609
|
pendingId: suspenseId++,
|
|
7477
7610
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
7611
|
+
timeoutTimer: void 0,
|
|
7478
7612
|
activeBranch: null,
|
|
7479
7613
|
isFallbackMountPending: false,
|
|
7480
7614
|
pendingBranch: null,
|
|
@@ -7513,7 +7647,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7513
7647
|
let hasUpdatedAnchor = false;
|
|
7514
7648
|
if (delayEnter) {
|
|
7515
7649
|
activeBranch.transition.afterLeave = () => {
|
|
7516
|
-
if (pendingId === suspense.pendingId) {
|
|
7650
|
+
if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
|
|
7651
|
+
enterDeferred(pendingBranch);
|
|
7517
7652
|
move(
|
|
7518
7653
|
pendingBranch,
|
|
7519
7654
|
container2,
|
|
@@ -7528,7 +7663,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7528
7663
|
};
|
|
7529
7664
|
}
|
|
7530
7665
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
7531
|
-
if (parentNode(
|
|
7666
|
+
if (parentNode(
|
|
7667
|
+
activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
|
|
7668
|
+
) === container2) {
|
|
7532
7669
|
anchor = next(activeBranch);
|
|
7533
7670
|
hasUpdatedAnchor = true;
|
|
7534
7671
|
}
|
|
@@ -7538,13 +7675,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7538
7675
|
}
|
|
7539
7676
|
}
|
|
7540
7677
|
if (!delayEnter) {
|
|
7678
|
+
enterDeferred(pendingBranch);
|
|
7541
7679
|
move(pendingBranch, container2, anchor, 0);
|
|
7542
7680
|
}
|
|
7543
7681
|
}
|
|
7682
|
+
clearTimeout(suspense.timeoutTimer);
|
|
7683
|
+
suspense.timeoutTimer = void 0;
|
|
7544
7684
|
suspense.isFallbackMountPending = false;
|
|
7545
7685
|
setActiveBranch(suspense, pendingBranch);
|
|
7546
7686
|
suspense.pendingBranch = null;
|
|
7547
7687
|
suspense.isInFallback = false;
|
|
7688
|
+
let kept = 0;
|
|
7689
|
+
for (let i = 0; i < effects.length; i++) {
|
|
7690
|
+
const effect = effects[i];
|
|
7691
|
+
if (effect.flags & 32) {
|
|
7692
|
+
queuePostFlushCb(effect);
|
|
7693
|
+
} else {
|
|
7694
|
+
effects[kept++] = effect;
|
|
7695
|
+
}
|
|
7696
|
+
}
|
|
7697
|
+
effects.length = kept;
|
|
7548
7698
|
let parent = suspense.parent;
|
|
7549
7699
|
let hasUnresolvedAncestor = false;
|
|
7550
7700
|
while (parent) {
|
|
@@ -7573,7 +7723,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7573
7723
|
triggerEvent(vnode2, "onResolve");
|
|
7574
7724
|
},
|
|
7575
7725
|
fallback(fallbackVNode) {
|
|
7576
|
-
if (!suspense.pendingBranch) {
|
|
7726
|
+
if (suspense.isUnmounted || !suspense.pendingBranch) {
|
|
7577
7727
|
return;
|
|
7578
7728
|
}
|
|
7579
7729
|
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
|
|
@@ -7581,7 +7731,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7581
7731
|
const anchor2 = next(activeBranch);
|
|
7582
7732
|
const mountFallback = () => {
|
|
7583
7733
|
suspense.isFallbackMountPending = false;
|
|
7584
|
-
if (!suspense.isInFallback) {
|
|
7734
|
+
if (suspense.isUnmounted || !suspense.isInFallback) {
|
|
7585
7735
|
return;
|
|
7586
7736
|
}
|
|
7587
7737
|
const latestFallback = suspense.vnode.ssFallback;
|
|
@@ -7633,19 +7783,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7633
7783
|
suspense.deps++;
|
|
7634
7784
|
}
|
|
7635
7785
|
const hydratedEl = instance.vnode.el;
|
|
7636
|
-
|
|
7637
|
-
handleError(err, instance, 0);
|
|
7638
|
-
}).then((asyncSetupResult) => {
|
|
7639
|
-
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
|
|
7640
|
-
return;
|
|
7641
|
-
}
|
|
7642
|
-
unsetCurrentInstance();
|
|
7643
|
-
if (!instance.scope.active) {
|
|
7644
|
-
if (isInPendingSuspense && --suspense.deps === 0) {
|
|
7645
|
-
suspense.resolve();
|
|
7646
|
-
}
|
|
7647
|
-
return;
|
|
7648
|
-
}
|
|
7786
|
+
const render = (asyncSetupResult) => {
|
|
7649
7787
|
instance.asyncResolved = true;
|
|
7650
7788
|
const { vnode: vnode2 } = instance;
|
|
7651
7789
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
@@ -7678,13 +7816,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7678
7816
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
7679
7817
|
popWarningContext();
|
|
7680
7818
|
}
|
|
7681
|
-
|
|
7819
|
+
};
|
|
7820
|
+
instance.asyncDep.catch((err) => {
|
|
7821
|
+
handleError(err, instance, 0, false, true);
|
|
7822
|
+
return () => null;
|
|
7823
|
+
}).then((asyncSetupResult) => {
|
|
7824
|
+
if (instance.isUnmounted || suspense.isUnmounted) {
|
|
7825
|
+
return;
|
|
7826
|
+
}
|
|
7827
|
+
const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
|
|
7828
|
+
unsetCurrentInstance();
|
|
7829
|
+
if (!instance.scope.active) {
|
|
7830
|
+
if (isPendingDep && --suspense.deps === 0) {
|
|
7831
|
+
suspense.resolve();
|
|
7832
|
+
}
|
|
7833
|
+
return;
|
|
7834
|
+
}
|
|
7835
|
+
if (!isPendingDep && suspense.pendingBranch) {
|
|
7836
|
+
const job = () => {
|
|
7837
|
+
if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
|
|
7838
|
+
return;
|
|
7839
|
+
}
|
|
7840
|
+
if (suspense.pendingBranch) {
|
|
7841
|
+
queueEffectWithSuspense(job, suspense);
|
|
7842
|
+
} else {
|
|
7843
|
+
render(asyncSetupResult);
|
|
7844
|
+
}
|
|
7845
|
+
};
|
|
7846
|
+
job.flags = 16 | 32;
|
|
7847
|
+
queueEffectWithSuspense(job, suspense);
|
|
7848
|
+
return;
|
|
7849
|
+
}
|
|
7850
|
+
render(asyncSetupResult);
|
|
7851
|
+
if (isPendingDep && --suspense.deps === 0) {
|
|
7682
7852
|
suspense.resolve();
|
|
7683
7853
|
}
|
|
7684
7854
|
});
|
|
7685
7855
|
},
|
|
7686
7856
|
unmount(parentSuspense2, doRemove) {
|
|
7687
7857
|
suspense.isUnmounted = true;
|
|
7858
|
+
clearTimeout(suspense.timeoutTimer);
|
|
7859
|
+
suspense.timeoutTimer = void 0;
|
|
7860
|
+
if (parentSuspenseId !== void 0) {
|
|
7861
|
+
const parent = suspense.parent;
|
|
7862
|
+
const pendingId = parentSuspenseId;
|
|
7863
|
+
parentSuspenseId = void 0;
|
|
7864
|
+
queuePostFlushCb(() => {
|
|
7865
|
+
if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
|
|
7866
|
+
parent.resolve();
|
|
7867
|
+
}
|
|
7868
|
+
});
|
|
7869
|
+
}
|
|
7688
7870
|
if (suspense.activeBranch) {
|
|
7689
7871
|
unmount(
|
|
7690
7872
|
suspense.activeBranch,
|
|
@@ -7694,12 +7876,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7694
7876
|
);
|
|
7695
7877
|
}
|
|
7696
7878
|
if (suspense.pendingBranch) {
|
|
7697
|
-
unmount(
|
|
7698
|
-
|
|
7699
|
-
parentComponent,
|
|
7700
|
-
parentSuspense2,
|
|
7701
|
-
doRemove
|
|
7702
|
-
);
|
|
7879
|
+
unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
|
|
7880
|
+
discardEffects(suspense);
|
|
7703
7881
|
}
|
|
7704
7882
|
}
|
|
7705
7883
|
};
|
|
@@ -7769,6 +7947,16 @@ function normalizeSuspenseSlot(s) {
|
|
|
7769
7947
|
}
|
|
7770
7948
|
return s;
|
|
7771
7949
|
}
|
|
7950
|
+
function discardEffects(suspense) {
|
|
7951
|
+
const { effects } = suspense;
|
|
7952
|
+
for (let i = 0; i < effects.length; i++) {
|
|
7953
|
+
const effect = effects[i];
|
|
7954
|
+
if (effect.flags & 16) {
|
|
7955
|
+
queuePostFlushCb(effect);
|
|
7956
|
+
}
|
|
7957
|
+
}
|
|
7958
|
+
effects.length = 0;
|
|
7959
|
+
}
|
|
7772
7960
|
function queueEffectWithSuspense(fn, suspense) {
|
|
7773
7961
|
if (suspense && suspense.pendingBranch) {
|
|
7774
7962
|
if (isArray(fn)) {
|
|
@@ -8020,7 +8208,8 @@ Component that was made reactive: `,
|
|
|
8020
8208
|
}
|
|
8021
8209
|
function guardReactiveProps(props) {
|
|
8022
8210
|
if (!props) return null;
|
|
8023
|
-
|
|
8211
|
+
if (isProxy(props)) return extend({}, props);
|
|
8212
|
+
return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
|
|
8024
8213
|
}
|
|
8025
8214
|
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
8026
8215
|
const { props, ref, patchFlag, children, transition } = vnode;
|
|
@@ -8199,7 +8388,7 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
8199
8388
|
]);
|
|
8200
8389
|
}
|
|
8201
8390
|
|
|
8202
|
-
const emptyAppContext = createAppContext();
|
|
8391
|
+
const emptyAppContext = /* @__PURE__ */ createAppContext();
|
|
8203
8392
|
let uid = 0;
|
|
8204
8393
|
function getNextUid() {
|
|
8205
8394
|
return uid;
|
|
@@ -8414,7 +8603,8 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
8414
8603
|
setInSSRSetupState(false);
|
|
8415
8604
|
}
|
|
8416
8605
|
}).catch((e) => {
|
|
8417
|
-
handleError(e, instance, 0);
|
|
8606
|
+
handleError(e, instance, 0, void 0, true);
|
|
8607
|
+
instance.ssrRender = (_, push) => push("<!---->");
|
|
8418
8608
|
});
|
|
8419
8609
|
} else {
|
|
8420
8610
|
instance.asyncDep = setupResult;
|
|
@@ -8522,11 +8712,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
8522
8712
|
}
|
|
8523
8713
|
}
|
|
8524
8714
|
}
|
|
8715
|
+
const rawAttrsKey = /* @__PURE__ */ Symbol();
|
|
8525
8716
|
const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
|
|
8526
8717
|
get(target, key) {
|
|
8527
8718
|
markAttrsAccessed();
|
|
8528
8719
|
track(target, "get", "");
|
|
8529
|
-
return target[key];
|
|
8720
|
+
return key === rawAttrsKey ? target : target[key];
|
|
8530
8721
|
},
|
|
8531
8722
|
set() {
|
|
8532
8723
|
warn$1(`setupContext.attrs is readonly.`);
|
|
@@ -8539,7 +8730,7 @@ const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
|
|
|
8539
8730
|
} : {
|
|
8540
8731
|
get(target, key) {
|
|
8541
8732
|
track(target, "get", "");
|
|
8542
|
-
return target[key];
|
|
8733
|
+
return key === rawAttrsKey ? target : target[key];
|
|
8543
8734
|
}
|
|
8544
8735
|
};
|
|
8545
8736
|
function getSlotsProxy(instance) {
|
|
@@ -8890,7 +9081,7 @@ function isMemoSame(cached, memo) {
|
|
|
8890
9081
|
return true;
|
|
8891
9082
|
}
|
|
8892
9083
|
|
|
8893
|
-
const version = "3.5.
|
|
9084
|
+
const version = "3.5.45";
|
|
8894
9085
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
8895
9086
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8896
9087
|
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|