Skip to content

[EuiFormControlLayout] Memoize icon styles - #10184

Merged
angeles-mzb merged 1 commit into
elastic:mainfrom
Anshuman-Prakash:perf/memoize-form-control-layout-icons-10154
Oct 15, 2026
Merged

angeles-mzb merged 1 commit into
elastic:mainfrom
Anshuman-Prakash:perf/memoize-form-control-layout-icons-10154

Conversation

@Anshuman-Prakash

Copy link
Copy Markdown
Contributor

Summary

Fixes #10154. Part of #10147.

Memoize EuiFormControlLayoutIcons styles with useEuiMemoizedStyles(euiFormControlLayoutIconsStyles) instead of calling the generator on every render. The generator is already a static function of the theme; the compressed/position/side/disabled style selection stays in the component.

API Changes

None.

Screenshots

Not applicable: CSS definitions are unchanged, and all existing form control layout snapshots pass without updates on React 17 and React 18.

Impact Assessment

Impact level: 🟢 Low — performance-only change to reuse generated styles across renders. No expected visual, behavioral, public API, or snapshot changes.

Release Readiness

  • Documentation, Figma, migration guide, and adoption plan: not applicable to this internal optimization.
  • No changelog, as requested in the issue; skip-changelog applies.

QA instructions for reviewer

From packages/eui:

  • yarn test-unit form_control_layout --runInBand — passed: 69 tests, 34 snapshots on React 18.
  • yarn test-unit --react-version=17 form_control_layout --runInBand — passed: 69 tests, 34 snapshots on React 17.
  • eslint src/components/form/form_control_layout/ and yarn tsc --noEmit — no errors.

🤖 Generated with Claude Code

Fixes elastic#10154

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Anshuman-Prakash
Anshuman-Prakash requested a review from a team as a code owner October 6, 2026 19:49
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually?

@github-actions github-actions Bot added the community contribution (Don't delete - used for automation) label Oct 6, 2026
@Anshuman-Prakash

Copy link
Copy Markdown
Contributor Author

I have signed the CLA

@angeles-mzb angeles-mzb added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Oct 15, 2026
@angeles-mzb

Copy link
Copy Markdown
Contributor

buildkite test this

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

@angeles-mzb angeles-mzb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for contributing @Anshuman-Prakash!

@angeles-mzb
angeles-mzb merged commit d92fb7f into elastic:main Oct 15, 2026
11 of 12 checks passed
weronikaolejniczak pushed a commit to boriskirov/eui that referenced this pull request Nov 11, 2026
Co-authored-by: Anshuman Prakash <199287261+Anshuman-Prakash@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community contribution (Don't delete - used for automation) 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.

[Emotion] Memoize EuiFormControlLayout icon styles

2 participants