Skip to content
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][perf] Memoize EuiButton styles & mixins #7541

Merged
merged 5 commits into from
Feb 27, 2024

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented Feb 22, 2024

Summary

This PR is a performance enhancement (+ one missing Emotion animation conversion) on the EuiButton component(s) and should not regress or change any output UI or generated classNames.

As always, I recommend code reviewing by commit.

QA

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
      - [ ] Checked in mobile
  • Docs site QA - N/A
  • Code quality checklist
  • Release checklist
    • [ ] A changelog entry exists and is marked appropriately. - Skipping the changelog on these PRs as they shouldn't affect either end-users or consumers
  • Designer checklist - N/A

+ fix animation relying on existing Sass CSS instead of generating actual keyframes from Emotion
- use nested forEach instead of a function
- invert the color/display mapping to make it easier to just return the expected colors obj
- use switch

+ manually tweak Emotion label output to be the same as prod
@cee-chen cee-chen changed the title [Emotion][perf] Memoize EuiButton styles [Emotion][perf] Memoize EuiButton styles & mixins Feb 22, 2024
@cee-chen cee-chen marked this pull request as ready for review February 22, 2024 21:55
@cee-chen cee-chen requested a review from a team as a code owner February 22, 2024 21:55
@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

Copy link
Contributor

@1Copenut 1Copenut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM!

@cee-chen cee-chen merged commit dd3ff4b into elastic:main Feb 27, 2024
12 of 15 checks passed
@cee-chen cee-chen deleted the emotion/memoize-button-styles branch February 27, 2024 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants