Skip to content

fix: trans values typing and runtime#2502

Closed
yslpn wants to merge 16 commits intolingui:nextfrom
yslpn:fix/trans-values-typing-and-runtime
Closed

fix: trans values typing and runtime#2502
yslpn wants to merge 16 commits intolingui:nextfrom
yslpn:fix/trans-values-typing-and-runtime

Conversation

@yslpn
Copy link
Copy Markdown
Contributor

@yslpn yslpn commented Apr 6, 2026

Description

This PR narrows Trans interpolation values to supported scalar types and fixes the rendering logic to match that contract across @lingui/core, @lingui/react, and macro typings.

Before this change, some values were accepted by TypeScript but did not behave correctly at runtime in Trans.

This PR makes the typing stricter

Types of changes

  • 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 # (issue)

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 6, 2026

@yslpn is attempting to deploy a commit to the Crowdin Team on Vercel.

A member of the Team first needs to authorize it.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.05%. Comparing base (dd43fb0) to head (f793545).
⚠️ Report is 333 commits behind head on next.

Additional details and impacted files
@@             Coverage Diff             @@
##             next    #2502       +/-   ##
===========================================
+ Coverage   76.66%   89.05%   +12.38%     
===========================================
  Files          81      118       +37     
  Lines        2083     3325     +1242     
  Branches      532      981      +449     
===========================================
+ Hits         1597     2961     +1364     
+ Misses        375      329       -46     
+ Partials      111       35       -76     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yslpn yslpn changed the title Fix/trans values typing and runtime fix: trans values typing and runtime Apr 6, 2026
@yslpn yslpn marked this pull request as draft April 7, 2026 06:52
@yslpn yslpn marked this pull request as ready for review April 10, 2026 13:57
@yslpn yslpn marked this pull request as draft April 10, 2026 16:05
@yslpn yslpn closed this Apr 11, 2026
@timofei-iatsenko
Copy link
Copy Markdown
Collaborator

@yslpn why closed this one? I checked this #2507 and it seems your's is more comprehensive with type tests and types for plural/select and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants