Support for JSX automatic runtime
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start by tracing React-Live's Sucrase transformation path, focusing on how JSX is currently compiled and where transform options are exposed. Add support for selecting React's automatic JSX runtime, then verify that React 19 no longer reports the outdated JSX transform warning in live playgrounds.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues
Code of Conduct
- I agree to follow this project's Code of Conduct
Feature Request
When upgrading Docusaurus to React 19, I noticed some warnings in documentation pages containing React-Live playgrounds
It turns out React 19 has a new warning in dev mode:
VM59912:5 Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform Error Component Stack
at Hello (<anonymous>)
at ErrorBoundary (eval at ../node_modules/react-live/dist/index.mjs (vendors-node_modules_parse-numeric-range_index_js-node_modules_react-live_dist_index_mjs-node-bdedd5.js:338:1), <anonymous>:161:10)
at div (<anonymous>)
at LivePreview (eval at ../node_modules/react-live/dist/index.mjs (vendors-node_modules_parse-numeric-range_index_js-node_modules_react-live_dist_index_mjs-node-bdedd5.js:338:1), <anonymous>:331:29)
at ErrorBoundary (eval at ../packages/docusaurus/lib/client/exports/ErrorBoundary.js (main.js:1021:1), <anonymous>:29:9)
at BrowserOnly (eval at ../packages/docusaurus/lib/client/exports/BrowserOnly.js (__comp---theme-blog-post-pageccc-cab.js:488:1), <anonymous>:19:24)
at Preview (<anonymous>)
By default, React-Live is using Sucrase to transform the code, but there's no ability to customize the JSX runtime (classic by default).
An option to turn on the automatic runtime would be welcome to get rid of this warning.
To be honest, I'm not 100% sure why there is a warning, considering React.createElement is considered fine although not optimal according to the linked page.
Note
The functions inside react/jsx-runtime and react/jsx-dev-runtime must only be used by the compiler transform. If you need to manually create elements in your code, you should keep using React.createElement. It will continue to work and is not going away.
In any case, it looks future proof to support the automatic runtime in this lib
- Dominant language
- TypeScript
- Stars
- 4.6k
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from FormidableLabs/react-live
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
FormidableLabs/react-live#419 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
FormidableLabs/react-live#417 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
FormidableLabs/react-live#415 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 52/100
FormidableLabs/react-live#413 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
FormidableLabs/react-live#411 · 1 comment ·
All issues in FormidableLabs/react-live
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·