Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve code gen when using cssVars in SSR #85

Merged
merged 2 commits into from
Jun 14, 2023

Conversation

edison1105
Copy link
Member

@edison1105 edison1105 commented Apr 12, 2023

related to vuejs/core#6979
without <script setup>
before: see
image

after:
image

@@ -276,6 +277,7 @@ async function doCompileTemplate(
isTS: boolean
) {
const templateResult = store.compiler.compileTemplate({
isProd: false,
...store.options?.template,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idProd may be defined in store.options?.template

// script ssr needs to be performed if :
// 1.using <script setup> where the render fn is inlined.
// 2.using cssVars, as it do not need to be injected during SSR.
if (descriptor.scriptSetup || descriptor.cssVars.length > 0) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If cssVars is used,clientScript is not the same as ssrScript because we do not inject useCssVars into ssr.

@yyx990803 yyx990803 merged commit 7e2bcc8 into vuejs:main Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants