Skip to content

[Performance] Remove eager Moment and lodash imports - #10051

Draft
weronikaolejniczak wants to merge 2 commits into
elastic:mainfrom
weronikaolejniczak:benchmark/agora-eui-optimization
Draft

weronikaolejniczak wants to merge 2 commits into
elastic:mainfrom
weronikaolejniczak:benchmark/agora-eui-optimization

Conversation

@weronikaolejniczak

Copy link
Copy Markdown
Contributor

Summary

  • preserves the existing isMoment and isDate behavior without importing Moment at runtime
  • replaces lodash equality and ID helpers in the visualization color store with small local implementations
  • adds coverage for date predicate compatibility and unchanged visualization colors

Benchmark

Measured in the representative Agora MCP app:

  • removing eager Moment: about 20 KB gzip saved
  • simplifying the visualization color store: about 33 KB gzip saved
  • final optimized MCP profile: 276 KB gzip, down from 455 KB for published EUI with the full icon registry

Full benchmark, methodology, and trade-offs: https://github.com/elastic/agora/pull/1

The icon allowlist and MCP build settings measured there are separate from this PR.

Validation

  • yarn workspace @elastic/eui-theme-common test-unit src/services/vis_color_store.test.ts
  • yarn workspace @elastic/eui test-unit services/predicate/common_predicates.test.ts
  • TypeScript checks for both packages
  • theme-common ESLint
  • full EUI workspace and package builds
  • Agora payload/runtime benchmark rerun against this exact branch

weronikaolejniczak and others added 2 commits September 18, 2026 11:38
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant