@vue/server-renderer 3.6.0-alpha.6 → 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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/server-renderer v3.6.0-
|
|
2
|
+
* @vue/server-renderer v3.6.0-beta.1
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -782,13 +782,13 @@ class Dep {
|
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
784
|
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
785
|
-
const ITERATE_KEY = Symbol(
|
|
785
|
+
const ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
786
786
|
"Object iterate"
|
|
787
787
|
);
|
|
788
|
-
const MAP_KEY_ITERATE_KEY = Symbol(
|
|
788
|
+
const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
789
789
|
"Map keys iterate"
|
|
790
790
|
);
|
|
791
|
-
const ARRAY_ITERATE_KEY = Symbol(
|
|
791
|
+
const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
792
792
|
"Array iterate"
|
|
793
793
|
);
|
|
794
794
|
function track(target, type, key) {
|
|
@@ -1785,6 +1785,16 @@ class EffectScope {
|
|
|
1785
1785
|
return;
|
|
1786
1786
|
}
|
|
1787
1787
|
this.flags = 1024;
|
|
1788
|
+
this.reset();
|
|
1789
|
+
const sub = this.subs;
|
|
1790
|
+
if (sub !== void 0) {
|
|
1791
|
+
unlink(sub);
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
/**
|
|
1795
|
+
* @internal
|
|
1796
|
+
*/
|
|
1797
|
+
reset() {
|
|
1788
1798
|
let dep = this.deps;
|
|
1789
1799
|
while (dep !== void 0) {
|
|
1790
1800
|
const node = dep.dep;
|
|
@@ -1795,10 +1805,6 @@ class EffectScope {
|
|
|
1795
1805
|
dep = unlink(dep, this);
|
|
1796
1806
|
}
|
|
1797
1807
|
}
|
|
1798
|
-
const sub = this.subs;
|
|
1799
|
-
if (sub !== void 0) {
|
|
1800
|
-
unlink(sub);
|
|
1801
|
-
}
|
|
1802
1808
|
cleanup(this);
|
|
1803
1809
|
}
|
|
1804
1810
|
}
|
|
@@ -2467,10 +2473,10 @@ function flushPostFlushCbs(seen) {
|
|
|
2467
2473
|
}
|
|
2468
2474
|
}
|
|
2469
2475
|
let isFlushing = false;
|
|
2470
|
-
function flushOnAppMount() {
|
|
2476
|
+
function flushOnAppMount(instance) {
|
|
2471
2477
|
if (!isFlushing) {
|
|
2472
2478
|
isFlushing = true;
|
|
2473
|
-
flushPreFlushCbs();
|
|
2479
|
+
flushPreFlushCbs(instance);
|
|
2474
2480
|
flushPostFlushCbs();
|
|
2475
2481
|
isFlushing = false;
|
|
2476
2482
|
}
|
|
@@ -2537,6 +2543,7 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
2537
2543
|
|
|
2538
2544
|
let isHmrUpdating = false;
|
|
2539
2545
|
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
2546
|
+
const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
|
|
2540
2547
|
{
|
|
2541
2548
|
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
2542
2549
|
createRecord: tryWrap(createRecord),
|
|
@@ -2600,9 +2607,10 @@ function reload(id, newComp) {
|
|
|
2600
2607
|
const record = map.get(id);
|
|
2601
2608
|
if (!record) return;
|
|
2602
2609
|
newComp = normalizeClassComponent(newComp);
|
|
2610
|
+
const isVapor = record.initialDef.__vapor;
|
|
2603
2611
|
updateComponentDef(record.initialDef, newComp);
|
|
2604
2612
|
const instances = [...record.instances];
|
|
2605
|
-
if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2613
|
+
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2606
2614
|
for (const instance of instances) {
|
|
2607
2615
|
if (instance.root && instance.root.ce && instance !== instance.root) {
|
|
2608
2616
|
instance.root.ce._removeChildStyle(instance.type);
|
|
@@ -2622,6 +2630,7 @@ function reload(id, newComp) {
|
|
|
2622
2630
|
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2623
2631
|
}
|
|
2624
2632
|
dirtyInstances.add(instance);
|
|
2633
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2625
2634
|
instance.appContext.propsCache.delete(instance.type);
|
|
2626
2635
|
instance.appContext.emitsCache.delete(instance.type);
|
|
2627
2636
|
instance.appContext.optionsCache.delete(instance.type);
|
|
@@ -2662,6 +2671,7 @@ function reload(id, newComp) {
|
|
|
2662
2671
|
}
|
|
2663
2672
|
queuePostFlushCb(() => {
|
|
2664
2673
|
hmrDirtyComponents.clear();
|
|
2674
|
+
hmrDirtyComponentsMode.clear();
|
|
2665
2675
|
});
|
|
2666
2676
|
}
|
|
2667
2677
|
function updateComponentDef(oldComp, newComp) {
|
|
@@ -2843,13 +2853,189 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
2843
2853
|
}
|
|
2844
2854
|
}
|
|
2845
2855
|
|
|
2846
|
-
|
|
2856
|
+
function provide(key, value) {
|
|
2857
|
+
{
|
|
2858
|
+
if (!currentInstance || currentInstance.isMounted && !isHmrUpdating) {
|
|
2859
|
+
warn$1(`provide() can only be used inside setup().`);
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
if (currentInstance) {
|
|
2863
|
+
let provides = currentInstance.provides;
|
|
2864
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
2865
|
+
if (parentProvides === provides) {
|
|
2866
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
2867
|
+
}
|
|
2868
|
+
provides[key] = value;
|
|
2869
|
+
}
|
|
2870
|
+
}
|
|
2871
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
2872
|
+
const instance = getCurrentGenericInstance();
|
|
2873
|
+
if (instance || currentApp) {
|
|
2874
|
+
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
2875
|
+
if (provides && key in provides) {
|
|
2876
|
+
return provides[key];
|
|
2877
|
+
} else if (arguments.length > 1) {
|
|
2878
|
+
return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
2879
|
+
} else {
|
|
2880
|
+
warn$1(`injection "${String(key)}" not found.`);
|
|
2881
|
+
}
|
|
2882
|
+
} else {
|
|
2883
|
+
warn$1(`inject() can only be used inside setup() or functional components.`);
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
|
|
2888
|
+
const useSSRContext = () => {
|
|
2889
|
+
{
|
|
2890
|
+
const ctx = inject(ssrContextKey);
|
|
2891
|
+
if (!ctx) {
|
|
2892
|
+
warn$1(
|
|
2893
|
+
`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
|
|
2894
|
+
);
|
|
2895
|
+
}
|
|
2896
|
+
return ctx;
|
|
2897
|
+
}
|
|
2898
|
+
};
|
|
2899
|
+
|
|
2900
|
+
function watch(source, cb, options) {
|
|
2901
|
+
if (!isFunction(cb)) {
|
|
2902
|
+
warn$1(
|
|
2903
|
+
`\`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.`
|
|
2904
|
+
);
|
|
2905
|
+
}
|
|
2906
|
+
return doWatch(source, cb, options);
|
|
2907
|
+
}
|
|
2908
|
+
class RenderWatcherEffect extends WatcherEffect {
|
|
2909
|
+
constructor(instance, source, cb, options, flush) {
|
|
2910
|
+
super(source, cb, options);
|
|
2911
|
+
this.flush = flush;
|
|
2912
|
+
const job = () => {
|
|
2913
|
+
if (this.dirty) {
|
|
2914
|
+
this.run();
|
|
2915
|
+
}
|
|
2916
|
+
};
|
|
2917
|
+
if (cb) {
|
|
2918
|
+
this.flags |= 128;
|
|
2919
|
+
job.flags |= 2;
|
|
2920
|
+
}
|
|
2921
|
+
if (instance) {
|
|
2922
|
+
job.i = instance;
|
|
2923
|
+
}
|
|
2924
|
+
this.job = job;
|
|
2925
|
+
}
|
|
2926
|
+
notify() {
|
|
2927
|
+
const flags = this.flags;
|
|
2928
|
+
if (!(flags & 256)) {
|
|
2929
|
+
const flush = this.flush;
|
|
2930
|
+
const job = this.job;
|
|
2931
|
+
if (flush === "post") {
|
|
2932
|
+
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
2933
|
+
} else if (flush === "pre") {
|
|
2934
|
+
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
2935
|
+
} else {
|
|
2936
|
+
job();
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
2942
|
+
const { immediate, deep, flush = "pre", once } = options;
|
|
2943
|
+
if (!cb) {
|
|
2944
|
+
if (immediate !== void 0) {
|
|
2945
|
+
warn$1(
|
|
2946
|
+
`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
|
|
2947
|
+
);
|
|
2948
|
+
}
|
|
2949
|
+
if (deep !== void 0) {
|
|
2950
|
+
warn$1(
|
|
2951
|
+
`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
|
|
2952
|
+
);
|
|
2953
|
+
}
|
|
2954
|
+
if (once !== void 0) {
|
|
2955
|
+
warn$1(
|
|
2956
|
+
`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
|
|
2957
|
+
);
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
const baseWatchOptions = extend({}, options);
|
|
2961
|
+
baseWatchOptions.onWarn = warn$1;
|
|
2962
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
2963
|
+
let ssrCleanup;
|
|
2964
|
+
if (isInSSRComponentSetup) {
|
|
2965
|
+
if (flush === "sync") {
|
|
2966
|
+
const ctx = useSSRContext();
|
|
2967
|
+
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
2968
|
+
} else if (!runsImmediately) {
|
|
2969
|
+
const watchStopHandle = () => {
|
|
2970
|
+
};
|
|
2971
|
+
watchStopHandle.stop = NOOP;
|
|
2972
|
+
watchStopHandle.resume = NOOP;
|
|
2973
|
+
watchStopHandle.pause = NOOP;
|
|
2974
|
+
return watchStopHandle;
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
const instance = currentInstance;
|
|
2978
|
+
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
2979
|
+
const effect = new RenderWatcherEffect(
|
|
2980
|
+
instance,
|
|
2981
|
+
source,
|
|
2982
|
+
cb,
|
|
2983
|
+
baseWatchOptions,
|
|
2984
|
+
flush
|
|
2985
|
+
);
|
|
2986
|
+
if (cb) {
|
|
2987
|
+
effect.run(true);
|
|
2988
|
+
} else if (flush === "post") {
|
|
2989
|
+
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
2990
|
+
} else {
|
|
2991
|
+
effect.run(true);
|
|
2992
|
+
}
|
|
2993
|
+
const stop = effect.stop.bind(effect);
|
|
2994
|
+
stop.pause = effect.pause.bind(effect);
|
|
2995
|
+
stop.resume = effect.resume.bind(effect);
|
|
2996
|
+
stop.stop = stop;
|
|
2997
|
+
if (isInSSRComponentSetup) {
|
|
2998
|
+
if (ssrCleanup) {
|
|
2999
|
+
ssrCleanup.push(stop);
|
|
3000
|
+
} else if (runsImmediately) {
|
|
3001
|
+
stop();
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
3004
|
+
return stop;
|
|
3005
|
+
}
|
|
3006
|
+
function instanceWatch(source, value, options) {
|
|
3007
|
+
const publicThis = this.proxy;
|
|
3008
|
+
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
3009
|
+
let cb;
|
|
3010
|
+
if (isFunction(value)) {
|
|
3011
|
+
cb = value;
|
|
3012
|
+
} else {
|
|
3013
|
+
cb = value.handler;
|
|
3014
|
+
options = value;
|
|
3015
|
+
}
|
|
3016
|
+
const prev = setCurrentInstance(this);
|
|
3017
|
+
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
3018
|
+
setCurrentInstance(...prev);
|
|
3019
|
+
return res;
|
|
3020
|
+
}
|
|
3021
|
+
function createPathGetter(ctx, path) {
|
|
3022
|
+
const segments = path.split(".");
|
|
3023
|
+
return () => {
|
|
3024
|
+
let cur = ctx;
|
|
3025
|
+
for (let i = 0; i < segments.length && cur; i++) {
|
|
3026
|
+
cur = cur[segments[i]];
|
|
3027
|
+
}
|
|
3028
|
+
return cur;
|
|
3029
|
+
};
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
|
|
2847
3033
|
const isTeleport = (type) => type.__isTeleport;
|
|
2848
3034
|
|
|
2849
|
-
const leaveCbKey = Symbol("_leaveCb");
|
|
3035
|
+
const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
|
|
2850
3036
|
function setTransitionHooks(vnode, hooks) {
|
|
2851
3037
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
2852
|
-
if (vnode.type
|
|
3038
|
+
if (isVaporComponent(vnode.type)) {
|
|
2853
3039
|
getVaporInterface(vnode.component, vnode).setTransitionHooks(
|
|
2854
3040
|
vnode.component,
|
|
2855
3041
|
hooks
|
|
@@ -3101,7 +3287,7 @@ function onErrorCaptured(hook, target = currentInstance) {
|
|
|
3101
3287
|
injectHook("ec", hook, target);
|
|
3102
3288
|
}
|
|
3103
3289
|
|
|
3104
|
-
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
3290
|
+
const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
|
|
3105
3291
|
|
|
3106
3292
|
function ensureValidVNode$1(vnodes) {
|
|
3107
3293
|
return vnodes.some((child) => {
|
|
@@ -3945,182 +4131,6 @@ If you want to remount the same app, move your app creation logic into a factory
|
|
|
3945
4131
|
}
|
|
3946
4132
|
let currentApp = null;
|
|
3947
4133
|
|
|
3948
|
-
function provide(key, value) {
|
|
3949
|
-
{
|
|
3950
|
-
if (!currentInstance || currentInstance.isMounted) {
|
|
3951
|
-
warn$1(`provide() can only be used inside setup().`);
|
|
3952
|
-
}
|
|
3953
|
-
}
|
|
3954
|
-
if (currentInstance) {
|
|
3955
|
-
let provides = currentInstance.provides;
|
|
3956
|
-
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
3957
|
-
if (parentProvides === provides) {
|
|
3958
|
-
provides = currentInstance.provides = Object.create(parentProvides);
|
|
3959
|
-
}
|
|
3960
|
-
provides[key] = value;
|
|
3961
|
-
}
|
|
3962
|
-
}
|
|
3963
|
-
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
3964
|
-
const instance = getCurrentGenericInstance();
|
|
3965
|
-
if (instance || currentApp) {
|
|
3966
|
-
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
|
|
3967
|
-
if (provides && key in provides) {
|
|
3968
|
-
return provides[key];
|
|
3969
|
-
} else if (arguments.length > 1) {
|
|
3970
|
-
return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
3971
|
-
} else {
|
|
3972
|
-
warn$1(`injection "${String(key)}" not found.`);
|
|
3973
|
-
}
|
|
3974
|
-
} else {
|
|
3975
|
-
warn$1(`inject() can only be used inside setup() or functional components.`);
|
|
3976
|
-
}
|
|
3977
|
-
}
|
|
3978
|
-
|
|
3979
|
-
const ssrContextKey = Symbol.for("v-scx");
|
|
3980
|
-
const useSSRContext = () => {
|
|
3981
|
-
{
|
|
3982
|
-
const ctx = inject(ssrContextKey);
|
|
3983
|
-
if (!ctx) {
|
|
3984
|
-
warn$1(
|
|
3985
|
-
`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
|
|
3986
|
-
);
|
|
3987
|
-
}
|
|
3988
|
-
return ctx;
|
|
3989
|
-
}
|
|
3990
|
-
};
|
|
3991
|
-
|
|
3992
|
-
function watch(source, cb, options) {
|
|
3993
|
-
if (!isFunction(cb)) {
|
|
3994
|
-
warn$1(
|
|
3995
|
-
`\`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.`
|
|
3996
|
-
);
|
|
3997
|
-
}
|
|
3998
|
-
return doWatch(source, cb, options);
|
|
3999
|
-
}
|
|
4000
|
-
class RenderWatcherEffect extends WatcherEffect {
|
|
4001
|
-
constructor(instance, source, cb, options, flush) {
|
|
4002
|
-
super(source, cb, options);
|
|
4003
|
-
this.flush = flush;
|
|
4004
|
-
const job = () => {
|
|
4005
|
-
if (this.dirty) {
|
|
4006
|
-
this.run();
|
|
4007
|
-
}
|
|
4008
|
-
};
|
|
4009
|
-
if (cb) {
|
|
4010
|
-
this.flags |= 128;
|
|
4011
|
-
job.flags |= 2;
|
|
4012
|
-
}
|
|
4013
|
-
if (instance) {
|
|
4014
|
-
job.i = instance;
|
|
4015
|
-
}
|
|
4016
|
-
this.job = job;
|
|
4017
|
-
}
|
|
4018
|
-
notify() {
|
|
4019
|
-
const flags = this.flags;
|
|
4020
|
-
if (!(flags & 256)) {
|
|
4021
|
-
const flush = this.flush;
|
|
4022
|
-
const job = this.job;
|
|
4023
|
-
if (flush === "post") {
|
|
4024
|
-
queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
|
|
4025
|
-
} else if (flush === "pre") {
|
|
4026
|
-
queueJob(job, job.i ? job.i.uid : void 0, true);
|
|
4027
|
-
} else {
|
|
4028
|
-
job();
|
|
4029
|
-
}
|
|
4030
|
-
}
|
|
4031
|
-
}
|
|
4032
|
-
}
|
|
4033
|
-
function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
4034
|
-
const { immediate, deep, flush = "pre", once } = options;
|
|
4035
|
-
if (!cb) {
|
|
4036
|
-
if (immediate !== void 0) {
|
|
4037
|
-
warn$1(
|
|
4038
|
-
`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
|
|
4039
|
-
);
|
|
4040
|
-
}
|
|
4041
|
-
if (deep !== void 0) {
|
|
4042
|
-
warn$1(
|
|
4043
|
-
`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
|
|
4044
|
-
);
|
|
4045
|
-
}
|
|
4046
|
-
if (once !== void 0) {
|
|
4047
|
-
warn$1(
|
|
4048
|
-
`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
|
|
4049
|
-
);
|
|
4050
|
-
}
|
|
4051
|
-
}
|
|
4052
|
-
const baseWatchOptions = extend({}, options);
|
|
4053
|
-
baseWatchOptions.onWarn = warn$1;
|
|
4054
|
-
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
4055
|
-
let ssrCleanup;
|
|
4056
|
-
if (isInSSRComponentSetup) {
|
|
4057
|
-
if (flush === "sync") {
|
|
4058
|
-
const ctx = useSSRContext();
|
|
4059
|
-
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
4060
|
-
} else if (!runsImmediately) {
|
|
4061
|
-
const watchStopHandle = () => {
|
|
4062
|
-
};
|
|
4063
|
-
watchStopHandle.stop = NOOP;
|
|
4064
|
-
watchStopHandle.resume = NOOP;
|
|
4065
|
-
watchStopHandle.pause = NOOP;
|
|
4066
|
-
return watchStopHandle;
|
|
4067
|
-
}
|
|
4068
|
-
}
|
|
4069
|
-
const instance = currentInstance;
|
|
4070
|
-
baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
|
|
4071
|
-
const effect = new RenderWatcherEffect(
|
|
4072
|
-
instance,
|
|
4073
|
-
source,
|
|
4074
|
-
cb,
|
|
4075
|
-
baseWatchOptions,
|
|
4076
|
-
flush
|
|
4077
|
-
);
|
|
4078
|
-
if (cb) {
|
|
4079
|
-
effect.run(true);
|
|
4080
|
-
} else if (flush === "post") {
|
|
4081
|
-
queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
|
|
4082
|
-
} else {
|
|
4083
|
-
effect.run(true);
|
|
4084
|
-
}
|
|
4085
|
-
const stop = effect.stop.bind(effect);
|
|
4086
|
-
stop.pause = effect.pause.bind(effect);
|
|
4087
|
-
stop.resume = effect.resume.bind(effect);
|
|
4088
|
-
stop.stop = stop;
|
|
4089
|
-
if (isInSSRComponentSetup) {
|
|
4090
|
-
if (ssrCleanup) {
|
|
4091
|
-
ssrCleanup.push(stop);
|
|
4092
|
-
} else if (runsImmediately) {
|
|
4093
|
-
stop();
|
|
4094
|
-
}
|
|
4095
|
-
}
|
|
4096
|
-
return stop;
|
|
4097
|
-
}
|
|
4098
|
-
function instanceWatch(source, value, options) {
|
|
4099
|
-
const publicThis = this.proxy;
|
|
4100
|
-
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
4101
|
-
let cb;
|
|
4102
|
-
if (isFunction(value)) {
|
|
4103
|
-
cb = value;
|
|
4104
|
-
} else {
|
|
4105
|
-
cb = value.handler;
|
|
4106
|
-
options = value;
|
|
4107
|
-
}
|
|
4108
|
-
const prev = setCurrentInstance(this);
|
|
4109
|
-
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
4110
|
-
setCurrentInstance(...prev);
|
|
4111
|
-
return res;
|
|
4112
|
-
}
|
|
4113
|
-
function createPathGetter(ctx, path) {
|
|
4114
|
-
const segments = path.split(".");
|
|
4115
|
-
return () => {
|
|
4116
|
-
let cur = ctx;
|
|
4117
|
-
for (let i = 0; i < segments.length && cur; i++) {
|
|
4118
|
-
cur = cur[segments[i]];
|
|
4119
|
-
}
|
|
4120
|
-
return cur;
|
|
4121
|
-
};
|
|
4122
|
-
}
|
|
4123
|
-
|
|
4124
4134
|
const getModelModifiers = (props, modelName, getter) => {
|
|
4125
4135
|
return getter(props, getModifierPropName(modelName)) || getter(props, `${camelize(modelName)}Modifiers`) || getter(props, `${hyphenate(modelName)}Modifiers`);
|
|
4126
4136
|
};
|
|
@@ -5191,7 +5201,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5191
5201
|
);
|
|
5192
5202
|
break;
|
|
5193
5203
|
case VaporSlot:
|
|
5194
|
-
getVaporInterface(parentComponent, n2).slot(
|
|
5204
|
+
getVaporInterface(parentComponent, n2).slot(
|
|
5205
|
+
n1,
|
|
5206
|
+
n2,
|
|
5207
|
+
container,
|
|
5208
|
+
anchor,
|
|
5209
|
+
parentComponent
|
|
5210
|
+
);
|
|
5195
5211
|
break;
|
|
5196
5212
|
default:
|
|
5197
5213
|
if (shapeFlag & 1) {
|
|
@@ -5264,7 +5280,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5264
5280
|
} else {
|
|
5265
5281
|
const el = n2.el = n1.el;
|
|
5266
5282
|
if (n2.children !== n1.children) {
|
|
5267
|
-
|
|
5283
|
+
if (isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
|
|
5284
|
+
const childNodes = container.childNodes;
|
|
5285
|
+
const newChild = hostCreateText(n2.children);
|
|
5286
|
+
const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
|
|
5287
|
+
hostInsert(newChild, container, oldChild);
|
|
5288
|
+
hostRemove(oldChild);
|
|
5289
|
+
} else {
|
|
5290
|
+
hostSetText(el, n2.children);
|
|
5291
|
+
}
|
|
5268
5292
|
}
|
|
5269
5293
|
}
|
|
5270
5294
|
};
|
|
@@ -5650,7 +5674,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5650
5674
|
} else {
|
|
5651
5675
|
if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
|
|
5652
5676
|
// of renderSlot() with no valid children
|
|
5653
|
-
n1.dynamicChildren) {
|
|
5677
|
+
n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
|
|
5654
5678
|
patchBlockChildren(
|
|
5655
5679
|
n1.dynamicChildren,
|
|
5656
5680
|
dynamicChildren,
|
|
@@ -6306,8 +6330,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6306
6330
|
const nextChild = c2[nextIndex];
|
|
6307
6331
|
const anchorVNode = c2[nextIndex + 1];
|
|
6308
6332
|
const anchor = nextIndex + 1 < l2 ? (
|
|
6309
|
-
// #13559, fallback to el placeholder for unresolved async component
|
|
6310
|
-
anchorVNode.el || anchorVNode
|
|
6333
|
+
// #13559, #14173 fallback to el placeholder for unresolved async component
|
|
6334
|
+
anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
|
|
6311
6335
|
) : parentAnchor;
|
|
6312
6336
|
if (newIndexToOldIndexMap[i] === 0) {
|
|
6313
6337
|
patch(
|
|
@@ -6340,7 +6364,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6340
6364
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
6341
6365
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
6342
6366
|
if (shapeFlag & 6) {
|
|
6343
|
-
if (type
|
|
6367
|
+
if (isVaporComponent(type)) {
|
|
6344
6368
|
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
|
|
6345
6369
|
} else {
|
|
6346
6370
|
move(
|
|
@@ -6450,7 +6474,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6450
6474
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
6451
6475
|
}
|
|
6452
6476
|
if (shapeFlag & 256) {
|
|
6453
|
-
if (vnode.type
|
|
6477
|
+
if (isVaporComponent(vnode.type)) {
|
|
6454
6478
|
getVaporInterface(parentComponent, vnode).deactivate(
|
|
6455
6479
|
vnode,
|
|
6456
6480
|
parentComponent.ctx.getStorageContainer()
|
|
@@ -6467,7 +6491,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6467
6491
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
6468
6492
|
}
|
|
6469
6493
|
if (shapeFlag & 6) {
|
|
6470
|
-
if (type
|
|
6494
|
+
if (isVaporComponent(type)) {
|
|
6471
6495
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
6472
6496
|
return;
|
|
6473
6497
|
} else {
|
|
@@ -6599,7 +6623,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6599
6623
|
};
|
|
6600
6624
|
const getNextHostNode = (vnode) => {
|
|
6601
6625
|
if (vnode.shapeFlag & 6) {
|
|
6602
|
-
if (vnode.type
|
|
6626
|
+
if (isVaporComponent(vnode.type)) {
|
|
6603
6627
|
return hostNextSibling(vnode.anchor);
|
|
6604
6628
|
}
|
|
6605
6629
|
return getNextHostNode(vnode.component.subTree);
|
|
@@ -6612,9 +6636,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6612
6636
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
6613
6637
|
};
|
|
6614
6638
|
const render = (vnode, container, namespace) => {
|
|
6639
|
+
let instance;
|
|
6615
6640
|
if (vnode == null) {
|
|
6616
6641
|
if (container._vnode) {
|
|
6617
6642
|
unmount(container._vnode, null, null, true);
|
|
6643
|
+
instance = container._vnode.component;
|
|
6618
6644
|
}
|
|
6619
6645
|
} else {
|
|
6620
6646
|
patch(
|
|
@@ -6628,7 +6654,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6628
6654
|
);
|
|
6629
6655
|
}
|
|
6630
6656
|
container._vnode = vnode;
|
|
6631
|
-
flushOnAppMount();
|
|
6657
|
+
flushOnAppMount(instance);
|
|
6632
6658
|
};
|
|
6633
6659
|
const internals = {
|
|
6634
6660
|
p: patch,
|
|
@@ -6711,9 +6737,13 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
6711
6737
|
if (!shallow && c2.patchFlag !== -2)
|
|
6712
6738
|
traverseStaticChildren(c1, c2);
|
|
6713
6739
|
}
|
|
6714
|
-
if (c2.type === Text
|
|
6715
|
-
|
|
6716
|
-
|
|
6740
|
+
if (c2.type === Text) {
|
|
6741
|
+
if (c2.patchFlag !== -1) {
|
|
6742
|
+
c2.el = c1.el;
|
|
6743
|
+
} else {
|
|
6744
|
+
c2.__elIndex = i + // take fragment start anchor into account
|
|
6745
|
+
(n1.type === Fragment ? 1 : 0);
|
|
6746
|
+
}
|
|
6717
6747
|
}
|
|
6718
6748
|
if (c2.type === Comment && !c2.el) {
|
|
6719
6749
|
c2.el = c1.el;
|
|
@@ -6749,16 +6779,24 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
6749
6779
|
insert();
|
|
6750
6780
|
}
|
|
6751
6781
|
}
|
|
6752
|
-
function performTransitionLeave(el, transition, remove, isElement = true) {
|
|
6782
|
+
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
6753
6783
|
const performRemove = () => {
|
|
6754
6784
|
remove();
|
|
6755
6785
|
if (transition && !transition.persisted && transition.afterLeave) {
|
|
6756
6786
|
transition.afterLeave();
|
|
6757
6787
|
}
|
|
6758
6788
|
};
|
|
6759
|
-
if (isElement && transition && !transition.persisted) {
|
|
6789
|
+
if (force || isElement && transition && !transition.persisted) {
|
|
6760
6790
|
const { leave, delayLeave } = transition;
|
|
6761
|
-
const performLeave = () =>
|
|
6791
|
+
const performLeave = () => {
|
|
6792
|
+
if (el._isLeaving && force) {
|
|
6793
|
+
el[leaveCbKey](
|
|
6794
|
+
true
|
|
6795
|
+
/* cancelled */
|
|
6796
|
+
);
|
|
6797
|
+
}
|
|
6798
|
+
leave(el, performRemove);
|
|
6799
|
+
};
|
|
6762
6800
|
if (delayLeave) {
|
|
6763
6801
|
delayLeave(el, performRemove, performLeave);
|
|
6764
6802
|
} else {
|
|
@@ -6782,6 +6820,12 @@ app.use(vaporInteropPlugin)
|
|
|
6782
6820
|
}
|
|
6783
6821
|
return res;
|
|
6784
6822
|
}
|
|
6823
|
+
function isVaporComponent(type) {
|
|
6824
|
+
if (isHmrUpdating && hmrDirtyComponentsMode.has(type)) {
|
|
6825
|
+
return hmrDirtyComponentsMode.get(type);
|
|
6826
|
+
}
|
|
6827
|
+
return type.__vapor;
|
|
6828
|
+
}
|
|
6785
6829
|
function getInheritedScopeIds(vnode, parentComponent) {
|
|
6786
6830
|
const inheritedScopeIds = [];
|
|
6787
6831
|
let currentParent = parentComponent;
|
|
@@ -6808,6 +6852,16 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
6808
6852
|
}
|
|
6809
6853
|
return inheritedScopeIds;
|
|
6810
6854
|
}
|
|
6855
|
+
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
6856
|
+
if (anchorVnode.placeholder) {
|
|
6857
|
+
return anchorVnode.placeholder;
|
|
6858
|
+
}
|
|
6859
|
+
const instance = anchorVnode.component;
|
|
6860
|
+
if (instance) {
|
|
6861
|
+
return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
6862
|
+
}
|
|
6863
|
+
return null;
|
|
6864
|
+
}
|
|
6811
6865
|
|
|
6812
6866
|
const isSuspense = (type) => type.__isSuspense;
|
|
6813
6867
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
@@ -6822,11 +6876,11 @@ function queueEffectWithSuspense(fn, id, suspense) {
|
|
|
6822
6876
|
}
|
|
6823
6877
|
}
|
|
6824
6878
|
|
|
6825
|
-
const Fragment = Symbol.for("v-fgt");
|
|
6826
|
-
const Text = Symbol.for("v-txt");
|
|
6827
|
-
const Comment = Symbol.for("v-cmt");
|
|
6828
|
-
const Static = Symbol.for("v-stc");
|
|
6829
|
-
const VaporSlot = Symbol.for("v-vps");
|
|
6879
|
+
const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
|
|
6880
|
+
const Text = /* @__PURE__ */ Symbol.for("v-txt");
|
|
6881
|
+
const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
6882
|
+
const Static = /* @__PURE__ */ Symbol.for("v-stc");
|
|
6883
|
+
const VaporSlot = /* @__PURE__ */ Symbol.for("v-vps");
|
|
6830
6884
|
let currentBlock = null;
|
|
6831
6885
|
let isBlockTreeEnabled = 1;
|
|
6832
6886
|
function setBlockTracking(value, inVOnce = false) {
|
|
@@ -7540,7 +7594,7 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
7540
7594
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
7541
7595
|
};
|
|
7542
7596
|
|
|
7543
|
-
const version = "3.6.0-
|
|
7597
|
+
const version = "3.6.0-beta.1";
|
|
7544
7598
|
const warn = warn$1 ;
|
|
7545
7599
|
const _ssrUtils = {
|
|
7546
7600
|
createComponentInstance: createComponentInstance$1,
|
|
@@ -7637,7 +7691,7 @@ const nodeOps = {
|
|
|
7637
7691
|
}
|
|
7638
7692
|
};
|
|
7639
7693
|
|
|
7640
|
-
const vtcKey = Symbol("_vtc");
|
|
7694
|
+
const vtcKey = /* @__PURE__ */ Symbol("_vtc");
|
|
7641
7695
|
|
|
7642
7696
|
function patchClass(el, value, isSVG) {
|
|
7643
7697
|
const transitionClasses = el[vtcKey];
|
|
@@ -7653,10 +7707,10 @@ function patchClass(el, value, isSVG) {
|
|
|
7653
7707
|
}
|
|
7654
7708
|
}
|
|
7655
7709
|
|
|
7656
|
-
const vShowOriginalDisplay = Symbol("_vod");
|
|
7657
|
-
const vShowHidden = Symbol("_vsh");
|
|
7710
|
+
const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
|
|
7711
|
+
const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
|
|
7658
7712
|
|
|
7659
|
-
const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
|
|
7713
|
+
const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("CSS_VAR_TEXT" );
|
|
7660
7714
|
|
|
7661
7715
|
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
7662
7716
|
function patchStyle(el, prev, next) {
|
|
@@ -7834,7 +7888,7 @@ function addEventListener(el, event, handler, options) {
|
|
|
7834
7888
|
function removeEventListener(el, event, handler, options) {
|
|
7835
7889
|
el.removeEventListener(event, handler, options);
|
|
7836
7890
|
}
|
|
7837
|
-
const veiKey = Symbol("_vei");
|
|
7891
|
+
const veiKey = /* @__PURE__ */ Symbol("_vei");
|
|
7838
7892
|
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
7839
7893
|
const invokers = el[veiKey] || (el[veiKey] = {});
|
|
7840
7894
|
const existingInvoker = invokers[rawName];
|