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

jsx: preserve in deno.json throws and error #21129

Closed
maor-benami opened this issue Nov 9, 2023 · 5 comments
Closed

jsx: preserve in deno.json throws and error #21129

maor-benami opened this issue Nov 9, 2023 · 5 comments
Labels
invalid what appeared to be an issue with Deno wasn't

Comments

@maor-benami
Copy link

image
@dsherret dsherret added the invalid what appeared to be an issue with Deno wasn't label Nov 9, 2023
@dsherret
Copy link
Member

dsherret commented Nov 9, 2023

What would preserve mean in Deno? Wouldn't the jsx syntax error once sent to the runtime?

@maor-benami
Copy link
Author

What would preserve mean in Deno? Wouldn't the jsx syntax error once sent to the runtime?

I wanted to plug a custom jsx transform using some kind of loader plugin, but i could not manage to make it work yet.

Also, if you want to use a different jsx transform and have TypeScript be ok with it (or at least WebStorm complains about it), you need to change jsx: react in tsconfig.json to preserve (p.s. i found out that WebStorm is ok with precompile also)

@lighth7015
Copy link

lighth7015 commented Feb 4, 2024

What would preserve mean in Deno? Wouldn't the jsx syntax error once sent to the runtime?

The JSX preserve option is required, in order for JSX frameworks which aren't React (e.g. SolidJS, Vue JS) to function properly; it's so their own specific transpilers have a chance to process the JSX and, do whatever it is they need with it.

@marvinhagemeister
Copy link
Contributor

Running JSX directly without any form of transpilation will never work because JSX is not valid JavaScript. What's being asked here is for a way to hook into Deno's transpilation process to configure custom JSX transforms like for Solid or other frameworks. This API doesn't exist in Deno at the time of this writing.

The feature request for a module loading API to hook into is being tracked here #8327 .

@lighth7015
Copy link

Or to just not perform JSX transpilation- I know it's not valid, and they know it ain't valid. But if their tooling needs the raw JSX so they can function correctly lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid what appeared to be an issue with Deno wasn't
Projects
None yet
Development

No branches or pull requests

4 participants