-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Deno compatibility with react-jsx
runtime
#159
Comments
I feel that we should export both jsx and jsxDEV functions from the jsx-runtime file and also create a jsx-dev-runtime file. They should have the same signature, this should be an easy thing to do. Sure, this is probably the correct way to solve this. However, I made some tests a week ago, and this scared me a little bit. Bun was rendering objects in production mode, even for KitaJS. Just like as if bun in prod mode was react-only compatible. More tests using bun should be made, and probably also setup a CI for It. Originally posted by @arthurfiorette in #150 (comment) |
oven-sh/bun#5090 (comment) and oven-sh/bun#3554. Running our tests in Bun might be a problem. |
I think exporting the jsx-runtime could help to make kitajs/html even faster if you prerender the static content with this plugin: https://github.com/aralroca/prerender-macro in fact I tried to do the integration with kitajs/html, I think that with a public jsx-runtime it could be well integrated. |
This could indeed work... I'll take a look at it. It's probably just like deno's https://deno.com/blog/v1.38#fastest-jsx-transform |
I just realized that Deno has JSX precompile! that's amazing! thanks to share it |
react-jsx
runtimereact-jsx
runtime
I do not have enough time these days to test it, but the link below is pretty much self explanatory if someone would like to help me :) (I'm happy to review and help with any PRs made) https://github.com/aralroca/prerender-macro?tab=readme-ov-file#add-your-framework-example |
I put this together, seems like it's working, not sure, maybe someone here can test it.
|
Can you try with: export const prerenderConfig = { render: Html.createElement } satisfies PrerenderConfig; |
@arthurfiorette I tried the tests and it works, but I did a monkey-patch (adding the file |
nvm just saw your #166. Thanks a lot!! |
Anyone wants to work on supporting this to bun? After #166 I think only adding a CI for it would be enough |
With #166, Bun works fine. I'll let this open when "official" support for Deno will be added. |
react-jsx
runtimereact-jsx
runtime
@arthurfiorette I feel that we should export both jsx and jsxDEV functions from the jsx-runtime file and also create a jsx-dev-runtime file. They should have the same signature, this should be an easy thing to do.
@7f8ddd you should open an issue to Bun about this. Bun should handle the difference between dev and prod when it bundles. For this library, the difference is zero but for something like React you should not use the dev mode in a prod build.
Originally posted by @JacopoPatroclo in #150 (comment)
The text was updated successfully, but these errors were encountered: