-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[chore] Use new JSX Transform #7419
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
base: bp6
Are you sure you want to change the base?
Conversation
Manually port other components not covered in codemodBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
3a932db
to
cacdb2c
Compare
Manually port other components not covered in codemodBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
@@ -1,7 +1,7 @@ | |||
{ | |||
"extends": "./tsconfig.base", | |||
"compilerOptions": { | |||
"jsx": "react", | |||
"jsx": "react-jsx", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -179,7 +177,7 @@ export default { | |||
legacyDecorator: true, | |||
react: { | |||
refresh: !IS_PRODUCTION, | |||
runtime: "classic", | |||
runtime: "automatic", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting this to "automatic" uses the new JSX runtime module
https://swc.rs/docs/configuration/compilation#jsctransformreactruntime
Use
runtime: automatic
to use a JSX runtime module (e.g.react/jsx-runtime
introduced in React 17).
Proposed changes
React 17 introduced a new JSX transform that has the following benefits:
This change switches Blueprint to use the new transform since it is now on React 18.
How was this PR created?
This change was made by first running
update-react-imports
fromreact-codemod
. This transformed an initial set of files. The remainder of components that were not processed were edited manually through find and replace.References: