@vue/server-renderer 3.6.0-rc.11 → 3.6.0-rc.12
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/server-renderer.cjs.js +62 -27
- package/dist/server-renderer.cjs.prod.js +66 -29
- package/dist/server-renderer.d.ts +3 -2
- package/dist/server-renderer.esm-browser.js +215 -85
- package/dist/server-renderer.esm-browser.prod.js +2 -2
- package/dist/server-renderer.esm-bundler.js +63 -30
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/server-renderer v3.6.0-rc.
|
|
2
|
+
* @vue/server-renderer v3.6.0-rc.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -210,9 +210,10 @@ const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
|
|
|
210
210
|
* - ismap -> isMap
|
|
211
211
|
* - nomodule -> noModule
|
|
212
212
|
* - novalidate -> noValidate
|
|
213
|
+
* - playsinline -> playsInline
|
|
213
214
|
* - readonly -> readOnly
|
|
214
215
|
*/
|
|
215
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
216
|
+
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
216
217
|
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
217
218
|
/**
|
|
218
219
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
@@ -941,17 +942,33 @@ const arrayInstrumentations = {
|
|
|
941
942
|
};
|
|
942
943
|
function iterator(self, method, wrapValue) {
|
|
943
944
|
const arr = shallowReadArray(self);
|
|
944
|
-
const
|
|
945
|
+
const methodFn = arr[method];
|
|
946
|
+
const iter = methodFn.call(arr);
|
|
945
947
|
if (arr !== self && !/* @__PURE__ */ isShallow(self)) {
|
|
948
|
+
if (iter[Symbol.toStringTag] === "Array Iterator") {
|
|
949
|
+
const wrapped = Object.create(Object.getPrototypeOf(iter));
|
|
950
|
+
wrapped.next = () => wrapResult(iter.next(), wrapValue);
|
|
951
|
+
if (methodFn !== arrayProto[method]) Object.defineProperties(wrapped, {
|
|
952
|
+
return: { get() {
|
|
953
|
+
const fn = iter.return;
|
|
954
|
+
return typeof fn === "function" ? fn.bind(iter) : fn;
|
|
955
|
+
} },
|
|
956
|
+
throw: { get() {
|
|
957
|
+
const fn = iter.throw;
|
|
958
|
+
return typeof fn === "function" ? fn.bind(iter) : fn;
|
|
959
|
+
} }
|
|
960
|
+
});
|
|
961
|
+
return wrapped;
|
|
962
|
+
}
|
|
946
963
|
iter._next = iter.next;
|
|
947
|
-
iter.next = () =>
|
|
948
|
-
const result = iter._next();
|
|
949
|
-
if (!result.done) result.value = wrapValue(result.value);
|
|
950
|
-
return result;
|
|
951
|
-
};
|
|
964
|
+
iter.next = () => wrapResult(iter._next(), wrapValue);
|
|
952
965
|
}
|
|
953
966
|
return iter;
|
|
954
967
|
}
|
|
968
|
+
function wrapResult(result, wrapValue) {
|
|
969
|
+
if (!result.done) result.value = wrapValue(result.value);
|
|
970
|
+
return result;
|
|
971
|
+
}
|
|
955
972
|
const arrayProto = Array.prototype;
|
|
956
973
|
function apply(self, method, fn, thisArg, wrappedRetFn, args) {
|
|
957
974
|
const arr = shallowReadArray(self);
|
|
@@ -1269,6 +1286,7 @@ function createInstrumentationGetter(isReadonly, shallow) {
|
|
|
1269
1286
|
return (target, key, receiver) => {
|
|
1270
1287
|
if (key === "__v_isReactive") return !isReadonly;
|
|
1271
1288
|
else if (key === "__v_isReadonly") return isReadonly;
|
|
1289
|
+
else if (key === "__v_isShallow") return shallow;
|
|
1272
1290
|
else if (key === "__v_raw") return target;
|
|
1273
1291
|
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
1274
1292
|
};
|
|
@@ -1861,8 +1879,9 @@ let activeWatcher = void 0;
|
|
|
1861
1879
|
function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
|
|
1862
1880
|
if (owner) {
|
|
1863
1881
|
const { call } = owner.options;
|
|
1864
|
-
|
|
1865
|
-
|
|
1882
|
+
const cleanup = call ? () => call(cleanupFn, 4) : cleanupFn;
|
|
1883
|
+
if (owner.cb) (owner.cbCleanups || (owner.cbCleanups = [])).push(cleanup);
|
|
1884
|
+
else owner.cleanups[owner.cleanupsLength++] = cleanup;
|
|
1866
1885
|
} else if (!failSilently) warn$2("onWatcherCleanup() was called when there was no active watcher to associate with.");
|
|
1867
1886
|
}
|
|
1868
1887
|
var WatcherEffect = class extends ReactiveEffect {
|
|
@@ -1923,9 +1942,11 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
1923
1942
|
if (once && cb) {
|
|
1924
1943
|
const _cb = cb;
|
|
1925
1944
|
cb = (...args) => {
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1945
|
+
try {
|
|
1946
|
+
return _cb(...args);
|
|
1947
|
+
} finally {
|
|
1948
|
+
this.stop();
|
|
1949
|
+
}
|
|
1929
1950
|
};
|
|
1930
1951
|
}
|
|
1931
1952
|
this.cb = cb;
|
|
@@ -1933,6 +1954,19 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
1933
1954
|
this.onTrack = options.onTrack;
|
|
1934
1955
|
this.onTrigger = options.onTrigger;
|
|
1935
1956
|
}
|
|
1957
|
+
cleanupCallback() {
|
|
1958
|
+
const cleanups = this.cbCleanups;
|
|
1959
|
+
if (cleanups) {
|
|
1960
|
+
this.cbCleanups = void 0;
|
|
1961
|
+
for (let i = 0, l = cleanups.length; i < l; i++) cleanups[i]();
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
stop() {
|
|
1965
|
+
if (this.active) {
|
|
1966
|
+
super.stop();
|
|
1967
|
+
this.cleanupCallback();
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1936
1970
|
run(initialRun = false) {
|
|
1937
1971
|
const oldValue = this.oldValue;
|
|
1938
1972
|
const newValue = this.oldValue = super.run();
|
|
@@ -1940,10 +1974,11 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
1940
1974
|
const { immediate, deep, call } = this.options;
|
|
1941
1975
|
if (initialRun && !immediate) return;
|
|
1942
1976
|
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
1943
|
-
cleanup(this);
|
|
1944
1977
|
const currentWatcher = activeWatcher;
|
|
1945
|
-
|
|
1978
|
+
const prevSub = setActiveSub();
|
|
1946
1979
|
try {
|
|
1980
|
+
this.cleanupCallback();
|
|
1981
|
+
activeWatcher = this;
|
|
1947
1982
|
const args = [
|
|
1948
1983
|
newValue,
|
|
1949
1984
|
oldValue === INITIAL_WATCHER_VALUE ? void 0 : this.isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
|
|
@@ -1952,6 +1987,7 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
1952
1987
|
call ? call(this.cb, 3, args) : this.cb(...args);
|
|
1953
1988
|
} finally {
|
|
1954
1989
|
activeWatcher = currentWatcher;
|
|
1990
|
+
setActiveSub(prevSub);
|
|
1955
1991
|
}
|
|
1956
1992
|
}
|
|
1957
1993
|
}
|
|
@@ -2244,15 +2280,15 @@ function queuePostFlushCb(jobs, id = Infinity) {
|
|
|
2244
2280
|
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
2245
2281
|
queueFlush();
|
|
2246
2282
|
}
|
|
2247
|
-
function flushPreFlushCbs(instance, seen) {
|
|
2283
|
+
function flushPreFlushCbs(instance, minUid, seen) {
|
|
2248
2284
|
seen = seen || /* @__PURE__ */ new Map();
|
|
2249
2285
|
for (let i = flushIndex; i < jobsLength; i++) {
|
|
2250
2286
|
const cb = jobs[i];
|
|
2251
2287
|
if (cb.order & 1 || cb.order === Infinity) continue;
|
|
2252
|
-
if (instance && cb.order !== instance.uid * 2) continue;
|
|
2288
|
+
if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
|
|
2253
2289
|
if (checkRecursiveUpdates(seen, cb)) continue;
|
|
2254
2290
|
jobs.splice(i, 1);
|
|
2255
|
-
i
|
|
2291
|
+
i = instance ? i - 1 : flushIndex - 1;
|
|
2256
2292
|
jobsLength--;
|
|
2257
2293
|
if (cb.flags & 2) cb.flags &= -2;
|
|
2258
2294
|
try {
|
|
@@ -2262,15 +2298,24 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
2262
2298
|
}
|
|
2263
2299
|
}
|
|
2264
2300
|
}
|
|
2265
|
-
function flushPostFlushCbs(seen) {
|
|
2301
|
+
function flushPostFlushCbs(seen, skip, minUid = 0) {
|
|
2266
2302
|
if (postJobs.length) {
|
|
2303
|
+
let cbs = postJobs;
|
|
2304
|
+
if (skip) {
|
|
2305
|
+
cbs = [];
|
|
2306
|
+
let kept = 0;
|
|
2307
|
+
for (let i = 0; i < postJobs.length; i++) {
|
|
2308
|
+
const cb = postJobs[i];
|
|
2309
|
+
if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
|
|
2310
|
+
else cbs.push(cb);
|
|
2311
|
+
}
|
|
2312
|
+
postJobs.length = kept;
|
|
2313
|
+
} else postJobs = [];
|
|
2267
2314
|
if (activePostJobs) {
|
|
2268
|
-
for (let i = 0; i <
|
|
2269
|
-
postJobs.length = 0;
|
|
2315
|
+
for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
|
|
2270
2316
|
return;
|
|
2271
2317
|
}
|
|
2272
|
-
activePostJobs =
|
|
2273
|
-
postJobs = [];
|
|
2318
|
+
activePostJobs = cbs;
|
|
2274
2319
|
seen = seen || /* @__PURE__ */ new Map();
|
|
2275
2320
|
try {
|
|
2276
2321
|
while (postFlushIndex < activePostJobs.length) {
|
|
@@ -2292,17 +2337,28 @@ function flushPostFlushCbs(seen) {
|
|
|
2292
2337
|
}
|
|
2293
2338
|
let isFlushing = false;
|
|
2294
2339
|
/**
|
|
2340
|
+
* Run a root render, then flush the jobs it is responsible for. A mount or
|
|
2341
|
+
* unmount (`minUid` given) only flushes the jobs of the components it created
|
|
2342
|
+
* and the post cbs it queued, so pre watchers triggered in setup run before
|
|
2343
|
+
* mounted (#5721) while the jobs of other components stay in the queue and
|
|
2344
|
+
* keep their order (#6728). A root update keeps flushing all pending pre jobs
|
|
2345
|
+
* and post cbs, as the jobs of the components it re-renders may predate it.
|
|
2346
|
+
*
|
|
2295
2347
|
* @internal
|
|
2296
2348
|
*/
|
|
2297
|
-
function flushOnAppMount(
|
|
2298
|
-
if (
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2349
|
+
function flushOnAppMount(fn, minUid) {
|
|
2350
|
+
if (isFlushing) {
|
|
2351
|
+
fn();
|
|
2352
|
+
return;
|
|
2353
|
+
}
|
|
2354
|
+
const queued = minUid === void 0 ? void 0 : new Set(postJobs);
|
|
2355
|
+
fn();
|
|
2356
|
+
isFlushing = true;
|
|
2357
|
+
try {
|
|
2358
|
+
flushPreFlushCbs(void 0, minUid);
|
|
2359
|
+
flushPostFlushCbs(void 0, queued, minUid);
|
|
2360
|
+
} finally {
|
|
2361
|
+
isFlushing = false;
|
|
2306
2362
|
}
|
|
2307
2363
|
}
|
|
2308
2364
|
function flushJobs(seen) {
|
|
@@ -2703,7 +2759,7 @@ var RenderWatcherEffect = class extends WatcherEffect {
|
|
|
2703
2759
|
this.flags |= 128;
|
|
2704
2760
|
job.flags |= 2;
|
|
2705
2761
|
}
|
|
2706
|
-
|
|
2762
|
+
job.i = instance;
|
|
2707
2763
|
this.job = job;
|
|
2708
2764
|
}
|
|
2709
2765
|
notify() {
|
|
@@ -2823,9 +2879,23 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
2823
2879
|
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
2824
2880
|
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
2825
2881
|
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
2826
|
-
} else
|
|
2882
|
+
} else {
|
|
2883
|
+
vnode.transition = hooks;
|
|
2884
|
+
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
2885
|
+
const child = filterSingleRoot(vnode.children, false);
|
|
2886
|
+
if (child) setTransitionHooks(child, hooks);
|
|
2887
|
+
}
|
|
2888
|
+
}
|
|
2827
2889
|
return hooks;
|
|
2828
2890
|
}
|
|
2891
|
+
function getTransitionRoot(vnode) {
|
|
2892
|
+
if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
|
|
2893
|
+
if (vnode.type === Fragment) {
|
|
2894
|
+
const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
2895
|
+
return child ? getTransitionRoot(child) : void 0;
|
|
2896
|
+
}
|
|
2897
|
+
if (vnode.type !== Comment) return vnode;
|
|
2898
|
+
}
|
|
2829
2899
|
//#endregion
|
|
2830
2900
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
2831
2901
|
/**
|
|
@@ -3065,6 +3135,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
3065
3135
|
owner: currentRenderingInstance
|
|
3066
3136
|
}] : void 0
|
|
3067
3137
|
};
|
|
3138
|
+
if (branchKey != null && props.key == null) {
|
|
3139
|
+
ret.vs.props = ret.props;
|
|
3140
|
+
ret.props = extend({}, ret.props, { key: branchKey });
|
|
3141
|
+
ret.key = branchKey;
|
|
3142
|
+
}
|
|
3068
3143
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
3069
3144
|
return ret;
|
|
3070
3145
|
}
|
|
@@ -3965,7 +4040,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3965
4040
|
if (nextKeys.length !== Object.keys(prevProps).length) return true;
|
|
3966
4041
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
3967
4042
|
const key = nextKeys[i];
|
|
3968
|
-
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
4043
|
+
if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
3969
4044
|
}
|
|
3970
4045
|
return false;
|
|
3971
4046
|
}
|
|
@@ -4645,7 +4720,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4645
4720
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4646
4721
|
const oldVNode = oldChildren[i];
|
|
4647
4722
|
const newVNode = newChildren[i];
|
|
4648
|
-
const
|
|
4723
|
+
const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
|
|
4724
|
+
const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
|
|
4649
4725
|
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4650
4726
|
}
|
|
4651
4727
|
};
|
|
@@ -4737,6 +4813,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4737
4813
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4738
4814
|
pushWarningContext$1(n2);
|
|
4739
4815
|
n2.el = n1.el;
|
|
4816
|
+
n2.placeholder = n1.placeholder;
|
|
4740
4817
|
updateComponentPreRender(instance, n2, optimized);
|
|
4741
4818
|
popWarningContext$1();
|
|
4742
4819
|
return;
|
|
@@ -4746,6 +4823,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4746
4823
|
}
|
|
4747
4824
|
} else {
|
|
4748
4825
|
n2.el = n1.el;
|
|
4826
|
+
n2.placeholder = n1.placeholder;
|
|
4749
4827
|
instance.vnode = n2;
|
|
4750
4828
|
}
|
|
4751
4829
|
};
|
|
@@ -5090,12 +5168,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5090
5168
|
};
|
|
5091
5169
|
const remove = (vnode) => {
|
|
5092
5170
|
const { type, el, anchor, transition } = vnode;
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
else remove(child);
|
|
5097
|
-
});
|
|
5098
|
-
else removeFragment(el, anchor);
|
|
5171
|
+
const isFragment = type === Fragment;
|
|
5172
|
+
if (isFragment && !transition) {
|
|
5173
|
+
removeFragment(el, anchor);
|
|
5099
5174
|
return;
|
|
5100
5175
|
}
|
|
5101
5176
|
if (type === Static) {
|
|
@@ -5103,8 +5178,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5103
5178
|
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5104
5179
|
return;
|
|
5105
5180
|
}
|
|
5106
|
-
|
|
5107
|
-
|
|
5181
|
+
const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
|
|
5182
|
+
const performRemove = () => {
|
|
5183
|
+
if (isFragment) {
|
|
5184
|
+
if (hostParentNode(el)) removeFragment(el, anchor);
|
|
5185
|
+
} else hostRemove(el);
|
|
5186
|
+
};
|
|
5187
|
+
if (transition) {
|
|
5188
|
+
let leavingEl = leavingNode && leavingNode.el;
|
|
5189
|
+
let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
|
|
5190
|
+
if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
|
|
5191
|
+
leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
|
|
5192
|
+
isElement = !!leavingEl;
|
|
5193
|
+
}
|
|
5194
|
+
performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
|
|
5195
|
+
} else performRemove();
|
|
5108
5196
|
};
|
|
5109
5197
|
const removeFragment = (cur, end) => {
|
|
5110
5198
|
let next;
|
|
@@ -5147,15 +5235,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5147
5235
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
5148
5236
|
};
|
|
5149
5237
|
const render = (vnode, container, namespace) => {
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
5157
|
-
container._vnode = vnode;
|
|
5158
|
-
flushOnAppMount(instance);
|
|
5238
|
+
flushOnAppMount(() => {
|
|
5239
|
+
if (vnode == null) {
|
|
5240
|
+
if (container._vnode) unmount(container._vnode, null, null, true);
|
|
5241
|
+
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
5242
|
+
container._vnode = vnode;
|
|
5243
|
+
}, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
|
|
5159
5244
|
};
|
|
5160
5245
|
const internals = {
|
|
5161
5246
|
p: patch,
|
|
@@ -5553,7 +5638,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5553
5638
|
ctx: vnode.ctx,
|
|
5554
5639
|
ce: vnode.ce,
|
|
5555
5640
|
vi: vnode.vi,
|
|
5556
|
-
vs: cloneVaporSlotMeta(vnode),
|
|
5641
|
+
vs: cloneVaporSlotMeta(vnode, extraProps),
|
|
5557
5642
|
vb: vnode.vb,
|
|
5558
5643
|
ibu: vnode.ibu,
|
|
5559
5644
|
iu: vnode.iu,
|
|
@@ -5562,13 +5647,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5562
5647
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5563
5648
|
return cloned;
|
|
5564
5649
|
}
|
|
5565
|
-
function cloneVaporSlotMeta(vnode) {
|
|
5650
|
+
function cloneVaporSlotMeta(vnode, extraProps) {
|
|
5566
5651
|
const vaporSlot = vnode.vs;
|
|
5567
5652
|
if (!vaporSlot) return vaporSlot;
|
|
5568
5653
|
const cloned = {
|
|
5569
5654
|
slot: vaporSlot.slot,
|
|
5570
|
-
outlets: vaporSlot.outlets
|
|
5655
|
+
outlets: vaporSlot.outlets,
|
|
5656
|
+
props: vaporSlot.props
|
|
5571
5657
|
};
|
|
5658
|
+
if (vaporSlot.props && extraProps) {
|
|
5659
|
+
let extraSlotProps;
|
|
5660
|
+
for (const key in extraProps) if (key !== "key") {
|
|
5661
|
+
if (!extraSlotProps) extraSlotProps = {};
|
|
5662
|
+
extraSlotProps[key] = extraProps[key];
|
|
5663
|
+
}
|
|
5664
|
+
if (extraSlotProps) cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
|
|
5665
|
+
}
|
|
5572
5666
|
if (vnode.el) {
|
|
5573
5667
|
cloned.state = vaporSlot.state;
|
|
5574
5668
|
cloned.ref = vaporSlot.ref;
|
|
@@ -5717,6 +5811,9 @@ const restoreCurrentInstance = (prev) => {
|
|
|
5717
5811
|
//#region packages/runtime-core/src/component.ts
|
|
5718
5812
|
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
5719
5813
|
let uid = 0;
|
|
5814
|
+
function getNextUid() {
|
|
5815
|
+
return uid;
|
|
5816
|
+
}
|
|
5720
5817
|
function createComponentInstance$1(vnode, parent, suspense) {
|
|
5721
5818
|
const type = vnode.type;
|
|
5722
5819
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
@@ -5993,7 +6090,7 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
5993
6090
|
};
|
|
5994
6091
|
//#endregion
|
|
5995
6092
|
//#region packages/runtime-core/src/index.ts
|
|
5996
|
-
const version = "3.6.0-rc.
|
|
6093
|
+
const version = "3.6.0-rc.12";
|
|
5997
6094
|
const warn = warn$1;
|
|
5998
6095
|
/**
|
|
5999
6096
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
@@ -6164,7 +6261,7 @@ function patchStyle(el, prev, next) {
|
|
|
6164
6261
|
else el.removeAttribute("style");
|
|
6165
6262
|
}
|
|
6166
6263
|
if (vShowOriginalDisplay in el) {
|
|
6167
|
-
el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
|
|
6264
|
+
if (!isCssString || prev !== next) el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
|
|
6168
6265
|
if (el[vShowHidden]) style.display = "none";
|
|
6169
6266
|
}
|
|
6170
6267
|
}
|
|
@@ -7048,15 +7145,20 @@ function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
|
|
|
7048
7145
|
popWarningContext();
|
|
7049
7146
|
const hasAsyncSetup = isPromise(res);
|
|
7050
7147
|
let prefetches = instance.sp;
|
|
7051
|
-
|
|
7148
|
+
let p;
|
|
7149
|
+
if (hasAsyncSetup || prefetches) p = Promise.resolve(res).then(() => {
|
|
7052
7150
|
if (hasAsyncSetup) prefetches = instance.sp;
|
|
7053
|
-
if (prefetches)
|
|
7054
|
-
|
|
7151
|
+
if (prefetches) try {
|
|
7152
|
+
return Promise.all(prefetches.map((prefetch) => prefetch.call(instance.proxy))).catch(NOOP);
|
|
7153
|
+
} catch {}
|
|
7154
|
+
}).then(() => renderComponentSubTree(instance, slotScopeId));
|
|
7055
7155
|
else try {
|
|
7056
7156
|
return renderComponentSubTree(instance, slotScopeId);
|
|
7057
7157
|
} catch (err) {
|
|
7058
|
-
|
|
7158
|
+
p = Promise.reject(err);
|
|
7059
7159
|
}
|
|
7160
|
+
p.catch(NOOP);
|
|
7161
|
+
return p;
|
|
7060
7162
|
}
|
|
7061
7163
|
function renderComponentSubTree(instance, slotScopeId) {
|
|
7062
7164
|
pushWarningContext(instance.vnode);
|
|
@@ -7139,8 +7241,8 @@ function renderVNode(push, vnode, parentComponent, slotScopeId) {
|
|
|
7139
7241
|
}
|
|
7140
7242
|
case VaporSlot: {
|
|
7141
7243
|
if (vnode.slotScopeIds) slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" ");
|
|
7142
|
-
const { slot, outlets } = vnode.vs;
|
|
7143
|
-
renderVaporOutlet(push, slot, vnode.props, outlets && outlets[0], parentComponent, slotScopeId);
|
|
7244
|
+
const { slot, outlets, props } = vnode.vs;
|
|
7245
|
+
renderVaporOutlet(push, slot, props || vnode.props, outlets && outlets[0], parentComponent, slotScopeId);
|
|
7144
7246
|
break;
|
|
7145
7247
|
}
|
|
7146
7248
|
default: if (shapeFlag & 1) renderElementVNode(push, vnode, parentComponent, slotScopeId);
|
|
@@ -7158,7 +7260,13 @@ function renderVaporOutlet(push, slot, props, outlet, parentComponent, slotScope
|
|
|
7158
7260
|
function renderVNodeChildren(push, children, parentComponent, slotScopeId) {
|
|
7159
7261
|
for (let i = 0; i < children.length; i++) renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId);
|
|
7160
7262
|
}
|
|
7161
|
-
function
|
|
7263
|
+
function renderDynamicComponent(push, type, props, slots, parentComponent, slotScopeId) {
|
|
7264
|
+
if (isString(type) && type) {
|
|
7265
|
+
const slot = slots && slots.default;
|
|
7266
|
+
renderElementVNode(push, createVNode(type, props), parentComponent, slotScopeId, slot && (() => slot(void 0, push, parentComponent, slotScopeId || "")));
|
|
7267
|
+
} else renderVNode(push, createVNode(type, props, slots), parentComponent, slotScopeId);
|
|
7268
|
+
}
|
|
7269
|
+
function renderElementVNode(push, vnode, parentComponent, slotScopeId, renderChildren) {
|
|
7162
7270
|
const tag = vnode.type;
|
|
7163
7271
|
let { props, children, shapeFlag, scopeId } = vnode;
|
|
7164
7272
|
let openTag = `<${tag}`;
|
|
@@ -7186,19 +7294,20 @@ function renderElementVNode(push, vnode, parentComponent, slotScopeId) {
|
|
|
7186
7294
|
if (!isVoidTag(tag)) {
|
|
7187
7295
|
let hasChildrenOverride = false;
|
|
7188
7296
|
if (props) {
|
|
7189
|
-
if (props.innerHTML) {
|
|
7297
|
+
if (props.innerHTML != null) {
|
|
7190
7298
|
hasChildrenOverride = true;
|
|
7191
|
-
push(props.innerHTML);
|
|
7192
|
-
} else if (props.textContent) {
|
|
7299
|
+
push(String(props.innerHTML));
|
|
7300
|
+
} else if (props.textContent != null) {
|
|
7193
7301
|
hasChildrenOverride = true;
|
|
7194
7302
|
push(escapeHtml(props.textContent));
|
|
7195
|
-
} else if (tag === "textarea" && props.value) {
|
|
7303
|
+
} else if (tag === "textarea" && props.value != null) {
|
|
7196
7304
|
hasChildrenOverride = true;
|
|
7197
7305
|
push(escapeHtml(props.value));
|
|
7198
7306
|
}
|
|
7199
7307
|
}
|
|
7200
7308
|
if (!hasChildrenOverride) {
|
|
7201
|
-
if (
|
|
7309
|
+
if (renderChildren) renderChildren();
|
|
7310
|
+
else if (shapeFlag & 8) push(escapeHtml(children));
|
|
7202
7311
|
else if (shapeFlag & 16) renderVNodeChildren(push, children, parentComponent, slotScopeId);
|
|
7203
7312
|
}
|
|
7204
7313
|
push(`</${tag}>`);
|
|
@@ -7273,13 +7382,41 @@ async function renderToString(input, context = {}) {
|
|
|
7273
7382
|
const vnode = createVNode(input._component, input._props);
|
|
7274
7383
|
vnode.appContext = input._context;
|
|
7275
7384
|
input.provide(ssrContextKey, context);
|
|
7385
|
+
let buffer;
|
|
7386
|
+
let result;
|
|
7276
7387
|
try {
|
|
7277
|
-
|
|
7388
|
+
buffer = await renderComponentVNode(vnode);
|
|
7389
|
+
result = await unrollBuffer$1(buffer);
|
|
7278
7390
|
await resolveTeleports(context);
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7391
|
+
} catch (err) {
|
|
7392
|
+
cleanupFailedRender(buffer, context);
|
|
7393
|
+
throw err;
|
|
7282
7394
|
}
|
|
7395
|
+
cleanupContext(context);
|
|
7396
|
+
return result;
|
|
7397
|
+
}
|
|
7398
|
+
/**
|
|
7399
|
+
* Stops watchers without masking the render error. Components after the
|
|
7400
|
+
* failure point are still in flight and can register watchers once the render
|
|
7401
|
+
* has settled, so those are stopped when they finish.
|
|
7402
|
+
* Cleanup errors here have already been reported by the watcher.
|
|
7403
|
+
*/
|
|
7404
|
+
function cleanupFailedRender(buffer, context) {
|
|
7405
|
+
try {
|
|
7406
|
+
cleanupContext(context);
|
|
7407
|
+
} catch {}
|
|
7408
|
+
(async () => {
|
|
7409
|
+
if (buffer) await settleBuffer(buffer);
|
|
7410
|
+
for (const key in context.__teleportBuffers) await settleBuffer(context.__teleportBuffers[key]);
|
|
7411
|
+
cleanupContext(context);
|
|
7412
|
+
})().catch(NOOP);
|
|
7413
|
+
}
|
|
7414
|
+
async function settleBuffer(buffer) {
|
|
7415
|
+
if (!buffer.hasAsync) return;
|
|
7416
|
+
for (let item of buffer) try {
|
|
7417
|
+
if (isPromise(item)) item = await item;
|
|
7418
|
+
if (!isString(item)) await settleBuffer(item);
|
|
7419
|
+
} catch {}
|
|
7283
7420
|
}
|
|
7284
7421
|
async function resolveTeleports(context) {
|
|
7285
7422
|
if (context.__teleportBuffers) {
|
|
@@ -7311,19 +7448,12 @@ function renderToSimpleStream(input, context, stream) {
|
|
|
7311
7448
|
const vnode = createVNode(input._component, input._props);
|
|
7312
7449
|
vnode.appContext = input._context;
|
|
7313
7450
|
input.provide(ssrContextKey, context);
|
|
7314
|
-
let
|
|
7315
|
-
|
|
7316
|
-
if (cleaned) return;
|
|
7317
|
-
cleaned = true;
|
|
7451
|
+
let buffer;
|
|
7452
|
+
Promise.resolve().then(() => renderComponentVNode(vnode)).then((b) => unrollBuffer(buffer = b, stream)).then(() => resolveTeleports(context)).then(() => {
|
|
7318
7453
|
cleanupContext(context);
|
|
7319
|
-
};
|
|
7320
|
-
Promise.resolve().then(() => renderComponentVNode(vnode)).then((buffer) => unrollBuffer(buffer, stream)).then(() => resolveTeleports(context)).then(() => {
|
|
7321
|
-
finalize();
|
|
7322
7454
|
return stream.push(null);
|
|
7323
7455
|
}).catch((error) => {
|
|
7324
|
-
|
|
7325
|
-
finalize();
|
|
7326
|
-
} catch {}
|
|
7456
|
+
cleanupFailedRender(buffer, context);
|
|
7327
7457
|
stream.destroy(error);
|
|
7328
7458
|
});
|
|
7329
7459
|
return stream;
|
|
@@ -7394,4 +7524,4 @@ function pipeToWebWritable(input, context = {}, writable) {
|
|
|
7394
7524
|
//#region packages/server-renderer/src/index.ts
|
|
7395
7525
|
initDirectivesForSSR();
|
|
7396
7526
|
//#endregion
|
|
7397
|
-
export { pipeToNodeWritable, pipeToWebWritable, renderToNodeStream, renderToSimpleStream, renderToStream, renderToString, renderToWebStream, ssrGetDirectiveProps, ssrGetDynamicModelProps, includeBooleanAttr as ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderAttrs, ssrRenderClass, ssrRenderComponent, ssrRenderDynamicAttr, ssrRenderDynamicModel, ssrRenderList, ssrRenderSlot, ssrRenderSlotInner, ssrRenderStyle, ssrRenderSuspense, ssrRenderTeleport, renderVNode as ssrRenderVNode };
|
|
7527
|
+
export { pipeToNodeWritable, pipeToWebWritable, renderToNodeStream, renderToSimpleStream, renderToStream, renderToString, renderToWebStream, ssrGetDirectiveProps, ssrGetDynamicModelProps, includeBooleanAttr as ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderAttrs, ssrRenderClass, ssrRenderComponent, ssrRenderDynamicAttr, renderDynamicComponent as ssrRenderDynamicComponent, ssrRenderDynamicModel, ssrRenderList, ssrRenderSlot, ssrRenderSlotInner, ssrRenderStyle, ssrRenderSuspense, ssrRenderTeleport, renderVNode as ssrRenderVNode };
|