-
Notifications
You must be signed in to change notification settings - Fork 844
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] Allow configuring style memoization error/warning level #7626
[Emotion] Allow configuring style memoization error/warning level #7626
Conversation
- via our existing `emitEuiProviderWarning` utility
- but not on prod/staging, in case of false negatives
+ fix EuiProvider demo not working since the organization changes - ID follows title
3d9356c
to
c85cf00
Compare
Co-authored-by: Lene Gadewoll <[email protected]>
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.
🚢 🐈⬛ LGTM!
Staging works as expected as far as I can see and I also checked it locally based on the issue encountered on #7625 making sure that locally an error is thrown or a warning is printed to the console if an anonymous function is passed to useEuiMemoizedStyles
.
Nice solution using setEuiDevProviderWarning
🎉 (also TIL that it exists! 🧠)
There are so many random little utilities in EUI that make me say that 😂 |
Preview staging links for this PR:
|
💚 Build Succeeded
History
|
`v93.5.1` ⏩ `v93.5.2` --- ## [`v93.5.2`](https://github.com/elastic/eui/releases/v93.5.2) **Dependency updates** - Updated `react-virtualized-auto-sizer` to 1.0.24 ([#7598](elastic/eui#7598)) - Updated `react-window` to 1.8.10 ([#7600](elastic/eui#7600)) **CSS-in-JS conversions** - Updated EUI's internal style memoization/performance utility to have configurable error/warning levels via `setEuiDevProviderWarning` ([#7626](elastic/eui#7626))
Summary
The catch I added in #7529 (comment) has backfired, in that it's producing a false negative on staging (but not local??) in #7625 (review).
To work around prod false negatives but preserve the intended goal of catching anonymous style functions in development, I'm tweaking the thrown error to use our internal EUI provider warning utility, which allows us (and consumers) to configure the warning level used. In this case, I'm setting it to
error
for local docs dev and for storybook, but to justwarn
for staging/prod.As always, I recommend following along by commit.
QA
I think QA is already pretty well covered by our tests, so IMO a brief smoke check of staging to ensure no errors is sufficient. Here are the extra QA steps I took locally:
EuiProvider
in app_context.js to confirm the expected error threwEuiProvider
s to confirm the expected error threwGeneral checklist
Added orupdated jestand cypress tests- [ ] If applicable, added the breaking change issue label (and filled out the breaking change checklist)