-
Notifications
You must be signed in to change notification settings - Fork 396
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
Lowercase all CSS scope tokens #3313
Comments
This issue has been linked to a new work item: W-12425100 |
I would maybe even go one step further and randomize the scope token, e.g. |
This is a somewhat similar problem to our scoped id implementation which we "resolved" through documentation. We basically say that |
Thoughts on this:
|
Although it will initially break tests, we can make snapshots consistent using the jest serializer. Including the template content into the hash introduces some randomness but it would remain static for as long as the template doesn't change, which I'm guessing is for the majority of components. It could be worse than having a static scope token that never changes or a dynamic one that always changes because it might be confusing for the developer unless they understand the implementation. If we decide to do it, I think it should probably change on every page reload. |
Fixing it in the serializer makes sense to me. I do wonder though, how being truly random would interact with Hot Module Replacement. I.e. would we just keep adding new |
@ekashida I looked into it, and I'm not sure we can modify the Jest serializer to strip the scope tokens. Stripping We might just have to break people's snapshots. 😕 |
In #3312 we got rid of the static optimization for SVGs due to a bug in the case sensitivity of styling tokens (synthetic shadow, scoped styles).
The best long-term solution would be to lowercase all scope tokens in the style compiler. This is what Vue does.
Note that this would be an observable change. And it could break code that predicts the scope token value and uses it, e.g. for
querySelector
:The text was updated successfully, but these errors were encountered: