fix: return a single node when applicable
Description
Fixes an issue where <Trans> didn't work as expected when using asChild, which is most commonly used with Radix (and shadcn/ui, which is based on it).
Fixes https://github.com/lingui/js-lingui/issues/2015
Types of changes
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Examples update
Fixes #2015
Checklist
- [x] I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
- [x] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added the necessary documentation (if appropriate)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| js-lingui | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 28, 2024 1:43pm |
Thanks for contribution.
Is it possible to write a unit test to cover this case?
size-limit report 📦
| Path | Size |
|---|---|
| ./packages/core/dist/index.mjs | 2.88 KB (0%) |
| ./packages/detect-locale/dist/index.mjs | 723 B (0%) |
| ./packages/react/dist/index.mjs | 1.67 KB (0%) |
| ./packages/remote-loader/dist/index.mjs | 7.26 KB (0%) |
Thanks for contribution.
Is it possible to write a unit test to cover this case?
Thanks for the quick response. I added a test in the latest revision.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 75.34%. Comparing base (
d6b9698) to head (94f808d). Report is 52 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #2016 +/- ##
==========================================
- Coverage 76.65% 75.34% -1.31%
==========================================
Files 81 85 +4
Lines 2090 2146 +56
Branches 533 548 +15
==========================================
+ Hits 1602 1617 +15
- Misses 375 415 +40
- Partials 113 114 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@thekip @vonovak no pressure or anything, but anything blocking this PR from being merged now? We could really use a new version with this fix. If that's not coming soon I'd also appreciate a response so we can patch it in the meantime. Thanks!
Usually it's @andrii-bodnar who does merging and also releasing. Even if merged a release can take a bit so I definitely recommend having a local patch.
@bengry thanks for the contribution! I will try to release a new version today