-
Notifications
You must be signed in to change notification settings - Fork 839
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
[Emotion] Use default cache for consumers who do not pass a cache to EuiProvider #6126
Conversation
Hmm, I was hoping |
Preview documentation changes for this PR: https://eui.elastic.co/pr_6126/ |
Yeah I think I'd rather replicate the default cache without pulling in
|
cf9a7b3
to
a04a508
Compare
Preview documentation changes for this PR: https://eui.elastic.co/pr_6126/ |
@@ -7,20 +7,19 @@ | |||
*/ | |||
|
|||
import React, { PropsWithChildren } from 'react'; | |||
import { EmotionCache } from '@emotion/cache'; | |||
import createCache, { EmotionCache } from '@emotion/cache'; |
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.
Just realized that we have @emotion/cache
as a devDep. We'll need to move it to dependencies
.
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.
since @emotion/react
is listed as a peerDependency, does it also make sense to make @emotion/cache
a peerDependency?
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.
57cd674
to
6320248
Compare
Also going to go ahead and revert the revert example - assuming you've had a chance to QA staging already |
This reverts commit a416301.
Preview documentation changes for this PR: https://eui.elastic.co/pr_6126/ |
@@ -0,0 +1,3 @@ | |||
**Bug fixes** |
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 change in peerDependencies
technically makes this a breaking change 😿
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.
Woops, right! 🤦
Preview documentation changes for this PR: https://eui.elastic.co/pr_6126/ |
Summary
closes #6113
#5920 did not account for consumers who do not pass a cache tag to
<EuiProvider>
. This PR fixes the first-child/nth-child console warnings for that scenario,using the "Option 3" method recommended by emotion-js/emotion#1105 (comment)by creating our own default cache.Checklist
- [ ] Checked in both light and dark modes- [ ] Checked in mobile- [ ] Props have proper autodocs and playground toggles- [ ] Added documentation- [ ] Checked Code Sandbox works for any docs examples- [ ] Checked for breaking changes and labeled appropriately- [ ] Checked for accessibility including keyboard-only and screenreader modes- [ ] Updated the Figma library counterpart