-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[styles] Go back to index counter #15044
[styles] Go back to index counter #15044
Conversation
@@ -1,17 +1,11 @@ | |||
import warning from 'warning'; | |||
import hash from '@emotion/hash'; | |||
|
|||
const escapeRegex = /([[\].#*$><+~=|^:(),"'`\s])/g; |
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.
@material-ui/core: parsed: -0.26% 😍, gzip: -0.40% 😍 Details of bundle changes.Comparing: 3a8f79a...e77d465
|
14fd47a
to
c6b4137
Compare
Glad you did this. JSS used hashes long time ago too, then I tried to optimize it this way too. I think I have now some ideas on how to avoid problems with mismatching class names after SSR by providing meaningful feedback to the user and documenting some edge cases. Once this is solved we are really good here! |
|
Compression off by default or just allow to opt-out? |
off by default. |
c6b4137
to
e77d465
Compare
If the page has multiple react trees, the index counter breaks the css. Is there any way to handle this scenario? The hash version works perfectly with multiple react trees. |
@thevarunraja Have you tried the |
One slice of #14999.
This has different advantages:
https://next.material-ui.com/demos/buttons/#buttons
The hash logic was added in the first place to handle server-side sheets caching. I have kept the hash version of the class name generator. Server-side caching is still a beta feature. It's gonna need more R&D. cc @kof