-
Notifications
You must be signed in to change notification settings - Fork 17
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: don't generate styled-jsx randomized classes in jest snapshots #332
Conversation
}, | ||
development: { | ||
plugins: [ | ||
[require('styled-jsx/babel'), { optimizeForSpeed: true }], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@varl should we turn optimizeForSpeed
off here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this is for both apps and libraries, but I think it should be safe to build without optimizeForSpeed
when the build output is in development...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, will merge this and we can consider later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tricky thing is when production-mode components and development-mode components interact on the same page. Since styled-jsx is a singleton, that causes problems as production/development components inject CSS differently and are not compatible.
## [3.2.8](v3.2.7...v3.2.8) (2020-03-25) ### Bug Fixes * don't generate styled-jsx randomized classes in jest snapshots ([#332](#332)) ([eaafbab](eaafbab))
🎉 This PR is included in version 3.2.8 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
In test environments we should:
styled-jsx/babel-test
instead ofstyled-jsx/babel
styled-jsx/css
function as a no-opThis results in clean snapshot output without randomly-generated
jsx-#####
which change whenever any css changes. See the styled-jsx README