-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Turn off Emotion's warnings about potentially unsafe pseudo-selectors in renderDocs
#18657
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
I've decided to wrap this here, even though theme (and other things too) is provided in
DocsContainer
because I think that it's best not to bust the cache on thiskey
change. In reality Emotion's cache can't be as easily busted and recreated (it's not impossible but I don't see why I would want to implement this here) so you'd end up with a lot of duplicated styles with each newkey
on theDocsContainer
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.
Actually... perhaps this is not the best place to do this since
DocsContainer
is totally configurable and is being injected here:storybook/addons/docs/src/preview.ts
Line 3 in 7ca3a53
So maybe I should actually finally look into fixing the real issue in Emotion 😅
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.
@Andarist I'm not quite following:
Why is that an issue? Are you thinking that maybe people might want a custom container that doesn't use this emotion cache business?
BTW on the subject of the
key={}
there -- it looks like it was added for the sake of angular (legacy) inline rendering: #16149So perhaps we could drop it in 7.0 (as we are dropping the old inline rendering).
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.
@Andarist having chatted with others, seeing as we are getting rid of the old inline rendering, the use of
key={}
here is no longer needed. With this in mind would you change the placement of the<CacheProvider>
?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.
I'm happy to update the PR with both changes (dropping the key, and moving the provider) if you let me know!
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.
Let's maybe wait a week or so before moving on with this PR - I will try to investigate this in the Emotion itself.
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.
A little bit later than I've promised - but I took a look there and I think that I understand where Stylis puts the comments much better now. Gonna recheck a couple of things but I think that I'm close to fixing this.
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.
< 2x the promised time is pretty darn good in my books!