Skip to content

fix: use hook filters in optimize-locales-plugin#10302

Open
wojtekmaj wants to merge 2 commits into
adobe:mainfrom
wojtekmaj:optimize-locales-hook-filter
Open

fix: use hook filters in optimize-locales-plugin#10302
wojtekmaj wants to merge 2 commits into
adobe:mainfrom
wojtekmaj:optimize-locales-hook-filter

Conversation

@wojtekmaj

Copy link
Copy Markdown
Contributor

Closes #10301

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Monkey patch any project using optimize-locales-plugin with the same patch. Observe:

Before:

Benchmark 1: yarn build
  Time (mean ± σ):      2.251 s ±  0.041 s    [User: 3.505 s, System: 0.859 s]
  Range (min … max):    2.201 s …  2.315 s    5 runs

After:

Benchmark 1: yarn build
  Time (mean ± σ):      2.198 s ±  0.041 s    [User: 3.328 s, System: 0.819 s]
  Range (min … max):    2.160 s …  2.267 s    5 runs

This was originally spotted thanks to Rolldown perfshaming us:

[PLUGIN_TIMINGS] Your build spent significant time in plugins. Here is a breakdown:
  - locales-plugin (76%)
  - vite:handlebars (12%)
  - sentry-vite-plugin (6%)
See https://rolldown.rs/reference/InputOptions.checks#plugintimings for more details.

Also ran locally:

yarn format packages/dev/optimize-locales-plugin/LocalesPlugin.js
node -e "require('./packages/dev/optimize-locales-plugin/LocalesPlugin.js')"

Not exactly earth-shattering, but hey, less perfshaming.

🧢 Your Project:

@snowystinger

Copy link
Copy Markdown
Member

Thanks, looks like some tests need updates though

@wojtekmaj wojtekmaj force-pushed the optimize-locales-hook-filter branch from 4285709 to d1cd401 Compare July 8, 2026 21:59
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.

optimize-locales-plugin does not use hook filters

2 participants