🔧 npm update

This commit is contained in:
2025-04-15 20:50:11 +02:00
parent ce5b9ac0c8
commit 94a90edabd
828 changed files with 256807 additions and 197099 deletions

View File

@@ -1 +1 @@
# @vue/compiler-ssr
# @vue/compiler-ssr

View File

@@ -1,5 +1,5 @@
/**
* @vue/compiler-ssr v3.4.15
* @vue/compiler-ssr v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
@@ -21,11 +21,17 @@ const SSR_RENDER_ATTRS = Symbol(`ssrRenderAttrs`);
const SSR_RENDER_ATTR = Symbol(`ssrRenderAttr`);
const SSR_RENDER_DYNAMIC_ATTR = Symbol(`ssrRenderDynamicAttr`);
const SSR_RENDER_LIST = Symbol(`ssrRenderList`);
const SSR_INCLUDE_BOOLEAN_ATTR = Symbol(`ssrIncludeBooleanAttr`);
const SSR_INCLUDE_BOOLEAN_ATTR = Symbol(
`ssrIncludeBooleanAttr`
);
const SSR_LOOSE_EQUAL = Symbol(`ssrLooseEqual`);
const SSR_LOOSE_CONTAIN = Symbol(`ssrLooseContain`);
const SSR_RENDER_DYNAMIC_MODEL = Symbol(`ssrRenderDynamicModel`);
const SSR_GET_DYNAMIC_MODEL_PROPS = Symbol(`ssrGetDynamicModelProps`);
const SSR_RENDER_DYNAMIC_MODEL = Symbol(
`ssrRenderDynamicModel`
);
const SSR_GET_DYNAMIC_MODEL_PROPS = Symbol(
`ssrGetDynamicModelProps`
);
const SSR_RENDER_TELEPORT = Symbol(`ssrRenderTeleport`);
const SSR_RENDER_SUSPENSE = Symbol(`ssrRenderSuspense`);
const SSR_GET_DIRECTIVE_PROPS = Symbol(`ssrGetDirectiveProps`);
@@ -56,7 +62,7 @@ const ssrTransformIf = compilerDom.createStructuralDirectiveTransform(
/^(if|else|else-if)$/,
compilerDom.processIf
);
function ssrProcessIf(node, context, disableNestedFragments = false) {
function ssrProcessIf(node, context, disableNestedFragments = false, disableComment = false) {
const [rootBranch] = node.branches;
const ifStatement = compilerDom.createIfStatement(
rootBranch.condition,
@@ -80,7 +86,7 @@ function ssrProcessIf(node, context, disableNestedFragments = false) {
currentIf.alternate = branchBlockStatement;
}
}
if (!currentIf.alternate) {
if (!currentIf.alternate && !disableComment) {
currentIf.alternate = compilerDom.createBlockStatement([
compilerDom.createCallExpression(`_push`, ["`<!---->`"])
]);
@@ -93,10 +99,7 @@ function processIfBranch(branch, context, disableNestedFragments = false) {
return processChildrenAsStatement(branch, context, needFragmentWrapper);
}
const ssrTransformFor = compilerDom.createStructuralDirectiveTransform(
"for",
compilerDom.processFor
);
const ssrTransformFor = compilerDom.createStructuralDirectiveTransform("for", compilerDom.processFor);
function ssrProcessFor(node, context, disableNestedFragments = false) {
const needFragmentWrapper = !disableNestedFragments && (node.children.length !== 1 || node.children[0].type !== 1);
const renderLoop = compilerDom.createFunctionExpression(
@@ -137,14 +140,20 @@ const ssrTransformSlotOutlet = (node, context) => {
args.push(`"${context.scopeId}-s"`);
}
let method = SSR_RENDER_SLOT;
const parent = context.parent;
let componentType;
if (parent && parent.type === 1 && parent.tagType === 1 && ((componentType = compilerDom.resolveComponentType(parent, context, true)) === compilerDom.TRANSITION || componentType === compilerDom.TRANSITION_GROUP) && parent.children.filter((c) => c.type === 1).length === 1) {
method = SSR_RENDER_SLOT_INNER;
if (!(context.scopeId && context.slotted !== false)) {
args.push("null");
let parent = context.parent;
if (parent) {
const children = parent.children;
if (parent.type === 10) {
parent = context.grandParent;
}
let componentType;
if (parent.type === 1 && parent.tagType === 1 && ((componentType = compilerDom.resolveComponentType(parent, context, true)) === compilerDom.TRANSITION || componentType === compilerDom.TRANSITION_GROUP) && children.filter((c) => c.type === 1).length === 1) {
method = SSR_RENDER_SLOT_INNER;
if (!(context.scopeId && context.slotted !== false)) {
args.push("null");
}
args.push("true");
}
args.push("true");
}
node.ssrCodegenNode = compilerDom.createCallExpression(context.helper(method), args);
}
@@ -353,6 +362,28 @@ const ssrTransformElement = (node, context) => {
])
];
}
} else if (directives.length && !node.children.length) {
const vText = compilerDom.findDir(node, "text");
if (!vText) {
const tempId = `_temp${context.temps++}`;
propsExp.arguments = [
compilerDom.createAssignmentExpression(
compilerDom.createSimpleExpression(tempId, false),
mergedProps
)
];
rawChildrenMap.set(
node,
compilerDom.createConditionalExpression(
compilerDom.createSimpleExpression(`"textContent" in ${tempId}`, false),
compilerDom.createCallExpression(context.helper(SSR_INTERPOLATE), [
compilerDom.createSimpleExpression(`${tempId}.textContent`, false)
]),
compilerDom.createSimpleExpression(`${tempId}.innerHTML ?? ''`, false),
false
)
);
}
}
if (needTagForRuntime) {
propsExp.arguments.push(`"${node.tag}"`);
@@ -370,7 +401,10 @@ const ssrTransformElement = (node, context) => {
}
if (prop.type === 7) {
if (prop.name === "html" && prop.exp) {
rawChildrenMap.set(node, prop.exp);
rawChildrenMap.set(
node,
compilerDom.createCompoundExpression([`(`, prop.exp, `) ?? ''`])
);
} else if (prop.name === "text" && prop.exp) {
node.children = [compilerDom.createInterpolation(prop.exp, prop.loc)];
} else if (prop.name === "slot") {
@@ -617,6 +651,13 @@ function ssrProcessTransitionGroup(node, context) {
* be patched using the same key map) so we need to account for that here
* by disabling nested fragment wrappers from being generated.
*/
true,
/**
* TransitionGroup filters out comment children at runtime and thus
* doesn't expect comments to be present during hydration. We need to
* account for that by disabling the empty comment that is otherwise
* rendered for a falsy v-if that has no v-else specified. (#6715)
*/
true
);
context.pushStringPart(`</`);
@@ -631,11 +672,11 @@ function ssrProcessTransitionGroup(node, context) {
context.pushStringPart(` ${scopeId}`);
}
context.pushStringPart(`>`);
processChildren(node, context, false, true);
processChildren(node, context, false, true, true);
context.pushStringPart(`</${tag.value.content}>`);
}
} else {
processChildren(node, context, true, true);
processChildren(node, context, true, true, true);
}
}
@@ -953,7 +994,7 @@ function createChildContext(parent, withSlotScopeId = parent.withSlotScopeId) {
withSlotScopeId
);
}
function processChildren(parent, context, asFragment = false, disableNestedFragments = false) {
function processChildren(parent, context, asFragment = false, disableNestedFragments = false, disableComment = false) {
if (asFragment) {
context.pushStringPart(`<!--[-->`);
}
@@ -989,7 +1030,9 @@ function processChildren(parent, context, asFragment = false, disableNestedFragm
context.pushStringPart(shared.escapeHtml(child.content));
break;
case 3:
context.pushStringPart(`<!--${child.content}-->`);
if (!disableComment) {
context.pushStringPart(`<!--${child.content}-->`);
}
break;
case 5:
context.pushStringPart(
@@ -999,7 +1042,7 @@ function processChildren(parent, context, asFragment = false, disableNestedFragm
);
break;
case 9:
ssrProcessIf(child, context, disableNestedFragments);
ssrProcessIf(child, context, disableNestedFragments, disableComment);
break;
case 11:
ssrProcessFor(child, context, disableNestedFragments);
@@ -1156,11 +1199,18 @@ const ssrTransformModel = (dir, node, context) => {
checkDuplicatedValue();
node.children = [compilerDom.createInterpolation(model, model.loc)];
} else if (node.tag === "select") {
node.children.forEach((child) => {
if (child.type === 1) {
processOption(child);
}
});
const processChildren = (children) => {
children.forEach((child) => {
if (child.type === 1) {
processOption(child);
} else if (child.type === 11) {
processChildren(child.children);
} else if (child.type === 9) {
child.branches.forEach((b) => processChildren(b.children));
}
});
};
processChildren(node.children);
} else {
context.onError(
compilerDom.createDOMCompilerError(
@@ -1228,8 +1278,7 @@ const ssrInjectFallthroughAttrs = (node, context) => {
let hasEncounteredIf = false;
for (const c of filterChild(parent)) {
if (c.type === 9 || c.type === 1 && compilerDom.findDir(c, "if")) {
if (hasEncounteredIf)
return;
if (hasEncounteredIf) return;
hasEncounteredIf = true;
} else if (
// node before v-if

View File

@@ -1,6 +1,6 @@
{
"name": "@vue/compiler-ssr",
"version": "3.4.15",
"version": "3.5.13",
"description": "@vue/compiler-ssr",
"main": "dist/compiler-ssr.cjs.js",
"types": "dist/compiler-ssr.d.ts",
@@ -28,7 +28,7 @@
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-ssr#readme",
"dependencies": {
"@vue/shared": "3.4.15",
"@vue/compiler-dom": "3.4.15"
"@vue/shared": "3.5.13",
"@vue/compiler-dom": "3.5.13"
}
}