Skip to content

Use Intl.Locale over @formatjs/intl-locale - #3776

Merged
bcotrim merged 4 commits into
trunkfrom
f26d/standard-library-intl-locale
Jun 11, 2026
Merged

Use Intl.Locale over @formatjs/intl-locale#3776
bcotrim merged 4 commits into
trunkfrom
f26d/standard-library-intl-locale

Conversation

@fredrikekelund

@fredrikekelund fredrikekelund commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Related issues

  • N/A

How AI was used in this PR

To verify that the Intl.Locale constructor throws in the same way that the Locale constructor from @formatjs/intl-locale does.

Proposed Changes

  • Uninstall the @formatjs/intl-locale npm module and replace our (very simple) use of the Locale constructor with the standard library Intl.Locale constructor (MDN). @formatjs/intl-locale is indeed a polyfill for Intl.Locale (ref).
  • Before this change, the @formatjs namespace took up 323kB in the CLI JS bundle. After this change, only @formatjs/intl-localematcher remains, which takes up 46kB.
  • I also took the opportunity to explicitly list @formatjs/intl-localematcher as a dependency in apps/cli (and to update that dependency).

Testing Instructions

CI should pass.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@fredrikekelund
fredrikekelund requested a review from a team June 11, 2026 08:01
@fredrikekelund fredrikekelund self-assigned this Jun 11, 2026
@wpmobilebot

wpmobilebot commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 3ed493f vs trunk

app-size

Metric trunk 3ed493f Diff Change
App Size (Mac) 1358.10 MB 1354.70 MB 3.40 MB 🟢 -0.3%

site-editor

Metric trunk 3ed493f Diff Change
load 1675 ms 1624 ms 51 ms 🟢 -3.0%

site-startup

Metric trunk 3ed493f Diff Change
siteCreation 9033 ms 9039 ms +6 ms ⚪ 0.0%
siteStartup 4417 ms 4417 ms 0 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@bcotrim bcotrim 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.

LGTM 👍

@bcotrim
bcotrim merged commit a19419f into trunk Jun 11, 2026
13 checks passed
@bcotrim
bcotrim deleted the f26d/standard-library-intl-locale branch June 11, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants