@vue/compiler-ssr
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -24,3 +24,2 @@ 'use strict'; | ||
const SSR_RENDER_SUSPENSE = Symbol(`ssrRenderSuspense`); | ||
const SSR_RESOLVE_CSS_VARS = Symbol(`ssrResolveCssVars`); | ||
const ssrHelpers = { | ||
@@ -42,4 +41,3 @@ [SSR_INTERPOLATE]: `ssrInterpolate`, | ||
[SSR_RENDER_TELEPORT]: `ssrRenderTeleport`, | ||
[SSR_RENDER_SUSPENSE]: `ssrRenderSuspense`, | ||
[SSR_RESOLVE_CSS_VARS]: `ssrResolveCssVars` | ||
[SSR_RENDER_SUSPENSE]: `ssrRenderSuspense` | ||
}; | ||
@@ -659,3 +657,3 @@ // Note: these are helpers imported from @vue/server-renderer | ||
const context = createSSRTransformContext(ast, options); | ||
// inject <style vars> resolution | ||
// inject SFC <style> CSS variables | ||
// we do this instead of inlining the expression to ensure the vars are | ||
@@ -665,8 +663,3 @@ // only resolved once per render | ||
const varsExp = compilerDom.processExpression(compilerDom.createSimpleExpression(options.ssrCssVars, false), compilerDom.createTransformContext(compilerDom.createRoot([]), options)); | ||
context.body.push(compilerDom.createCompoundExpression([ | ||
`const _cssVars = _${ssrHelpers[SSR_RESOLVE_CSS_VARS]}(`, | ||
varsExp, | ||
options.scopeId ? `, ${JSON.stringify(options.scopeId)}` : ``, | ||
`)` | ||
])); | ||
context.body.push(compilerDom.createCompoundExpression([`const _cssVars = { style: `, varsExp, `}`])); | ||
} | ||
@@ -948,3 +941,2 @@ const isFragment = ast.children.length > 1 && ast.children.some(c => !compilerDom.isText(c)); | ||
} | ||
context.helper(SSR_RESOLVE_CSS_VARS); | ||
if (node.type === 10 /* IF_BRANCH */) { | ||
@@ -964,10 +956,24 @@ for (const child of node.children) { | ||
!compilerDom.findDir(node, 'for')) { | ||
node.props.push({ | ||
type: 7 /* DIRECTIVE */, | ||
name: 'bind', | ||
arg: undefined, | ||
exp: compilerDom.createSimpleExpression(`_cssVars`, false), | ||
modifiers: [], | ||
loc: compilerDom.locStub | ||
}); | ||
if (compilerDom.isBuiltInType(node.tag, 'Suspense')) { | ||
for (const child of node.children) { | ||
if (child.type === 1 /* ELEMENT */ && | ||
child.tagType === 3 /* TEMPLATE */) { | ||
// suspense slot | ||
child.children.forEach(injectCssVars); | ||
} | ||
else { | ||
injectCssVars(child); | ||
} | ||
} | ||
} | ||
else { | ||
node.props.push({ | ||
type: 7 /* DIRECTIVE */, | ||
name: 'bind', | ||
arg: undefined, | ||
exp: compilerDom.createSimpleExpression(`_cssVars`, false), | ||
modifiers: [], | ||
loc: compilerDom.locStub | ||
}); | ||
} | ||
} | ||
@@ -974,0 +980,0 @@ } |
{ | ||
"name": "@vue/compiler-ssr", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "@vue/compiler-ssr", | ||
@@ -31,5 +31,5 @@ "main": "dist/compiler-ssr.cjs.js", | ||
"dependencies": { | ||
"@vue/shared": "3.0.2", | ||
"@vue/compiler-dom": "3.0.2" | ||
"@vue/shared": "3.0.3", | ||
"@vue/compiler-dom": "3.0.3" | ||
} | ||
} |
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
46351
1014
6
+ Added@vue/compiler-core@3.0.3(transitive)
+ Added@vue/compiler-dom@3.0.3(transitive)
+ Added@vue/shared@3.0.3(transitive)
- Removed@vue/compiler-core@3.0.2(transitive)
- Removed@vue/compiler-dom@3.0.2(transitive)
- Removed@vue/shared@3.0.2(transitive)
Updated@vue/compiler-dom@3.0.3
Updated@vue/shared@3.0.3