-
Notifications
You must be signed in to change notification settings - Fork 56
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 JSX #480
base: main
Are you sure you want to change the base?
Add support for JSX #480
Conversation
* Add new `JSX` export, similar to `GENERATOR`, with handlers for JSX nodes * Add unit tests for JSX nodes * Add JSX example
Codecov Report
@@ Coverage Diff @@
## master #480 +/- ##
==========================================
+ Coverage 94.97% 95.74% +0.77%
==========================================
Files 1 1
Lines 1134 1270 +136
==========================================
+ Hits 1077 1216 +139
+ Misses 57 54 -3
Continue to review full report at Codecov.
|
Enables some bundlers to tree-shake appropriately.
Thanks @wooorm for sending this, it looks great! Adding inline comments about what a node does is also a great idea. I'll have more time next week-end to apply the remaining changes:
Edit: not this one but the next one. |
here’s a PR somewhere else that types (using JSDoc comments, which I like a lot) these same functions: wooorm/xdm#24, by @ChristianMurphy |
Just a quick note to mention that I haven't forgotten this PR. |
Let me now if there's anything I could do to unblock it! |
Hi guys, I'm looking to do exactly this! Is there any update on when this will be merged, or can I help in any way? |
Friendly ping! |
@davidbonnet Friendly ping! Anything I can do? |
JSX
export, similar toGENERATOR
, with handlers for JSX nodesJSX
. For reference, if you’re interested, here is an example of how to test types. You could also opt to use JSDoc for typescript if the source is JS, which I quite like, like so. Some complexity with types though is that newer ESTree proposal aren’t typed yet, such as bigint (and I’m not sure where JSX is typed)