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 jsxPragmaFrag
support to typescript transform
#11950
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 2ec058d:
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/27256/ |
@@ -47,15 +47,16 @@ export default declare( | |||
( | |||
api, | |||
{ | |||
jsxPragma = "React", | |||
jsxPragma = "React.createElement", |
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 change is invisible to users since (jsxPragmaFrag).split(".")[0]
still returns React
. It is meant to align with
const DEFAULT = { | |
pragma: "React.createElement", | |
pragmaFrag: "React.Fragment", | |
}; |
7e29bc1
to
2ec058d
Compare
Hi! Is there a blocker for merge or is this ready to go? |
jsxPragmaFrag
support to typescript transform
This PR adds support for
jsxPragmaFrag
so thatpreset-typescript
does not elide Fragment imports likeimport { Fragment } from "preact"
.Prior work: #9317, unfortunately that PR was abandoned due to lack of upstream support at that time. /cc @Tarnadas, the author of #9317.