js-lingui icon indicating copy to clipboard operation
js-lingui copied to clipboard

fix: return a single node when applicable

Open bengry opened this issue 1 year ago • 4 comments

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)

bengry avatar Aug 27 '24 11:08 bengry

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

vercel[bot] avatar Aug 27 '24 11:08 vercel[bot]

Thanks for contribution.

Is it possible to write a unit test to cover this case?

timofei-iatsenko avatar Aug 27 '24 12:08 timofei-iatsenko

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%)

github-actions[bot] avatar Aug 27 '24 12:08 github-actions[bot]

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.

bengry avatar Aug 27 '24 12:08 bengry

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.

codecov[bot] avatar Aug 30 '24 06:08 codecov[bot]

@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!

bengry avatar Sep 01 '24 19:09 bengry

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.

vonovak avatar Sep 01 '24 19:09 vonovak

@bengry thanks for the contribution! I will try to release a new version today

andrii-bodnar avatar Sep 02 '24 06:09 andrii-bodnar