davidbonnet / astring

🌳 Tiny and fast JavaScript code generator from an ESTree-compliant AST.

Home Page:https://david.bonnet.cc/astring/demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

this object can't resolve JSXElement ?

qian1994 opened this issue · comments

commented

Motivation

Describe cases that motivate the implementation of the expected behavior.

Expected behavior

Describe how the feature should work.

Actual behavior

Describe the actual behavior of the feature or remove this section if the feature has not been implemented yet.

commented

@davidbonnet Would you be interested in me upstreaming JSX support to you?

@wooorm Through a custom generator?

commented

Yeah it makes sense to not have it in core, but it's also used frequently enough that users might want to opt in, and maintaining it with the rest may be worthwhile

Feel free to start a PR. If the JSX-specific part is tree-shakeable, it should be fine (actually, I should make sure that this is the case for source-map support, which isn't always used).

Otherwise, we could monorepo this and, e.g., publish astring and @astring/jsx.

commented

If the JSX-specific part is tree-shakeable, it should be fine (actually, I should make sure that this is the case for source-map support, which isn't always used).

You’re solving this for SourceMap by having folks pass it in though, right? Or were you thinking of something else?
My plan for JSX handlers was a similar approach.