Skip to content

Conversation

@yslpn
Copy link
Contributor

@yslpn yslpn commented Dec 18, 2025

Description

Switch React packages to the automatic JSX runtime: Babel/esbuild now emit JSX without explicit React imports, and the React tsconfig uses react-jsx. Raised the minimum supported react peer to 16.14.0 to align with the automatic runtime requirements. This follows the guidance in the new JSX transform announcement: https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html

  • No more import React — you don't need to import React in every file that uses JSX
  • Smaller bundle size — slightly reduces compiled output

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 # N/A

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

vercel bot commented Dec 18, 2025

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

A member of the Team first needs to authorize it.

@yslpn yslpn changed the title Chore/new jsx transform сhore: new jsx transform Dec 18, 2025
@yslpn yslpn marked this pull request as draft December 18, 2025 14:22
@yslpn yslpn changed the title сhore: new jsx transform chore: new jsx transform Dec 18, 2025
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.61%. Comparing base (6bb8983) to head (3bbfea1).
⚠️ Report is 243 commits behind head on main.

Files with missing lines Patch % Lines
packages/react/src/format.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2387      +/-   ##
==========================================
- Coverage   77.05%   76.61%   -0.44%     
==========================================
  Files          84      100      +16     
  Lines        2157     2745     +588     
  Branches      555      715     +160     
==========================================
+ Hits         1662     2103     +441     
- Misses        382      513     +131     
- Partials      113      129      +16     

☔ 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 marked this pull request as ready for review December 18, 2025 14:35
"peerDependencies": {
"@lingui/babel-plugin-lingui-macro": "5.7.0",
"babel-plugin-macros": "2 || 3",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically speaking, this is a breaking change. Nothing wrong with that. But I say.. let's bump this to 18 and stop caring about the old versions

Copy link
Contributor Author

@yslpn yslpn Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you. If we upgraded React, we could use useSyncExternalStore to sync react state with i18n state. It's a simpler and more performant option than using useEffect.

But I need other contributors' agreement that we're ready to upgrade React to version 18.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrii-bodnar @timofei-iatsenko

What do you think about raising the React version to 18?

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