🔧 npm update
This commit is contained in:
211
node_modules/@vue/server-renderer/dist/server-renderer.cjs.js
generated
vendored
211
node_modules/@vue/server-renderer/dist/server-renderer.cjs.js
generated
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/server-renderer v3.4.15
|
||||
* @vue/server-renderer v3.5.13
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -24,7 +24,7 @@ function _interopNamespaceDefault(e) {
|
||||
|
||||
var Vue__namespace = /*#__PURE__*/_interopNamespaceDefault(Vue);
|
||||
|
||||
const shouldIgnoreProp = shared.makeMap(
|
||||
const shouldIgnoreProp = /* @__PURE__ */ shared.makeMap(
|
||||
`,key,ref,innerHTML,textContent,ref_key,ref_for`
|
||||
);
|
||||
function ssrRenderAttrs(props, tag) {
|
||||
@@ -38,6 +38,8 @@ function ssrRenderAttrs(props, tag) {
|
||||
ret += ` class="${ssrRenderClass(value)}"`;
|
||||
} else if (key === "style") {
|
||||
ret += ` style="${ssrRenderStyle(value)}"`;
|
||||
} else if (key === "className") {
|
||||
ret += ` class="${String(value)}"`;
|
||||
} else {
|
||||
ret += ssrRenderDynamicAttr(key, value, tag);
|
||||
}
|
||||
@@ -88,6 +90,7 @@ function ssrRenderComponent(comp, props = null, children = null, parentComponent
|
||||
);
|
||||
}
|
||||
|
||||
const { ensureValidVNode } = Vue.ssrUtils;
|
||||
function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) {
|
||||
push(`<!--[-->`);
|
||||
ssrRenderSlotInner(
|
||||
@@ -115,7 +118,17 @@ function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push,
|
||||
slotScopeId ? " " + slotScopeId : ""
|
||||
);
|
||||
if (shared.isArray(ret)) {
|
||||
renderVNodeChildren(push, ret, parentComponent, slotScopeId);
|
||||
const validSlotContent = ensureValidVNode(ret);
|
||||
if (validSlotContent) {
|
||||
renderVNodeChildren(
|
||||
push,
|
||||
validSlotContent,
|
||||
parentComponent,
|
||||
slotScopeId
|
||||
);
|
||||
} else if (fallbackRenderFn) {
|
||||
fallbackRenderFn();
|
||||
}
|
||||
} else {
|
||||
let isEmptySlot = true;
|
||||
if (transition) {
|
||||
@@ -148,13 +161,11 @@ function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push,
|
||||
fallbackRenderFn();
|
||||
}
|
||||
}
|
||||
const commentTestRE = /^<!--.*-->$/s;
|
||||
const commentTestRE = /^<!--[\s\S]*-->$/;
|
||||
const commentRE = /<!--[^]*?-->/gm;
|
||||
function isComment(item) {
|
||||
if (typeof item !== "string" || !commentTestRE.test(item))
|
||||
return false;
|
||||
if (item.length <= 8)
|
||||
return true;
|
||||
if (typeof item !== "string" || !commentTestRE.test(item)) return false;
|
||||
if (item.length <= 8) return true;
|
||||
return !item.replace(commentRE, "").trim();
|
||||
}
|
||||
|
||||
@@ -167,9 +178,10 @@ function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parent
|
||||
let teleportContent;
|
||||
if (disabled) {
|
||||
contentRenderFn(parentPush);
|
||||
teleportContent = `<!--teleport anchor-->`;
|
||||
teleportContent = `<!--teleport start anchor--><!--teleport anchor-->`;
|
||||
} else {
|
||||
const { getBuffer, push } = createBuffer();
|
||||
push(`<!--teleport start anchor-->`);
|
||||
contentRenderFn(push);
|
||||
push(`<!--teleport anchor-->`);
|
||||
teleportContent = getBuffer();
|
||||
@@ -182,35 +194,26 @@ function ssrInterpolate(value) {
|
||||
return shared.escapeHtml(shared.toDisplayString(value));
|
||||
}
|
||||
|
||||
let shouldTrack = true;
|
||||
const trackStack = [];
|
||||
function pauseTracking() {
|
||||
trackStack.push(shouldTrack);
|
||||
shouldTrack = false;
|
||||
}
|
||||
function resetTracking() {
|
||||
const last = trackStack.pop();
|
||||
shouldTrack = last === void 0 ? true : last;
|
||||
}
|
||||
|
||||
function toRaw(observed) {
|
||||
const raw = observed && observed["__v_raw"];
|
||||
return raw ? toRaw(raw) : observed;
|
||||
}
|
||||
|
||||
function isRef(r) {
|
||||
return !!(r && r.__v_isRef === true);
|
||||
return r ? r["__v_isRef"] === true : false;
|
||||
}
|
||||
|
||||
const stack = [];
|
||||
function pushWarningContext(vnode) {
|
||||
function pushWarningContext$1(vnode) {
|
||||
stack.push(vnode);
|
||||
}
|
||||
function popWarningContext() {
|
||||
function popWarningContext$1() {
|
||||
stack.pop();
|
||||
}
|
||||
let isWarning = false;
|
||||
function warn$1(msg, ...args) {
|
||||
pauseTracking();
|
||||
if (isWarning) return;
|
||||
isWarning = true;
|
||||
const instance = stack.length ? stack[stack.length - 1].component : null;
|
||||
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
||||
const trace = getComponentTrace();
|
||||
@@ -220,7 +223,11 @@ function warn$1(msg, ...args) {
|
||||
instance,
|
||||
11,
|
||||
[
|
||||
msg + args.join(""),
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
msg + args.map((a) => {
|
||||
var _a, _b;
|
||||
return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
|
||||
}).join(""),
|
||||
instance && instance.proxy,
|
||||
trace.map(
|
||||
({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
|
||||
@@ -237,7 +244,7 @@ function warn$1(msg, ...args) {
|
||||
}
|
||||
console.warn(...warnArgs);
|
||||
}
|
||||
resetTracking();
|
||||
isWarning = false;
|
||||
}
|
||||
function getComponentTrace() {
|
||||
let currentVNode = stack[stack.length - 1];
|
||||
@@ -336,19 +343,20 @@ const ErrorTypeStrings = {
|
||||
[11]: "app warnHandler",
|
||||
[12]: "ref function",
|
||||
[13]: "async component loader",
|
||||
[14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
|
||||
[14]: "scheduler flush",
|
||||
[15]: "component update",
|
||||
[16]: "app unmount cleanup function"
|
||||
};
|
||||
function callWithErrorHandling(fn, instance, type, args) {
|
||||
let res;
|
||||
try {
|
||||
res = args ? fn(...args) : fn();
|
||||
return args ? fn(...args) : fn();
|
||||
} catch (err) {
|
||||
handleError(err, instance, type);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
function handleError(err, instance, type, throwInDev = true) {
|
||||
const contextVNode = instance ? instance.vnode : null;
|
||||
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ;
|
||||
if (instance) {
|
||||
let cur = instance.parent;
|
||||
const exposedInstance = instance.proxy;
|
||||
@@ -364,28 +372,26 @@ function handleError(err, instance, type, throwInDev = true) {
|
||||
}
|
||||
cur = cur.parent;
|
||||
}
|
||||
const appErrorHandler = instance.appContext.config.errorHandler;
|
||||
if (appErrorHandler) {
|
||||
callWithErrorHandling(
|
||||
appErrorHandler,
|
||||
null,
|
||||
10,
|
||||
[err, exposedInstance, errorInfo]
|
||||
);
|
||||
if (errorHandler) {
|
||||
callWithErrorHandling(errorHandler, null, 10, [
|
||||
err,
|
||||
exposedInstance,
|
||||
errorInfo
|
||||
]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
logError(err, type, contextVNode, throwInDev);
|
||||
logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
|
||||
}
|
||||
function logError(err, type, contextVNode, throwInDev = true) {
|
||||
function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
|
||||
{
|
||||
const info = ErrorTypeStrings[type];
|
||||
if (contextVNode) {
|
||||
pushWarningContext(contextVNode);
|
||||
pushWarningContext$1(contextVNode);
|
||||
}
|
||||
warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
||||
if (contextVNode) {
|
||||
popWarningContext();
|
||||
popWarningContext$1();
|
||||
}
|
||||
if (throwInDev) {
|
||||
throw err;
|
||||
@@ -399,14 +405,11 @@ function logError(err, type, contextVNode, throwInDev = true) {
|
||||
const g = shared.getGlobalThis();
|
||||
const registerGlobalSetter = (key, setter) => {
|
||||
let setters;
|
||||
if (!(setters = g[key]))
|
||||
setters = g[key] = [];
|
||||
if (!(setters = g[key])) setters = g[key] = [];
|
||||
setters.push(setter);
|
||||
return (v) => {
|
||||
if (setters.length > 1)
|
||||
setters.forEach((set) => set(v));
|
||||
else
|
||||
setters[0](v);
|
||||
if (setters.length > 1) setters.forEach((set) => set(v));
|
||||
else setters[0](v);
|
||||
};
|
||||
};
|
||||
registerGlobalSetter(
|
||||
@@ -490,7 +493,7 @@ function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) {
|
||||
return dir.getSSRProps(
|
||||
{
|
||||
dir,
|
||||
instance,
|
||||
instance: Vue.ssrUtils.getComponentPublicInstance(instance.$),
|
||||
value,
|
||||
oldValue: void 0,
|
||||
arg,
|
||||
@@ -607,7 +610,9 @@ const {
|
||||
setCurrentRenderingInstance,
|
||||
setupComponent,
|
||||
renderComponentRoot,
|
||||
normalizeVNode
|
||||
normalizeVNode,
|
||||
pushWarningContext,
|
||||
popWarningContext
|
||||
} = Vue.ssrUtils;
|
||||
function createBuffer() {
|
||||
let appendable = false;
|
||||
@@ -620,9 +625,9 @@ function createBuffer() {
|
||||
const isStringItem = shared.isString(item);
|
||||
if (appendable && isStringItem) {
|
||||
buffer[buffer.length - 1] += item;
|
||||
} else {
|
||||
buffer.push(item);
|
||||
return;
|
||||
}
|
||||
buffer.push(item);
|
||||
appendable = isStringItem;
|
||||
if (shared.isPromise(item) || shared.isArray(item) && item.hasAsync) {
|
||||
buffer.hasAsync = true;
|
||||
@@ -631,29 +636,36 @@ function createBuffer() {
|
||||
};
|
||||
}
|
||||
function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
|
||||
const instance = createComponentInstance(vnode, parentComponent, null);
|
||||
const instance = vnode.component = createComponentInstance(
|
||||
vnode,
|
||||
parentComponent,
|
||||
null
|
||||
);
|
||||
pushWarningContext(vnode);
|
||||
const res = setupComponent(
|
||||
instance,
|
||||
true
|
||||
/* isSSR */
|
||||
);
|
||||
popWarningContext();
|
||||
const hasAsyncSetup = shared.isPromise(res);
|
||||
const prefetches = instance.sp;
|
||||
let prefetches = instance.sp;
|
||||
if (hasAsyncSetup || prefetches) {
|
||||
let p = hasAsyncSetup ? res : Promise.resolve();
|
||||
if (prefetches) {
|
||||
p = p.then(
|
||||
() => Promise.all(
|
||||
const p = Promise.resolve(res).then(() => {
|
||||
if (hasAsyncSetup) prefetches = instance.sp;
|
||||
if (prefetches) {
|
||||
return Promise.all(
|
||||
prefetches.map((prefetch) => prefetch.call(instance.proxy))
|
||||
)
|
||||
).catch(shared.NOOP);
|
||||
}
|
||||
);
|
||||
}
|
||||
}).catch(shared.NOOP);
|
||||
return p.then(() => renderComponentSubTree(instance, slotScopeId));
|
||||
} else {
|
||||
return renderComponentSubTree(instance, slotScopeId);
|
||||
}
|
||||
}
|
||||
function renderComponentSubTree(instance, slotScopeId) {
|
||||
pushWarningContext(instance.vnode);
|
||||
const comp = instance.type;
|
||||
const { getBuffer, push } = createBuffer();
|
||||
if (shared.isFunction(comp)) {
|
||||
@@ -670,12 +682,6 @@ function renderComponentSubTree(instance, slotScopeId) {
|
||||
if ((!instance.render || instance.render === shared.NOOP) && !instance.ssrRender && !comp.ssrRender && shared.isString(comp.template)) {
|
||||
comp.ssrRender = ssrCompile(comp.template, instance);
|
||||
}
|
||||
for (const e of instance.scope.effects) {
|
||||
if (e.computed) {
|
||||
e.computed._dirty = true;
|
||||
e.computed._cacheable = true;
|
||||
}
|
||||
}
|
||||
const ssrRender = instance.ssrRender || comp.ssrRender;
|
||||
if (ssrRender) {
|
||||
let attrs = instance.inheritAttrs !== false ? instance.attrs : void 0;
|
||||
@@ -698,9 +704,11 @@ function renderComponentSubTree(instance, slotScopeId) {
|
||||
}
|
||||
}
|
||||
if (slotScopeId) {
|
||||
if (!hasCloned)
|
||||
attrs = { ...attrs };
|
||||
attrs[slotScopeId.trim()] = "";
|
||||
if (!hasCloned) attrs = { ...attrs };
|
||||
const slotScopeIdList = slotScopeId.trim().split(" ");
|
||||
for (let i = 0; i < slotScopeIdList.length; i++) {
|
||||
attrs[slotScopeIdList[i]] = "";
|
||||
}
|
||||
}
|
||||
const prev = setCurrentRenderingInstance(instance);
|
||||
try {
|
||||
@@ -731,10 +739,14 @@ function renderComponentSubTree(instance, slotScopeId) {
|
||||
push(`<!---->`);
|
||||
}
|
||||
}
|
||||
popWarningContext();
|
||||
return getBuffer();
|
||||
}
|
||||
function renderVNode(push, vnode, parentComponent, slotScopeId) {
|
||||
const { type, shapeFlag, children } = vnode;
|
||||
const { type, shapeFlag, children, dirs, props } = vnode;
|
||||
if (dirs) {
|
||||
vnode.props = applySSRDirectives(vnode, props, dirs);
|
||||
}
|
||||
switch (type) {
|
||||
case Vue.Text:
|
||||
push(shared.escapeHtml(children));
|
||||
@@ -785,11 +797,8 @@ function renderVNodeChildren(push, children, parentComponent, slotScopeId) {
|
||||
}
|
||||
function renderElementVNode(push, vnode, parentComponent, slotScopeId) {
|
||||
const tag = vnode.type;
|
||||
let { props, children, shapeFlag, scopeId, dirs } = vnode;
|
||||
let { props, children, shapeFlag, scopeId } = vnode;
|
||||
let openTag = `<${tag}`;
|
||||
if (dirs) {
|
||||
props = applySSRDirectives(vnode, props, dirs);
|
||||
}
|
||||
if (props) {
|
||||
openTag += ssrRenderAttrs(props, tag);
|
||||
}
|
||||
@@ -847,8 +856,7 @@ function applySSRDirectives(vnode, rawProps, dirs) {
|
||||
} = binding;
|
||||
if (getSSRProps) {
|
||||
const props = getSSRProps(binding, vnode);
|
||||
if (props)
|
||||
toMerge.push(props);
|
||||
if (props) toMerge.push(props);
|
||||
}
|
||||
}
|
||||
return Vue.mergeProps(rawProps || {}, ...toMerge);
|
||||
@@ -885,24 +893,36 @@ function renderTeleportVNode(push, vnode, parentComponent, slotScopeId) {
|
||||
}
|
||||
|
||||
const { isVNode: isVNode$1 } = Vue.ssrUtils;
|
||||
async function unrollBuffer$1(buffer) {
|
||||
if (buffer.hasAsync) {
|
||||
let ret = "";
|
||||
for (let i = 0; i < buffer.length; i++) {
|
||||
let item = buffer[i];
|
||||
if (shared.isPromise(item)) {
|
||||
item = await item;
|
||||
}
|
||||
if (shared.isString(item)) {
|
||||
ret += item;
|
||||
} else {
|
||||
ret += await unrollBuffer$1(item);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
} else {
|
||||
return unrollBufferSync$1(buffer);
|
||||
function nestedUnrollBuffer(buffer, parentRet, startIndex) {
|
||||
if (!buffer.hasAsync) {
|
||||
return parentRet + unrollBufferSync$1(buffer);
|
||||
}
|
||||
let ret = parentRet;
|
||||
for (let i = startIndex; i < buffer.length; i += 1) {
|
||||
const item = buffer[i];
|
||||
if (shared.isString(item)) {
|
||||
ret += item;
|
||||
continue;
|
||||
}
|
||||
if (shared.isPromise(item)) {
|
||||
return item.then((nestedItem) => {
|
||||
buffer[i] = nestedItem;
|
||||
return nestedUnrollBuffer(buffer, ret, i);
|
||||
});
|
||||
}
|
||||
const result = nestedUnrollBuffer(item, ret, 0);
|
||||
if (shared.isPromise(result)) {
|
||||
return result.then((nestedItem) => {
|
||||
buffer[i] = nestedItem;
|
||||
return nestedUnrollBuffer(buffer, "", i);
|
||||
});
|
||||
}
|
||||
ret = result;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function unrollBuffer$1(buffer) {
|
||||
return nestedUnrollBuffer(buffer, "", 0);
|
||||
}
|
||||
function unrollBufferSync$1(buffer) {
|
||||
let ret = "";
|
||||
@@ -1036,8 +1056,7 @@ function renderToWebStream(input, context = {}) {
|
||||
start(controller) {
|
||||
renderToSimpleStream(input, context, {
|
||||
push(content) {
|
||||
if (cancelled)
|
||||
return;
|
||||
if (cancelled) return;
|
||||
if (content != null) {
|
||||
controller.enqueue(encoder.encode(content));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user