fix(@formatjs/cli): extract formatMessage from any object, not just intl#6251
Merged
fix(@formatjs/cli): extract formatMessage from any object, not just intl#6251
Conversation
The Rust CLI only extracted formatMessage() calls when the object was literally named `intl` or ended with `.intl`. This missed patterns like `this.intl.formatMessage()`, `someVar.formatMessage()`, etc. The JS CLI (ts-transformer) has no such restriction — it extracts from any `something.formatMessage()` call. Align the Rust CLI behavior. Fixes #6249 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1e5c895 to
25889ea
Compare
longlho
added a commit
that referenced
this pull request
Apr 12, 2026
Patch release for fix in #6251: extract formatMessage from any object, not just intl. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 task
trunk-io Bot
pushed a commit
that referenced
this pull request
Apr 12, 2026
## Summary Patch version bump for `formatjs_cli` crate: 1.1.0 → 1.1.1 ### Changes since v1.1.0 - #6251: fix(@formatjs/cli): extract formatMessage from any object, not just intl ## Test plan - [x] Pre-commit hooks pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
formatMessage()calls when the object was literally namedintlor ended with.intlthis.intl.formatMessage(),someVar.formatMessage(),foo.bar.baz.formatMessage()something.formatMessage()callChanges
extract_function_name_from_member()to return the property name directlyis_intl_object()andis_intl_object_from_chain()methods21_formatmessage_any_object.txtcoveringthis.intl,someVar,this.props.intl, and deep chainsFixes #6249
Test plan
bazel test //crates/formatjs_cli:formatjs_cli_testpassesbazel test //packages/cli/integration-tests:conformance_testpasses (21/21 test cases)🤖 Generated with Claude Code