-
Notifications
You must be signed in to change notification settings - Fork 189
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
Can i generate some TSX/JSX code somehow? #240
Comments
Hey @Anonyfox, JSX/TSX support is definitely planned along with the features you mentioned. The lack of JSX support really stands out in this report. At the current moment, you can still navigate JSX nodes, but there won't be any nice helper methods. For manipulation you can insert or replace text by using what's outlined on this page, but it won't be that nice to use. I'll up the priority on getting JSX support because a lot of those other nodes that aren't wrapped could probably wait a little bit. |
Unfortunately this is now blocked by #249 because there's a new supported language feature called jsx fragments that's only in 2.7.1. I'll try to get #249 done sometime this week. The manipulation part has not been implemented yet though. That could be implemented in parallel with #249. |
Ok, #249 is implemented and these nodes are wrapped and available now. I'll implement manipulating them soon. |
we can't wait to use it! keep up the good work! :) |
Hey @Anonyfox, I'll have at least a I'm going to be pretty busy over the next two weeks, but after that I'll be able to work on this full steam ahead :) |
@Anonyfox there's now a |
Seems like there's more foundational work I need to do before finishing this.
Seems like there's more foundational work I need to do before finishing this.
This project is amazing! Great work! I'm wondering when this feature will be complete / if there is anything I can do to help. TSX files are all the rage these days. My project needs to load and manipulate them almost exclusively. LMK! |
@ryanhaney thanks for the compliments! Yeah, I had stopped working on this because I wasn't sure about how to deal with these whitespace JSXText elements: https://ts-ast-viewer.com/#code/MYewdgzgLgBFCm0YF4YB4CiAbeBbeYUAfALABQMl62eBsA9KWWvTfoUQNxA I think I know now, but it's a bit of work. I'm going to up the priority on this one and start work on it right away. |
Hey @dsherret, Any update on this one? Could we help in any way? P.S. Our whole team loves this project too! |
@dsherret Any update on this one? |
@dsherret Hi, any update? |
@dsherret how might we help you? |
I've been able to write this using https://ts-morph.com/manipulation/transforms - while it's not ideal it works. |
@dsherret is there any updates on this? if there is away to do it even if it is not ideal or missing some fature, could you please point me out to the docs or at least an example? |
Let's say I want to generate a function which returns some TSX, like:
how would I define the function body? The only method I have found for now is using a multiline string and call
setBodyText()
with it. Also, modifying eg: stuff within the<head></head>
in a clean way would be really awesome! Is there any support for TSX planned?The text was updated successfully, but these errors were encountered: