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
add .js
extension to react runtime for JSX transform
#12116
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit d6b0822:
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/28940/ |
9ff9aa4
to
d6b0822
Compare
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.
Since Automatic JSX transform does not work with AMD be design (facebook/react#18299 (comment)). Adding .js
will not cause issues like #10832.
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.
Thanks!
I'm afraid that despite good intentions, this is a breaking change and broke the build pipeline for a few Preact users preactjs/preact#2801 :S Made #12210 to continue the discussion |
This reverts commit 9808d25.
Previously when we transformed JSX, we auto imported from
${source}/jsx-runtime
and${source}/jsx-dev-runtime
. However, these functions don't have extensions, which will not work for vanilla JS imports (and might not work for in the future for Node). This PR adds the.js
extension to the auto import source so now we will auto import from${source}/jsx-runtime.js
and${source}/jsx-dev-runtime.js
.