Skip to content

chore: cleanup intl polyfills and dev config#2965

Merged
gauthier-th merged 1 commit intodevelopfrom
chore/remove-intl-polyfills-and-fix-dev-server
Apr 29, 2026
Merged

chore: cleanup intl polyfills and dev config#2965
gauthier-th merged 1 commit intodevelopfrom
chore/remove-intl-polyfills-and-fix-dev-server

Conversation

@fallenbagel
Copy link
Copy Markdown
Collaborator

@fallenbagel fallenbagel commented Apr 28, 2026

Description

This PR fixes the JavaScript heap out-of-memory error on the dev server introduced by #2874 when compiling /. The OOM was caused by intl-pluralrules and intl-displaynames loading large locale data files on every request via polyfillIntl() in _app.tsx, exhausting heap memory during development.

Both polyfills were unnecessary to begin with. intl-pluralrules was removed because all browsers we support have natively supported Intl.PluralRules since a long time ago.
image

intl-displaynames because the only known browser issue affects { format: 'script' } (formatjs/formatjs#5889), which we don't use. polyfillIntl now only polyfills Intl.Locale which has a legitimate compatibility reason to exist.

Also fixes the nodemon dev script which had -e specified twice with conflicting values and used the legacy -x flag instead of --exec. Finally adds transpilePackages: ['country-flag-icons'] to suppress a webpack cache warning on every build caused by the package using CommonJS as its main entry point, which confused webpack's JSON module resolution.

How Has This Been Tested?

  • Ran pnpm dev
  • Visited / and waited for it to compile and load successfully without javscript heap memory OOMing.
  • Without this fix, javascript heap memory OOM'd consistently.

Screenshots / Logs (if applicable)

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Summary by CodeRabbit

Release Notes

Chores

  • Updated Next.js configuration to improve country-flag-icons build handling
  • Streamlined internationalization polyfill logic and removed unused components to reduce bundle size
  • Enhanced development server configuration with improved TypeScript file processing

@fallenbagel fallenbagel requested a review from a team as a code owner April 28, 2026 07:00
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

The pull request simplifies internationalization (i18n) configuration by removing polyfills for plural rules and display names from the runtime, removing their npm dependencies, and updating the development script. Additionally, the Next.js configuration adds transparent transpilation support for the country-flag-icons package.

Changes

Cohort / File(s) Summary
Build Configuration
next.config.js
Added transpilePackages: ['country-flag-icons'] to enable Next.js transpilation of the country-flag-icons package.
Dependencies & Scripts
package.json
Removed @formatjs/intl-displaynames and @formatjs/intl-pluralrules runtime dependencies; updated dev script to use nodemon --exec syntax watching ts,json,yml file types.
Internationalization Polyfills
src/pages/_app.tsx, src/utils/polyfillIntl.ts
Simplified polyfill strategy: polyfillIntl() now takes no arguments and runs only the intl-locale polyfill, removing conditional logic for plural rules and display names locale data.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hopping through configs with glee,
Flags now transpile seamlessly!
Stripped the fat, kept locale pure,
Scripts refresh, the builds endure.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: cleanup intl polyfills and dev config' accurately describes the main changes: removing unnecessary intl polyfills and fixing the dev server configuration.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cypress
Copy link
Copy Markdown

cypress Bot commented Apr 28, 2026

seerr    Run #3419

Run Properties:  status check passed Passed #3419  •  git commit ba6ed6c181: chore: cleanup intl polyfills and dev config (#2965)
Project seerr
Branch Review develop
Run status status check passed Passed #3419
Run duration 02m 28s
Commit git commit ba6ed6c181: chore: cleanup intl polyfills and dev config (#2965)
Committer fallenbagel
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 32
View all changes introduced in this branch ↗︎

@seerr-automation-bot seerr-automation-bot added this to the v3.3.0 milestone Apr 28, 2026
@gauthier-th gauthier-th merged commit ba6ed6c into develop Apr 29, 2026
23 checks passed
@gauthier-th gauthier-th deleted the chore/remove-intl-polyfills-and-fix-dev-server branch April 29, 2026 11:12
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.

4 participants