Skip to content
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 support for "react-jsx" and jsxImportSource #139

Closed
wants to merge 9 commits into from

Conversation

benStre
Copy link
Contributor

@benStre benStre commented Sep 23, 2023

(See #10)

This exposes the jsxImportSource compiler option and allows the jsx option to be "preserve" | "react-jsx" | "react-jsxdev" | "react-native" | "react"

@CLAassistant
Copy link

CLAassistant commented Sep 23, 2023

CLA assistant check
All committers have signed the CLA.

@@ -0,0 +1,107 @@
import {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the snapshot tests instead so that you don't have to setup output fixtures nor repeat the logic that calls transpile. It will also cover bundle.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bundle doesn't seem to work with react-jsx and react-jsxdev.
It throws an error (Error: Unable to output during bundling).

This can be avoided by explicitly declaring the import source with /** @jsxImportSource https://esm.sh/react@17.0.2 */ in the input file.

Apparently, this issue has already been fixed for deno bundle (denoland/deno#13389).
Does this have to be implemented again for deno_emit?

@dsherret
Copy link
Member

dsherret commented Feb 8, 2024

Thanks! Landed this in #161 with attribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants