@vue/compiler-ssr
Advanced tools
Comparing version 3.0.0-beta.5 to 3.0.0-beta.6
@@ -46,3 +46,3 @@ 'use strict'; | ||
const ssrTransformIf = compilerDom.createStructuralDirectiveTransform(/^(if|else|else-if)$/, compilerDom.processIf); | ||
// This is called during the 2nd transform pass to construct the SSR-sepcific | ||
// This is called during the 2nd transform pass to construct the SSR-specific | ||
// codegen nodes. | ||
@@ -82,3 +82,3 @@ function ssrProcessIf(node, context) { | ||
const ssrTransformFor = compilerDom.createStructuralDirectiveTransform('for', compilerDom.processFor); | ||
// This is called during the 2nd transform pass to construct the SSR-sepcific | ||
// This is called during the 2nd transform pass to construct the SSR-specific | ||
// codegen nodes. | ||
@@ -129,3 +129,4 @@ function ssrProcessFor(node, context) { | ||
[58 /* X_SSR_UNSAFE_ATTR_NAME */]: `Unsafe attribute name for SSR.`, | ||
[59 /* X_SSR_NO_TELEPORT_TARGET */]: `No target prop on teleport element.` | ||
[59 /* X_SSR_NO_TELEPORT_TARGET */]: `No target prop on teleport element.`, | ||
[60 /* X_SSR_INVALID_AST_NODE */]: `Invalid AST node during ssr transform` | ||
}; | ||
@@ -686,25 +687,55 @@ | ||
const child = children[i]; | ||
if (child.type === 1 /* ELEMENT */) { | ||
if (child.tagType === 0 /* ELEMENT */) { | ||
ssrProcessElement(child, context); | ||
} | ||
else if (child.tagType === 1 /* COMPONENT */) { | ||
ssrProcessComponent(child, context); | ||
} | ||
else if (child.tagType === 2 /* SLOT */) { | ||
ssrProcessSlotOutlet(child, context); | ||
} | ||
switch (child.type) { | ||
case 1 /* ELEMENT */: | ||
switch (child.tagType) { | ||
case 0 /* ELEMENT */: | ||
ssrProcessElement(child, context); | ||
break; | ||
case 1 /* COMPONENT */: | ||
ssrProcessComponent(child, context); | ||
break; | ||
case 2 /* SLOT */: | ||
ssrProcessSlotOutlet(child, context); | ||
break; | ||
case 3 /* TEMPLATE */: | ||
// TODO | ||
break; | ||
default: | ||
context.onError(createSSRCompilerError(60 /* X_SSR_INVALID_AST_NODE */, child.loc)); | ||
// make sure we exhaust all possible types | ||
const exhaustiveCheck = child; | ||
return exhaustiveCheck; | ||
} | ||
break; | ||
case 2 /* TEXT */: | ||
context.pushStringPart(shared.escapeHtml(child.content)); | ||
break; | ||
case 3 /* COMMENT */: | ||
// no need to escape comment here because the AST can only | ||
// contain valid comments. | ||
context.pushStringPart(`<!--${child.content}-->`); | ||
break; | ||
case 5 /* INTERPOLATION */: | ||
context.pushStringPart(compilerDom.createCallExpression(context.helper(SSR_INTERPOLATE), [child.content])); | ||
break; | ||
case 9 /* IF */: | ||
ssrProcessIf(child, context); | ||
break; | ||
case 11 /* FOR */: | ||
ssrProcessFor(child, context); | ||
break; | ||
case 10 /* IF_BRANCH */: | ||
// no-op - handled by ssrProcessIf | ||
break; | ||
case 12 /* TEXT_CALL */: | ||
case 8 /* COMPOUND_EXPRESSION */: | ||
// no-op - these two types can never appear as template child node since | ||
// `transformText` is not used during SSR compile. | ||
break; | ||
default: | ||
context.onError(createSSRCompilerError(60 /* X_SSR_INVALID_AST_NODE */, child.loc)); | ||
// make sure we exhaust all possible types | ||
const exhaustiveCheck = child; | ||
return exhaustiveCheck; | ||
} | ||
else if (child.type === 2 /* TEXT */) { | ||
context.pushStringPart(shared.escapeHtml(child.content)); | ||
} | ||
else if (child.type === 5 /* INTERPOLATION */) { | ||
context.pushStringPart(compilerDom.createCallExpression(context.helper(SSR_INTERPOLATE), [child.content])); | ||
} | ||
else if (child.type === 9 /* IF */) { | ||
ssrProcessIf(child, context); | ||
} | ||
else if (child.type === 11 /* FOR */) { | ||
ssrProcessFor(child, context); | ||
} | ||
} | ||
@@ -711,0 +742,0 @@ if (asFragment) { |
{ | ||
"name": "@vue/compiler-ssr", | ||
"version": "3.0.0-beta.5", | ||
"version": "3.0.0-beta.6", | ||
"description": "@vue/compiler-ssr", | ||
@@ -30,5 +30,5 @@ "main": "dist/compiler-ssr.cjs.js", | ||
"dependencies": { | ||
"@vue/shared": "3.0.0-beta.5", | ||
"@vue/compiler-dom": "3.0.0-beta.5" | ||
"@vue/shared": "3.0.0-beta.6", | ||
"@vue/compiler-dom": "3.0.0-beta.6" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42072
887
+ Added@vue/compiler-core@3.0.0-beta.6(transitive)
+ Added@vue/compiler-dom@3.0.0-beta.6(transitive)
+ Added@vue/shared@3.0.0-beta.6(transitive)
- Removed@vue/compiler-core@3.0.0-beta.5(transitive)
- Removed@vue/compiler-dom@3.0.0-beta.5(transitive)
- Removed@vue/shared@3.0.0-beta.5(transitive)
Updated@vue/shared@3.0.0-beta.6