feat(jsx): base for supporting more runtimes#236
feat(jsx): base for supporting more runtimes#236kentcdodds merged 10 commits intokentcdodds:mainfrom
Conversation
cb27722 to
b301a41
Compare
kentcdodds
left a comment
There was a problem hiding this comment.
Thanks! I think I want to lowercase a few things. Other than that, this is perfect :)
kentcdodds
left a comment
There was a problem hiding this comment.
Thanks! One last thing. Could you add a note about this in the readme?
|
Of course! Still have to do few things though:
|
Co-authored-by: Kent C. Dodds <[email protected]>
fe0c597 to
3dcb9ec
Compare
|
Had quite a busy January, getting back to this! At the moment only solid test's are failing, as it complains about Client Side API usage in Server. Not entirely familiar with Solid that much, will probably jump on their Discord. WDYT about skipping Solid for now? |
|
From Solid’s discord:
this is basically because they gotta compile solid’s code. So mdx-bundler can’t really work just by replacing jsx’s runtimes imports 😞 |
|
Bummer :( |
kentcdodds
left a comment
There was a problem hiding this comment.
This looks almost perfect. I just want to make sure I understand what's going on in the package.json, and I want to ensure that there are no breaking changes for existing users.
client/package.json
Outdated
| "react": "./react.js", | ||
| "jsx": "./jsx.js", |
There was a problem hiding this comment.
What are these? This looks like it actually should be in a export config.
There was a problem hiding this comment.
Honestly, I don't know what was there... Fixed it.
There was a problem hiding this comment.
As for breaking changes regression check, probably result.code snapshot test would be best shot.
Create snapshots with separate MR, merge them into main, and then rebase into this.
There was a problem hiding this comment.
I was mostly just thinking about the imports that people have already. I'm pretty sure that you have everything wired up properly, but I just wanted to double check.
|
🎉 This PR is included in version 10.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
Few typescipt issues found for non-react uses of this. For some reason, I thought it would be good idea to test it on non-typescript repo (and I’m typescript-first guy). Got fix for type export declarations in package.json, will take a bit for JSX not to enforce react rather use what’s in consumer repo. Edit: issue is also caused in "inproper" monorepos, where |
What:
Support JSX runtimes other than react.
Why:
Allow this to be used with other JSX runtimes supported by mdxjs (https://mdxjs.com/docs/getting-started/#jsx) but not limited to. For example, this can work quite fine with https://hono.dev/ too, eventhough it's not mentioned here (thanks to a fact, that Hono is compatible with React's API)
How:
Adjust
bundleMDXto accept jsxConfig (which fallbacks to react).getMDXComponentwill have to be adjusted too, still looking for an approach which would have least breaking changes. Second paramterglobalscould be used for that, as such:Checklist:
Todo: