@vue/runtime-core 3.6.0-alpha.7 → 3.6.0-beta.1
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 +266 -223
- package/dist/runtime-core.cjs.prod.js +223 -186
- package/dist/runtime-core.d.ts +9 -9
- package/dist/runtime-core.esm-bundler.js +259 -225
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-
|
|
2
|
+
* @vue/runtime-core v3.6.0-beta.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
import { setActiveSub, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive,
|
|
6
|
+
import { setActiveSub, isRef, toRaw, traverse, WatcherEffect, shallowRef, readonly, isReactive, ref, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive, customRef, shallowReactive, trigger, ReactiveEffect, setCurrentScope, 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
|
-
import { isString, isFunction, EMPTY_OBJ, isPromise, isArray, getGlobalThis, extend, isBuiltInDirective, NO, hasOwn, remove, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, normalizeCssVarValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, camelize, capitalize, isSymbol,
|
|
8
|
+
import { isString, isFunction, EMPTY_OBJ, isPromise, isArray, getGlobalThis, extend, isBuiltInDirective, NOOP, NO, hasOwn, remove, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, normalizeCssVarValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, camelize, capitalize, isSymbol, isGloballyAllowed, hyphenate, hasChanged, getModifierPropName, looseToNumber, isModelListener, EMPTY_ARR, makeMap, toRawType, getSequence, toNumber, isBuiltInTag } from '@vue/shared';
|
|
9
9
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
10
10
|
|
|
11
11
|
const stack = [];
|
|
@@ -415,10 +415,10 @@ function flushPostFlushCbs(seen) {
|
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
let isFlushing = false;
|
|
418
|
-
function flushOnAppMount() {
|
|
418
|
+
function flushOnAppMount(instance) {
|
|
419
419
|
if (!isFlushing) {
|
|
420
420
|
isFlushing = true;
|
|
421
|
-
flushPreFlushCbs();
|
|
421
|
+
flushPreFlushCbs(instance);
|
|
422
422
|
flushPostFlushCbs();
|
|
423
423
|
isFlushing = false;
|
|
424
424
|
}
|
|
@@ -833,7 +833,203 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
|
|
836
|
-
|
|
836
|
+
function provide(key, value) {
|
|
837
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
838
|
+
if (!currentInstance || currentInstance.isMounted && !isHmrUpdating) {
|
|
839
|
+
warn$1(`provide() can only be used inside setup().`);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
if (currentInstance) {
|
|
843
|
+
let provides = currentInstance.provides;
|
|
844
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
845
|
+
if (parentProvides === provides) {
|
|
846
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
847
|
+
}
|
|
848
|
+
provides[key] = value;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
852
|
+
const instance = getCurrentGenericInstance();
|
|
853
|
+
if (instance || currentApp) {
|
|
854
|
+
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
855
|
+
if (provides && key in provides) {
|
|
856
|
+
return provides[key];
|
|
857
|
+
} else if (arguments.length > 1) {
|
|
858
|
+
return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
859
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
860
|
+
warn$1(`injection "${String(key)}" not found.`);
|
|
861
|
+
}
|
|
862
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
863
|
+
warn$1(`inject() can only be used inside setup() or functional components.`);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
function hasInjectionContext() {
|
|
867
|
+
return !!(getCurrentGenericInstance() || currentApp);
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
|
|
871
|
+
const useSSRContext = () => {
|
|
872
|
+
{
|
|
873
|
+
const ctx = inject(ssrContextKey);
|
|
874
|
+
if (!ctx) {
|
|
875
|
+
!!(process.env.NODE_ENV !== "production") && warn$1(
|
|
876
|
+
`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
return ctx;
|
|
880
|
+
}
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
function watchEffect(effect, options) {
|
|
884
|
+
return doWatch(effect, null, options);
|
|
885
|
+
}
|
|
886
|
+
function watchPostEffect(effect, options) {
|
|
887
|
+
return doWatch(
|
|
888
|
+
effect,
|
|
889
|
+
null,
|
|
890
|
+
!!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "post" }) : { flush: "post" }
|
|
891
|
+
);
|
|
892
|
+
}
|
|
893
|
+
function watchSyncEffect(effect, options) {
|
|
894
|
+
return doWatch(
|
|
895
|
+
effect,
|
|
896
|
+
null,
|
|
897
|
+
!!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "sync" }) : { flush: "sync" }
|
|
898
|
+
);
|
|
899
|
+
}
|
|
900
|
+
function watch(source, cb, options) {
|
|
901
|
+
if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) {
|
|
902
|
+
warn$1(
|
|
903
|
+
`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
|
|
904
|
+
);
|
|
905
|
+
}
|
|
906
|
+
return doWatch(source, cb, options);
|
|
907
|
+
}
|
|
908
|
+
class RenderWatcherEffect extends WatcherEffect {
|
|
909
|
+
constructor(instance, source, cb, options, flush) {
|
|
910
|
+
super(source, cb, options);
|
|
911
|
+
this.flush = flush;
|
|
912
|
+
const job = () => {
|
|
913
|
+
if (this.dirty) {
|
|
914
|
+
this.run();
|
|
915
|
+
}
|
|
916
|
+
};
|
|
917
|
+
if (cb) {
|
|
918
|
+
this.flags |= 128;
|
|
919
|
+
job.flags |= 2;
|
|
920
|
+
}
|
|
921
|
+
if (instance) {
|
|
922
|
+
job.i = instance;
|
|
923
|
+
}
|
|
924
|
+
this.job = job;
|
|
925
|
+
}
|
|
926
|
+
notify() {
|
|
927
|
+
const flags = this.flags;
|
|
928
|
+
if (!(flags & 256)) {
|
|
929
|
+
const flush = this.flush;
|
|
930
|
+
const job = this.job;
|
|
931
|
+
if (flush === "post") {
|
|
932
|
+
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
933
|
+
} else if (flush === "pre") {
|
|
934
|
+
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
935
|
+
} else {
|
|
936
|
+
job();
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
942
|
+
const { immediate, deep, flush = "pre", once } = options;
|
|
943
|
+
if (!!(process.env.NODE_ENV !== "production") && !cb) {
|
|
944
|
+
if (immediate !== void 0) {
|
|
945
|
+
warn$1(
|
|
946
|
+
`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
|
|
947
|
+
);
|
|
948
|
+
}
|
|
949
|
+
if (deep !== void 0) {
|
|
950
|
+
warn$1(
|
|
951
|
+
`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
|
|
952
|
+
);
|
|
953
|
+
}
|
|
954
|
+
if (once !== void 0) {
|
|
955
|
+
warn$1(
|
|
956
|
+
`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
|
|
957
|
+
);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
const baseWatchOptions = extend({}, options);
|
|
961
|
+
if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
|
|
962
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
963
|
+
let ssrCleanup;
|
|
964
|
+
if (isInSSRComponentSetup) {
|
|
965
|
+
if (flush === "sync") {
|
|
966
|
+
const ctx = useSSRContext();
|
|
967
|
+
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
968
|
+
} else if (!runsImmediately) {
|
|
969
|
+
const watchStopHandle = () => {
|
|
970
|
+
};
|
|
971
|
+
watchStopHandle.stop = NOOP;
|
|
972
|
+
watchStopHandle.resume = NOOP;
|
|
973
|
+
watchStopHandle.pause = NOOP;
|
|
974
|
+
return watchStopHandle;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
const instance = currentInstance;
|
|
978
|
+
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
979
|
+
const effect = new RenderWatcherEffect(
|
|
980
|
+
instance,
|
|
981
|
+
source,
|
|
982
|
+
cb,
|
|
983
|
+
baseWatchOptions,
|
|
984
|
+
flush
|
|
985
|
+
);
|
|
986
|
+
if (cb) {
|
|
987
|
+
effect.run(true);
|
|
988
|
+
} else if (flush === "post") {
|
|
989
|
+
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
990
|
+
} else {
|
|
991
|
+
effect.run(true);
|
|
992
|
+
}
|
|
993
|
+
const stop = effect.stop.bind(effect);
|
|
994
|
+
stop.pause = effect.pause.bind(effect);
|
|
995
|
+
stop.resume = effect.resume.bind(effect);
|
|
996
|
+
stop.stop = stop;
|
|
997
|
+
if (isInSSRComponentSetup) {
|
|
998
|
+
if (ssrCleanup) {
|
|
999
|
+
ssrCleanup.push(stop);
|
|
1000
|
+
} else if (runsImmediately) {
|
|
1001
|
+
stop();
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
return stop;
|
|
1005
|
+
}
|
|
1006
|
+
function instanceWatch(source, value, options) {
|
|
1007
|
+
const publicThis = this.proxy;
|
|
1008
|
+
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
1009
|
+
let cb;
|
|
1010
|
+
if (isFunction(value)) {
|
|
1011
|
+
cb = value;
|
|
1012
|
+
} else {
|
|
1013
|
+
cb = value.handler;
|
|
1014
|
+
options = value;
|
|
1015
|
+
}
|
|
1016
|
+
const prev = setCurrentInstance(this);
|
|
1017
|
+
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
1018
|
+
setCurrentInstance(...prev);
|
|
1019
|
+
return res;
|
|
1020
|
+
}
|
|
1021
|
+
function createPathGetter(ctx, path) {
|
|
1022
|
+
const segments = path.split(".");
|
|
1023
|
+
return () => {
|
|
1024
|
+
let cur = ctx;
|
|
1025
|
+
for (let i = 0; i < segments.length && cur; i++) {
|
|
1026
|
+
cur = cur[segments[i]];
|
|
1027
|
+
}
|
|
1028
|
+
return cur;
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
|
|
837
1033
|
const isTeleport = (type) => type.__isTeleport;
|
|
838
1034
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
839
1035
|
const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
|
|
@@ -1205,8 +1401,8 @@ function prepareAnchor(target, vnode, createText, insert) {
|
|
|
1205
1401
|
return targetAnchor;
|
|
1206
1402
|
}
|
|
1207
1403
|
|
|
1208
|
-
const leaveCbKey = Symbol("_leaveCb");
|
|
1209
|
-
const enterCbKey = Symbol("_enterCb");
|
|
1404
|
+
const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
|
|
1405
|
+
const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
|
|
1210
1406
|
function useTransitionState() {
|
|
1211
1407
|
const state = {
|
|
1212
1408
|
isMounted: false,
|
|
@@ -2843,7 +3039,9 @@ const KeepAliveImpl = {
|
|
|
2843
3039
|
}
|
|
2844
3040
|
function pruneCache(filter) {
|
|
2845
3041
|
cache.forEach((vnode, key) => {
|
|
2846
|
-
const name = getComponentName(
|
|
3042
|
+
const name = getComponentName(
|
|
3043
|
+
isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
|
|
3044
|
+
);
|
|
2847
3045
|
if (name && !filter(name)) {
|
|
2848
3046
|
pruneCacheEntry(key);
|
|
2849
3047
|
}
|
|
@@ -3145,7 +3343,7 @@ const DIRECTIVES = "directives";
|
|
|
3145
3343
|
function resolveComponent(name, maybeSelfReference) {
|
|
3146
3344
|
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
3147
3345
|
}
|
|
3148
|
-
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
3346
|
+
const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
|
|
3149
3347
|
function resolveDynamicComponent(component) {
|
|
3150
3348
|
if (isString(component)) {
|
|
3151
3349
|
return resolveAsset(COMPONENTS, component, false) || component;
|
|
@@ -3336,14 +3534,14 @@ function ensureVaporSlotFallback(vnodes, fallback) {
|
|
|
3336
3534
|
}
|
|
3337
3535
|
}
|
|
3338
3536
|
|
|
3339
|
-
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
3537
|
+
function toHandlers(obj, preserveCaseIfNecessary, needWrap) {
|
|
3340
3538
|
const ret = {};
|
|
3341
3539
|
if (!!(process.env.NODE_ENV !== "production") && !isObject(obj)) {
|
|
3342
3540
|
warn$1(`v-on with no argument expects an object value.`);
|
|
3343
3541
|
return ret;
|
|
3344
3542
|
}
|
|
3345
3543
|
for (const key in obj) {
|
|
3346
|
-
ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
|
|
3544
|
+
ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = needWrap ? () => obj[key] : obj[key];
|
|
3347
3545
|
}
|
|
3348
3546
|
return ret;
|
|
3349
3547
|
}
|
|
@@ -4319,202 +4517,6 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
4319
4517
|
}
|
|
4320
4518
|
let currentApp = null;
|
|
4321
4519
|
|
|
4322
|
-
function provide(key, value) {
|
|
4323
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4324
|
-
if (!currentInstance || currentInstance.isMounted) {
|
|
4325
|
-
warn$1(`provide() can only be used inside setup().`);
|
|
4326
|
-
}
|
|
4327
|
-
}
|
|
4328
|
-
if (currentInstance) {
|
|
4329
|
-
let provides = currentInstance.provides;
|
|
4330
|
-
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
4331
|
-
if (parentProvides === provides) {
|
|
4332
|
-
provides = currentInstance.provides = Object.create(parentProvides);
|
|
4333
|
-
}
|
|
4334
|
-
provides[key] = value;
|
|
4335
|
-
}
|
|
4336
|
-
}
|
|
4337
|
-
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
4338
|
-
const instance = getCurrentGenericInstance();
|
|
4339
|
-
if (instance || currentApp) {
|
|
4340
|
-
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
4341
|
-
if (provides && key in provides) {
|
|
4342
|
-
return provides[key];
|
|
4343
|
-
} else if (arguments.length > 1) {
|
|
4344
|
-
return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
4345
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
4346
|
-
warn$1(`injection "${String(key)}" not found.`);
|
|
4347
|
-
}
|
|
4348
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
4349
|
-
warn$1(`inject() can only be used inside setup() or functional components.`);
|
|
4350
|
-
}
|
|
4351
|
-
}
|
|
4352
|
-
function hasInjectionContext() {
|
|
4353
|
-
return !!(getCurrentGenericInstance() || currentApp);
|
|
4354
|
-
}
|
|
4355
|
-
|
|
4356
|
-
const ssrContextKey = Symbol.for("v-scx");
|
|
4357
|
-
const useSSRContext = () => {
|
|
4358
|
-
{
|
|
4359
|
-
const ctx = inject(ssrContextKey);
|
|
4360
|
-
if (!ctx) {
|
|
4361
|
-
!!(process.env.NODE_ENV !== "production") && warn$1(
|
|
4362
|
-
`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
|
|
4363
|
-
);
|
|
4364
|
-
}
|
|
4365
|
-
return ctx;
|
|
4366
|
-
}
|
|
4367
|
-
};
|
|
4368
|
-
|
|
4369
|
-
function watchEffect(effect, options) {
|
|
4370
|
-
return doWatch(effect, null, options);
|
|
4371
|
-
}
|
|
4372
|
-
function watchPostEffect(effect, options) {
|
|
4373
|
-
return doWatch(
|
|
4374
|
-
effect,
|
|
4375
|
-
null,
|
|
4376
|
-
!!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "post" }) : { flush: "post" }
|
|
4377
|
-
);
|
|
4378
|
-
}
|
|
4379
|
-
function watchSyncEffect(effect, options) {
|
|
4380
|
-
return doWatch(
|
|
4381
|
-
effect,
|
|
4382
|
-
null,
|
|
4383
|
-
!!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "sync" }) : { flush: "sync" }
|
|
4384
|
-
);
|
|
4385
|
-
}
|
|
4386
|
-
function watch(source, cb, options) {
|
|
4387
|
-
if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) {
|
|
4388
|
-
warn$1(
|
|
4389
|
-
`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
|
|
4390
|
-
);
|
|
4391
|
-
}
|
|
4392
|
-
return doWatch(source, cb, options);
|
|
4393
|
-
}
|
|
4394
|
-
class RenderWatcherEffect extends WatcherEffect {
|
|
4395
|
-
constructor(instance, source, cb, options, flush) {
|
|
4396
|
-
super(source, cb, options);
|
|
4397
|
-
this.flush = flush;
|
|
4398
|
-
const job = () => {
|
|
4399
|
-
if (this.dirty) {
|
|
4400
|
-
this.run();
|
|
4401
|
-
}
|
|
4402
|
-
};
|
|
4403
|
-
if (cb) {
|
|
4404
|
-
this.flags |= 128;
|
|
4405
|
-
job.flags |= 2;
|
|
4406
|
-
}
|
|
4407
|
-
if (instance) {
|
|
4408
|
-
job.i = instance;
|
|
4409
|
-
}
|
|
4410
|
-
this.job = job;
|
|
4411
|
-
}
|
|
4412
|
-
notify() {
|
|
4413
|
-
const flags = this.flags;
|
|
4414
|
-
if (!(flags & 256)) {
|
|
4415
|
-
const flush = this.flush;
|
|
4416
|
-
const job = this.job;
|
|
4417
|
-
if (flush === "post") {
|
|
4418
|
-
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
4419
|
-
} else if (flush === "pre") {
|
|
4420
|
-
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
4421
|
-
} else {
|
|
4422
|
-
job();
|
|
4423
|
-
}
|
|
4424
|
-
}
|
|
4425
|
-
}
|
|
4426
|
-
}
|
|
4427
|
-
function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
4428
|
-
const { immediate, deep, flush = "pre", once } = options;
|
|
4429
|
-
if (!!(process.env.NODE_ENV !== "production") && !cb) {
|
|
4430
|
-
if (immediate !== void 0) {
|
|
4431
|
-
warn$1(
|
|
4432
|
-
`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
|
|
4433
|
-
);
|
|
4434
|
-
}
|
|
4435
|
-
if (deep !== void 0) {
|
|
4436
|
-
warn$1(
|
|
4437
|
-
`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
|
|
4438
|
-
);
|
|
4439
|
-
}
|
|
4440
|
-
if (once !== void 0) {
|
|
4441
|
-
warn$1(
|
|
4442
|
-
`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
|
|
4443
|
-
);
|
|
4444
|
-
}
|
|
4445
|
-
}
|
|
4446
|
-
const baseWatchOptions = extend({}, options);
|
|
4447
|
-
if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
|
|
4448
|
-
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
4449
|
-
let ssrCleanup;
|
|
4450
|
-
if (isInSSRComponentSetup) {
|
|
4451
|
-
if (flush === "sync") {
|
|
4452
|
-
const ctx = useSSRContext();
|
|
4453
|
-
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
4454
|
-
} else if (!runsImmediately) {
|
|
4455
|
-
const watchStopHandle = () => {
|
|
4456
|
-
};
|
|
4457
|
-
watchStopHandle.stop = NOOP;
|
|
4458
|
-
watchStopHandle.resume = NOOP;
|
|
4459
|
-
watchStopHandle.pause = NOOP;
|
|
4460
|
-
return watchStopHandle;
|
|
4461
|
-
}
|
|
4462
|
-
}
|
|
4463
|
-
const instance = currentInstance;
|
|
4464
|
-
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
4465
|
-
const effect = new RenderWatcherEffect(
|
|
4466
|
-
instance,
|
|
4467
|
-
source,
|
|
4468
|
-
cb,
|
|
4469
|
-
baseWatchOptions,
|
|
4470
|
-
flush
|
|
4471
|
-
);
|
|
4472
|
-
if (cb) {
|
|
4473
|
-
effect.run(true);
|
|
4474
|
-
} else if (flush === "post") {
|
|
4475
|
-
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
4476
|
-
} else {
|
|
4477
|
-
effect.run(true);
|
|
4478
|
-
}
|
|
4479
|
-
const stop = effect.stop.bind(effect);
|
|
4480
|
-
stop.pause = effect.pause.bind(effect);
|
|
4481
|
-
stop.resume = effect.resume.bind(effect);
|
|
4482
|
-
stop.stop = stop;
|
|
4483
|
-
if (isInSSRComponentSetup) {
|
|
4484
|
-
if (ssrCleanup) {
|
|
4485
|
-
ssrCleanup.push(stop);
|
|
4486
|
-
} else if (runsImmediately) {
|
|
4487
|
-
stop();
|
|
4488
|
-
}
|
|
4489
|
-
}
|
|
4490
|
-
return stop;
|
|
4491
|
-
}
|
|
4492
|
-
function instanceWatch(source, value, options) {
|
|
4493
|
-
const publicThis = this.proxy;
|
|
4494
|
-
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
4495
|
-
let cb;
|
|
4496
|
-
if (isFunction(value)) {
|
|
4497
|
-
cb = value;
|
|
4498
|
-
} else {
|
|
4499
|
-
cb = value.handler;
|
|
4500
|
-
options = value;
|
|
4501
|
-
}
|
|
4502
|
-
const prev = setCurrentInstance(this);
|
|
4503
|
-
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
4504
|
-
setCurrentInstance(...prev);
|
|
4505
|
-
return res;
|
|
4506
|
-
}
|
|
4507
|
-
function createPathGetter(ctx, path) {
|
|
4508
|
-
const segments = path.split(".");
|
|
4509
|
-
return () => {
|
|
4510
|
-
let cur = ctx;
|
|
4511
|
-
for (let i = 0; i < segments.length && cur; i++) {
|
|
4512
|
-
cur = cur[segments[i]];
|
|
4513
|
-
}
|
|
4514
|
-
return cur;
|
|
4515
|
-
};
|
|
4516
|
-
}
|
|
4517
|
-
|
|
4518
4520
|
function useModel(props, name, options = EMPTY_OBJ) {
|
|
4519
4521
|
const i = getCurrentGenericInstance();
|
|
4520
4522
|
if (!!(process.env.NODE_ENV !== "production") && !i) {
|
|
@@ -5785,7 +5787,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5785
5787
|
} else {
|
|
5786
5788
|
const el = n2.el = n1.el;
|
|
5787
5789
|
if (n2.children !== n1.children) {
|
|
5788
|
-
|
|
5790
|
+
if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
|
|
5791
|
+
const childNodes = container.childNodes;
|
|
5792
|
+
const newChild = hostCreateText(n2.children);
|
|
5793
|
+
const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
|
|
5794
|
+
hostInsert(newChild, container, oldChild);
|
|
5795
|
+
hostRemove(oldChild);
|
|
5796
|
+
} else {
|
|
5797
|
+
hostSetText(el, n2.children);
|
|
5798
|
+
}
|
|
5789
5799
|
}
|
|
5790
5800
|
}
|
|
5791
5801
|
};
|
|
@@ -6169,7 +6179,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6169
6179
|
} else {
|
|
6170
6180
|
if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
|
|
6171
6181
|
// of renderSlot() with no valid children
|
|
6172
|
-
n1.dynamicChildren) {
|
|
6182
|
+
n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
|
|
6173
6183
|
patchBlockChildren(
|
|
6174
6184
|
n1.dynamicChildren,
|
|
6175
6185
|
dynamicChildren,
|
|
@@ -6870,8 +6880,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6870
6880
|
const nextChild = c2[nextIndex];
|
|
6871
6881
|
const anchorVNode = c2[nextIndex + 1];
|
|
6872
6882
|
const anchor = nextIndex + 1 < l2 ? (
|
|
6873
|
-
// #13559, fallback to el placeholder for unresolved async component
|
|
6874
|
-
anchorVNode.el || anchorVNode
|
|
6883
|
+
// #13559, #14173 fallback to el placeholder for unresolved async component
|
|
6884
|
+
anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
|
|
6875
6885
|
) : parentAnchor;
|
|
6876
6886
|
if (newIndexToOldIndexMap[i] === 0) {
|
|
6877
6887
|
patch(
|
|
@@ -7176,9 +7186,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7176
7186
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
7177
7187
|
};
|
|
7178
7188
|
const render = (vnode, container, namespace) => {
|
|
7189
|
+
let instance;
|
|
7179
7190
|
if (vnode == null) {
|
|
7180
7191
|
if (container._vnode) {
|
|
7181
7192
|
unmount(container._vnode, null, null, true);
|
|
7193
|
+
instance = container._vnode.component;
|
|
7182
7194
|
}
|
|
7183
7195
|
} else {
|
|
7184
7196
|
patch(
|
|
@@ -7192,7 +7204,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7192
7204
|
);
|
|
7193
7205
|
}
|
|
7194
7206
|
container._vnode = vnode;
|
|
7195
|
-
flushOnAppMount();
|
|
7207
|
+
flushOnAppMount(instance);
|
|
7196
7208
|
};
|
|
7197
7209
|
const internals = {
|
|
7198
7210
|
p: patch,
|
|
@@ -7282,9 +7294,13 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
7282
7294
|
if (!shallow && c2.patchFlag !== -2)
|
|
7283
7295
|
traverseStaticChildren(c1, c2);
|
|
7284
7296
|
}
|
|
7285
|
-
if (c2.type === Text
|
|
7286
|
-
|
|
7287
|
-
|
|
7297
|
+
if (c2.type === Text) {
|
|
7298
|
+
if (c2.patchFlag !== -1) {
|
|
7299
|
+
c2.el = c1.el;
|
|
7300
|
+
} else {
|
|
7301
|
+
c2.__elIndex = i + // take fragment start anchor into account
|
|
7302
|
+
(n1.type === Fragment ? 1 : 0);
|
|
7303
|
+
}
|
|
7288
7304
|
}
|
|
7289
7305
|
if (c2.type === Comment && !c2.el) {
|
|
7290
7306
|
c2.el = c1.el;
|
|
@@ -7320,16 +7336,24 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
7320
7336
|
insert();
|
|
7321
7337
|
}
|
|
7322
7338
|
}
|
|
7323
|
-
function performTransitionLeave(el, transition, remove, isElement = true) {
|
|
7339
|
+
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
7324
7340
|
const performRemove = () => {
|
|
7325
7341
|
remove();
|
|
7326
7342
|
if (transition && !transition.persisted && transition.afterLeave) {
|
|
7327
7343
|
transition.afterLeave();
|
|
7328
7344
|
}
|
|
7329
7345
|
};
|
|
7330
|
-
if (isElement && transition && !transition.persisted) {
|
|
7346
|
+
if (force || isElement && transition && !transition.persisted) {
|
|
7331
7347
|
const { leave, delayLeave } = transition;
|
|
7332
|
-
const performLeave = () =>
|
|
7348
|
+
const performLeave = () => {
|
|
7349
|
+
if (el._isLeaving && force) {
|
|
7350
|
+
el[leaveCbKey](
|
|
7351
|
+
true
|
|
7352
|
+
/* cancelled */
|
|
7353
|
+
);
|
|
7354
|
+
}
|
|
7355
|
+
leave(el, performRemove);
|
|
7356
|
+
};
|
|
7333
7357
|
if (delayLeave) {
|
|
7334
7358
|
delayLeave(el, performRemove, performLeave);
|
|
7335
7359
|
} else {
|
|
@@ -7385,6 +7409,16 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
7385
7409
|
}
|
|
7386
7410
|
return inheritedScopeIds;
|
|
7387
7411
|
}
|
|
7412
|
+
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
7413
|
+
if (anchorVnode.placeholder) {
|
|
7414
|
+
return anchorVnode.placeholder;
|
|
7415
|
+
}
|
|
7416
|
+
const instance = anchorVnode.component;
|
|
7417
|
+
if (instance) {
|
|
7418
|
+
return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
7419
|
+
}
|
|
7420
|
+
return null;
|
|
7421
|
+
}
|
|
7388
7422
|
|
|
7389
7423
|
const isSuspense = (type) => type.__isSuspense;
|
|
7390
7424
|
let suspenseId = 0;
|
|
@@ -7967,11 +8001,11 @@ function isVNodeSuspensible(vnode) {
|
|
|
7967
8001
|
return suspensible != null && suspensible !== false;
|
|
7968
8002
|
}
|
|
7969
8003
|
|
|
7970
|
-
const Fragment = Symbol.for("v-fgt");
|
|
7971
|
-
const Text = Symbol.for("v-txt");
|
|
7972
|
-
const Comment = Symbol.for("v-cmt");
|
|
7973
|
-
const Static = Symbol.for("v-stc");
|
|
7974
|
-
const VaporSlot = Symbol.for("v-vps");
|
|
8004
|
+
const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
|
|
8005
|
+
const Text = /* @__PURE__ */ Symbol.for("v-txt");
|
|
8006
|
+
const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
8007
|
+
const Static = /* @__PURE__ */ Symbol.for("v-stc");
|
|
8008
|
+
const VaporSlot = /* @__PURE__ */ Symbol.for("v-vps");
|
|
7975
8009
|
const blockStack = [];
|
|
7976
8010
|
let currentBlock = null;
|
|
7977
8011
|
function openBlock(disableTracking = false) {
|
|
@@ -9044,7 +9078,7 @@ function isMemoSame(cached, memo) {
|
|
|
9044
9078
|
return true;
|
|
9045
9079
|
}
|
|
9046
9080
|
|
|
9047
|
-
const version = "3.6.0-
|
|
9081
|
+
const version = "3.6.0-beta.1";
|
|
9048
9082
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
9049
9083
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
9050
9084
|
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.6.0-
|
|
3
|
+
"version": "3.6.0-beta.1",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@vue/
|
|
50
|
-
"@vue/
|
|
49
|
+
"@vue/shared": "3.6.0-beta.1",
|
|
50
|
+
"@vue/reactivity": "3.6.0-beta.1"
|
|
51
51
|
}
|
|
52
52
|
}
|