-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support jsx/tsx on the api side (for mail templates, ai-jsx, etc) (#9133
) This is needed to support JSX email templates like ```jsx import { Button } from '@react-email/button'; const Email = () => { return ( <Button href="https://example.com" style={{ color: '#61dafb' }}> Click me </Button> ); }; ``` and also ai-jsx code like ```jsx /** @jsxImportSource ai-jsx */ // ... toStreamResponse( <ChatCompletion temperature={1}> <UserMessage>Write me a poem about {topic}</UserMessage> </ChatCompletion> ).body ``` The `jsx` tsconfig setting needs to be `react-jsx` to support the `jsxImportSource` setting: https://www.typescriptlang.org/tsconfig#jsxImportSource The babel jsx plugin setting needs to be `automatic` to support `jsxImportSource` comments: https://babeljs.io/docs/babel-plugin-transform-react-jsx#customizing-the-automatic-runtime-import --- @jtoar This one isn't breaking, but it does need codemods. So I added the `feature-breaking` label to make sure we don't forget about those. (Feel free to remove that label again if you have a better way of keeping track)
- Loading branch information
Showing
14 changed files
with
50 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,8 @@ | |
], | ||
"types": [ | ||
"jest" | ||
] | ||
], | ||
"jsx": "react-jsx" | ||
}, | ||
"include": [ | ||
"src", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters