-
Notifications
You must be signed in to change notification settings - Fork 841
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] Memoize batch of basic/simple components #8171
Conversation
+ update/rerun VRT + fix flaky VRT with `sleep` util (prev setTimeout wasn't quite working correctly/in the expected order)
+ update VRT
+ update VRT scrreenshots
+ rerun VRT
+ update VRT
+ update VRT
+ update VRT
+ update VRT
+ rerun VRT
+ rerun VRT
+ rerun VRT
Preview staging links for this PR:
|
💚 Build Succeeded
|
@cee-chen I ran VRT locally for your PR on all components memoized in this PR and there were no new reference image updates 🎉 |
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.
🚢 🐈⬛ Changes look good to me! Thanks for tackling some of the leftover tech debt! 🧹
).toBe(true); | ||
}); | ||
|
||
await sleep(150); // add a timeout to prevent differences due to animation |
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.
TIL this existed! 😄
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.
lol same. We have so many handy utils in services
that go unnoticed 😅
Thanks for checking Lene! I'll continue updating VRT screenshots for components as I memoize their styles, and then we can do one final VRT update after which hopefully shouldn't be too much at once. |
Summary
Part of #7561
This PR memoizes a swathe of basic
euiComponentStyles(useEuiTheme())
➡️useEuiMemoizedStyles(euiComponentStyles)
conversions. Some minor code syntax/lint type cleanups were made, but should not be major refactors.VRT
While here, I took the opportunity to re-run our VRT screenshots per-component to both check for regressions and handle minute font-level updates (see #8074 (comment)).
@mgadewoll, I'd be curious to hear more thoughts on whether the VRT changes feel excessive to you. Could you try pulling this PR down and running, e.g.
yarn loki update --storiesFilter EuiDragDropContext
and see if it outputs a new screenshot for you or if it remains the same?If that generates snapshot updates for you (argh), maybe we could consider changing the either the diffing engine that Loki uses, or the diff threshold?
QA
N/A, regression testing should be handled by VRT and/or snapshots
General checklist