Skip to content

fix(create-rslib): set tsconfig jsx to react-jsx #516

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

Merged
merged 4 commits into from
Dec 4, 2024
Merged

Conversation

chenjiahan
Copy link
Member

Summary

React >= 17 should use react-jsx instead of react.

image

Related Links

https://www.typescriptlang.org/tsconfig/#jsx

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link

codspeed-hq bot commented Dec 4, 2024

CodSpeed Performance Report

Merging #516 will improve performances by 76.95%

Comparing react_jsx_1204 (64c96b8) with main (ecf9d6f)

Summary

⚡ 1 improvements
✅ 4 untouched benchmarks

Benchmarks breakdown

Benchmark main react_jsx_1204 Change
examples/react-component-bundle 351.6 ms 198.7 ms +76.95%

Copy link
Member

@fi3ework fi3ework left a comment

Choose a reason for hiding this comment

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

This was for compatibility reasons. As we didn't require a minimal react >= 16.14.0 in peer dep.

need to be updated alongside.

I checked some mainstream React libraries:

  • antd: classic
  • @tanstack/react-query: automatic
  • react-router: classic
  • mobx-react: classic
  • framer-motion: automatic

I believe moving to the new JSX runtime for new libraries is a positive step. This change can help avoid potential migration costs in the future.

@chenjiahan
Copy link
Member Author

Agreed, I have updated rslib.config.* to match with 'react-jsx`.

Copy link

netlify bot commented Dec 4, 2024

Deploy Preview for rslib ready!

Name Link
🔨 Latest commit 64c96b8
🔍 Latest deploy log https://app.netlify.com/sites/rslib/deploys/6750472ac0a94d0008bdab0a
😎 Deploy Preview https://deploy-preview-516--rslib.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@fi3ework fi3ework merged commit 78114bc into main Dec 4, 2024
18 checks passed
@fi3ework fi3ework deleted the react_jsx_1204 branch December 4, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants