-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for runtimeConfigModule w/ Trans #895
feat: add support for runtimeConfigModule w/ Trans #895
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/lingui-js/js-lingui/1hcd6rmou |
Codecov Report
@@ Coverage Diff @@
## main #895 +/- ##
==========================================
- Coverage 83.08% 82.84% -0.25%
==========================================
Files 51 51
Lines 1437 1446 +9
Branches 395 400 +5
==========================================
+ Hits 1194 1198 +4
- Misses 142 146 +4
- Partials 101 102 +1
Continue to review full report at Codecov.
|
257961c
to
4880889
Compare
Looks good to me, except one question that is confusing, thanks for your contribution Maël |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you!
😱 Released 3.3.0 with this fix/feature introduced!
|
The
runtimeConfigModule
setting cannot be used to transform the hardcodedimport {Trans} from '@lingui/react'
statements, which is problematic when theTrans
symbol is expected to be provided by an intermediary layer (#822).This diff addresses that by adding support for
runtimeConfigModule
being an object, in which case the key is the symbol name (eitheri18n
orTrans
), and the value is the symbol name and from where to import it. This change is completely backward compatible, only adding syntax.The test framework doesn't seem to allow for testing
runtimeConfigModule
(its current implementation doesn't seem tested) so I couldn't add relevant tests.