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(v-bind): rendering of custom properties using v-bind (fix #5443) #5444

Closed
wants to merge 2 commits into from

Conversation

jasonkellydk
Copy link

@jasonkellydk jasonkellydk commented Feb 17, 2022

fix #5443

v-bind ssr fix

The problem

The first paint will not contain styles that have used v-bind. Due to @vue/shared outputting non-valid CSS custom properties

The proposed solution

I was in doubt whether or not to place the fix in normalizeProp.ts. I tried to do some research in the generation of the id. But when doing a similar fix in @vue/sfc-compiler it broke client side hydration.

@netlify
Copy link

netlify bot commented Feb 17, 2022

✔️ Deploy Preview for vue-sfc-playground ready!

🔨 Explore the source changes: 9a03a17

🔍 Inspect the deploy log: https://app.netlify.com/sites/vue-sfc-playground/deploys/621360b8ad41590008db0316

😎 Browse the preview: https://deploy-preview-5444--vue-sfc-playground.netlify.app/

@netlify
Copy link

netlify bot commented Feb 17, 2022

✔️ Deploy Preview for vuejs-coverage ready!

🔨 Explore the source changes: 9a03a17

🔍 Inspect the deploy log: https://app.netlify.com/sites/vuejs-coverage/deploys/621360b8907c310008c89090

😎 Browse the preview: https://deploy-preview-5444--vuejs-coverage.netlify.app

@netlify
Copy link

netlify bot commented Feb 17, 2022

✔️ Deploy Preview for vue-next-template-explorer ready!

🔨 Explore the source changes: 9a03a17

🔍 Inspect the deploy log: https://app.netlify.com/sites/vue-next-template-explorer/deploys/621360b8a7e0730007a5e2d8

😎 Browse the preview: https://deploy-preview-5444--vue-next-template-explorer.netlify.app

@@ -1,6 +1,35 @@
import { isArray, isString, isObject, hyphenate } from './'
import { isNoUnitNumericStyleProp } from './domAttrConfig'

const hashedCustomProperty = /^[0-9a-f]{8}-/i;

Choose a reason for hiding this comment

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

The generated hashes does not contain a "-" character at the end. So, the regex is not matching. A working regex:

const hashedCustomProperty = /^[0-9a-f]{8}$/i;

Copy link
Author

Choose a reason for hiding this comment

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

Hi @jahermosilla ,

Good catch! 🐛

@yyx990803 yyx990803 closed this in efea4a8 May 17, 2022
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.

SSR: CSS custom properties bug using v-bind
2 participants