feat: allow extract to work with i18n._ calls not created from macro #1309
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.
This change updates babel-plugin-extract-messages so that it will pick up usages of the i18n._ method from @lingui/core directly.
This solves the issues mentioned in #1178 and #1224 (comment) without needing the workaround listed in 1178 (prefixing the id with
/*i18n*/
).The main driver for this is to allow use of Lingui without macros, so that sites running on Next.js can use the SWC compiler instead of babel.
Aware that this is effectively adding back extract behavior that was removed previously, but hopefully this isn't too big of a deal - let me know if you have any feedback.