-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Support automatic JSX runtime and configuration via tsconfig.json #6501
Conversation
This pull request has been linked to and will mark 1 task as "Done" when merged:
|
Benchmark ResultsKitchen Sink 🚨
Timings
Cold BundlesNo bundles found, this is probably a failed build... Cached BundlesNo bundles found, this is probably a failed build... React HackerNews ✅
Timings
Cold BundlesNo bundle changes detected. Cached Bundles
AtlasKit Editor 🚨
Timings
Cold BundlesNo bundles found, this is probably a failed build... Cached BundlesNo bundles found, this is probably a failed build... Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. |
Should it also look at jsconfig.json? Might be weird to have to add a tsconfig file to change React settings even if you're not using Typescript |
I wondered the same. I couldn't find definitive information about it though. Does jsconfig.json support compilerOptions even though it isn't being compiled by TSC presumably? |
This makes it sound like it is:
And there is an example with |
Hmm ok. Also should tsconfig only apply to .ts and .tsx files or also to .js files in the same project? And same for the inverse? Or should they just be treated as interchangeable? |
I would say prefer tsconfig over jsconfig in |
Preact >=10.5.0 support the automatic JSX runtime: https://github.com/preactjs/preact/releases/tag/10.5.0 |
Found this "bug" about jsconfig.json not being picked up when a tsconfig.json is present, and it claims it's by design so we'll follow it. microsoft/TypeScript#15869 |
We can't don't import React when on v17? |
Fixes #6389. Fixes #4622. Fixes #3287. Fixes #614. Closes T-1038.
This adds support for the new automatic JSX runtime added in React 17. This is automatically enabled when the version of React the app depends on is >= 17.0.0.
Additionally, this adds support for reading several options from
tsconfig.json
.jsx
- Enable JSX even when an auto-detected library isn't installed. Can also be used to enable the automatic JSX runtime if set toreact-jsx
.jsxImportSource
- The import source for the automatic JSX runtime (e.g.react
orpreact
)jsxFactory
- The pragma for the classic JSX transform.jsxFragmentFactory
- The fragment factory for the classic JSX transform.experimentalDecorators
enables support for legacy decorators, as used by TypeScript.