@vue/compiler-ssr
Advanced tools
Comparing version 3.0.0-beta.18 to 3.0.0-beta.19
@@ -9,2 +9,3 @@ 'use strict'; | ||
const SSR_INTERPOLATE = Symbol(`ssrInterpolate`); | ||
const SSR_RENDER_VNODE = Symbol(`ssrRenderVNode`); | ||
const SSR_RENDER_COMPONENT = Symbol(`ssrRenderComponent`); | ||
@@ -26,2 +27,3 @@ const SSR_RENDER_SLOT = Symbol(`ssrRenderSlot`); | ||
[SSR_INTERPOLATE]: `ssrInterpolate`, | ||
[SSR_RENDER_VNODE]: `ssrRenderVNode`, | ||
[SSR_RENDER_COMPONENT]: `ssrRenderComponent`, | ||
@@ -233,4 +235,4 @@ [SSR_RENDER_SLOT]: `ssrRenderSlot`, | ||
const component = compilerDom.resolveComponentType(node, context, true /* ssr */); | ||
componentTypeMap.set(node, component); | ||
if (shared.isSymbol(component)) { | ||
componentTypeMap.set(node, component); | ||
if (component === compilerDom.SUSPENSE) { | ||
@@ -282,9 +284,25 @@ return ssrTransformSuspense(node, context); | ||
: `null`; | ||
node.ssrCodegenNode = compilerDom.createCallExpression(context.helper(SSR_RENDER_COMPONENT), [component, props, slots, `_parent`]); | ||
if (typeof component !== 'string') { | ||
// dynamic component that resolved to a `resolveDynamicComponent` call | ||
// expression - since the reoslved result may be a plain element (string) | ||
// or a VNode, handle it with `renderVNode`. | ||
node.ssrCodegenNode = compilerDom.createCallExpression(context.helper(SSR_RENDER_VNODE), [ | ||
`_push`, | ||
compilerDom.createCallExpression(context.helper(compilerDom.CREATE_VNODE), [ | ||
component, | ||
props, | ||
slots | ||
]), | ||
`_parent` | ||
]); | ||
} | ||
else { | ||
node.ssrCodegenNode = compilerDom.createCallExpression(context.helper(SSR_RENDER_COMPONENT), [component, props, slots, `_parent`]); | ||
} | ||
}; | ||
}; | ||
function ssrProcessComponent(node, context) { | ||
const component = componentTypeMap.get(node); | ||
if (!node.ssrCodegenNode) { | ||
// this is a built-in component that fell-through. | ||
const component = componentTypeMap.get(node); | ||
if (component === compilerDom.TELEPORT) { | ||
@@ -312,3 +330,11 @@ return ssrProcessTeleport(node, context); | ||
} | ||
context.pushStatement(compilerDom.createCallExpression(`_push`, [node.ssrCodegenNode])); | ||
if (typeof component === 'string') { | ||
// static component | ||
context.pushStatement(compilerDom.createCallExpression(`_push`, [node.ssrCodegenNode])); | ||
} | ||
else { | ||
// dynamic component (`resolveDynamicComponent` call) | ||
// the codegen node is a `renderVNode` call | ||
context.pushStatement(node.ssrCodegenNode); | ||
} | ||
} | ||
@@ -315,0 +341,0 @@ } |
{ | ||
"name": "@vue/compiler-ssr", | ||
"version": "3.0.0-beta.18", | ||
"version": "3.0.0-beta.19", | ||
"description": "@vue/compiler-ssr", | ||
@@ -30,5 +30,5 @@ "main": "dist/compiler-ssr.cjs.js", | ||
"dependencies": { | ||
"@vue/shared": "3.0.0-beta.18", | ||
"@vue/compiler-dom": "3.0.0-beta.18" | ||
"@vue/shared": "3.0.0-beta.19", | ||
"@vue/compiler-dom": "3.0.0-beta.19" | ||
} | ||
} |
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
44111
953
+ Added@vue/compiler-core@3.0.0-beta.19(transitive)
+ Added@vue/compiler-dom@3.0.0-beta.19(transitive)
+ Added@vue/shared@3.0.0-beta.19(transitive)
- Removed@vue/compiler-core@3.0.0-beta.18(transitive)
- Removed@vue/compiler-dom@3.0.0-beta.18(transitive)
- Removed@vue/shared@3.0.0-beta.18(transitive)
Updated@vue/shared@3.0.0-beta.19