Skip to content

feat(@formatjs/intl-locale)!: convert to esm#5435

Closed
longlho wants to merge 1 commit into12-13-feat_formatjs_intl_convert_to_esmfrom
12-13-feat_formatjs_intl-locale_convert_to_esm
Closed

feat(@formatjs/intl-locale)!: convert to esm#5435
longlho wants to merge 1 commit into12-13-feat_formatjs_intl_convert_to_esmfrom
12-13-feat_formatjs_intl-locale_convert_to_esm

Conversation

@longlho
Copy link
Member

@longlho longlho commented Dec 14, 2025

TL;DR

Convert @formatjs/intl-locale to ESM-only package.

What changed?

  • Updated @formatjs/intl-locale package to be ESM-only by adding "type": "module" to package.json
  • Added proper exports configuration in package.json
  • Updated all imports to use .js extension for proper ESM resolution
  • Removed CommonJS build by adding skip_cjs = True in Bazel config
  • Updated all imports of @formatjs/intl-locale/polyfill to @formatjs/intl-locale/polyfill.js across various packages

How to test?

  1. Build the project and verify that the intl-locale package works correctly as an ESM module
  2. Run tests for all packages that depend on intl-locale to ensure they can properly import the polyfill
  3. Verify that applications using @formatjs/intl-locale can still import it correctly with the new ESM format

Why make this change?

This change modernizes the intl-locale package to use ESM format, which is the standard module system for JavaScript. This improves compatibility with modern bundlers and runtimes while ensuring proper static analysis and tree-shaking capabilities. The explicit .js extensions in imports are required for proper ESM resolution.

Copy link
Member Author

longlho commented Dec 14, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • main - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@longlho longlho marked this pull request as ready for review December 14, 2025 05:10
@graphite-app
Copy link

graphite-app bot commented Dec 14, 2025

Merge activity

  • Dec 14, 5:26 AM UTC: longlho added this pull request to the Graphite merge queue.
  • Dec 14, 5:26 AM UTC: CI is running for this pull request on a draft pull request (#5446) due to your merge queue CI optimization settings.
  • Dec 14, 5:29 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #5430.
  • Dec 14, 5:46 AM UTC: longlho added this pull request to the Graphite merge queue.
  • Dec 14, 5:47 AM UTC: CI is running for this pull request on a draft pull request (#5453) due to your merge queue CI optimization settings.
  • Dec 14, 5:50 AM UTC: Merged by the Graphite merge queue via draft PR: #5453.

graphite-app bot pushed a commit that referenced this pull request Dec 14, 2025
### TL;DR

Convert `@formatjs/intl-locale` to ESM-only package.

### What changed?

- Updated `@formatjs/intl-locale` package to be ESM-only by adding `"type": "module"` to package.json
- Added proper exports configuration in package.json
- Updated all imports to use `.js` extension for proper ESM resolution
- Removed CommonJS build by adding `skip_cjs = True` in Bazel config
- Updated all imports of `@formatjs/intl-locale/polyfill` to `@formatjs/intl-locale/polyfill.js` across various packages

### How to test?

1. Build the project and verify that the `intl-locale` package works correctly as an ESM module
2. Run tests for all packages that depend on `intl-locale` to ensure they can properly import the polyfill
3. Verify that applications using `@formatjs/intl-locale` can still import it correctly with the new ESM format

### Why make this change?

This change modernizes the `intl-locale` package to use ESM format, which is the standard module system for JavaScript. This improves compatibility with modern bundlers and runtimes while ensuring proper static analysis and tree-shaking capabilities. The explicit `.js` extensions in imports are required for proper ESM resolution.
graphite-app bot pushed a commit that referenced this pull request Dec 14, 2025
### TL;DR

Convert `@formatjs/intl-locale` to ESM-only package.

### What changed?

- Updated `@formatjs/intl-locale` package to be ESM-only by adding `"type": "module"` to package.json
- Added proper exports configuration in package.json
- Updated all imports to use `.js` extension for proper ESM resolution
- Removed CommonJS build by adding `skip_cjs = True` in Bazel config
- Updated all imports of `@formatjs/intl-locale/polyfill` to `@formatjs/intl-locale/polyfill.js` across various packages

### How to test?

1. Build the project and verify that the `intl-locale` package works correctly as an ESM module
2. Run tests for all packages that depend on `intl-locale` to ensure they can properly import the polyfill
3. Verify that applications using `@formatjs/intl-locale` can still import it correctly with the new ESM format

### Why make this change?

This change modernizes the `intl-locale` package to use ESM format, which is the standard module system for JavaScript. This improves compatibility with modern bundlers and runtimes while ensuring proper static analysis and tree-shaking capabilities. The explicit `.js` extensions in imports are required for proper ESM resolution.
@graphite-app graphite-app bot closed this Dec 14, 2025
@graphite-app graphite-app bot deleted the 12-13-feat_formatjs_intl-locale_convert_to_esm branch December 14, 2025 05:50
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