Skip to content
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

Support for "string" [@JSX] #2729

Open
davesnx opened this issue Nov 5, 2023 · 2 comments
Open

Support for "string" [@JSX] #2729

davesnx opened this issue Nov 5, 2023 · 2 comments
Labels
Parser parsing reason code into an AST

Comments

@davesnx
Copy link
Member

davesnx commented Nov 5, 2023

We could tag strings with the JSX attribute and run it thought a "Reason.text" or similar application where ppxes can override it. Useful to remove React.string or Jsx.text when is a Pexp_constant (Pconst_string _)

"asdasdfasdf" [@JSX]

Same as we do for the fragments, where we tag lists.

@davesnx davesnx added the Parser parsing reason code into an AST label Nov 5, 2023
@andreypopp
Copy link
Contributor

I think this can be implement on ppx level w/o any [@JSX] attributes attached to the string literals — just need to wrap string literals which are immediate children of JSX elements.

@anmonteiro
Copy link
Member

Agreed, I've relayed this to Dave privately and I'm working on a PoC to showcase this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Parser parsing reason code into an AST
Projects
None yet
Development

No branches or pull requests

3 participants