-
Notifications
You must be signed in to change notification settings - Fork 76
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
feat(jsx): base for supporting more runtimes #236
Conversation
cb27722
to
b301a41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think I want to lowercase a few things. Other than that, this is perfect :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
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 :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these? This looks like it actually should be in a export config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I don't know what was there... Fixed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
🎉 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
bundleMDX
to accept jsxConfig (which fallbacks to react).getMDXComponent
will have to be adjusted too, still looking for an approach which would have least breaking changes. Second paramterglobals
could be used for that, as such:Checklist:
Todo: