-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Fix react/jsx-runtime import in built files #73391
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
Conversation
|
Nice, I didn't realize we had already adopted the |
This needs to be tested against a few major codebases via local package linking. I am planning to do so for Jetpack. People may try the same for any other large codebases. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +69 B (0%) Total Size: 2.49 MB
ℹ️ View Unchanged
|
|
For me this feels like a regression. We want to move away more from |
| const emotionPlugin = babel( { | ||
| filter: /\.[jt]sx?$/, | ||
| config: { | ||
| presets: [ |
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.
This is restores a behavior that we abandoned before. So I don't really think that this is the right path forward.
Then I think #73258 is the right approach. |
An attempt to fix #73257 and an alternative to #73258 as discussed in #73258 (comment)
Ideally, the consumer packages should never really need to install
reactorreact-domas a dependency, nor should we mention it as a peer dependency because all of our react packages use@wordpress/elementas a dependency. But, our build output contains jsx import fromreact/jsx-runtimewhich causes build issues for the consumer build tools.What?
Closes
Why?
How?
/jsx-runtimeand/jsx-dev-runtimesub-paths from the element packagejsx-runtimefrom@wordpress/elementTesting Instructions
npm run buildreact/jsx-runtimeTesting Instructions for Keyboard
Screenshots or screencast