Skip to content

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 added emotion performance skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) labels 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
@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
Labels
emotion performance skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants