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

Add support for Typescript based React components #788

Open
jimidle opened this issue Jul 8, 2022 · 4 comments
Open

Add support for Typescript based React components #788

jimidle opened this issue Jul 8, 2022 · 4 comments

Comments

@jimidle
Copy link

jimidle commented Jul 8, 2022

Is your feature request related to a problem? Please describe.
Many graphical components are now written using typescript .tsx, and it can be awkward to create components that interface to them from .js - though I admit that a better React programmer than I am may find that to be fairly trivial.

Describe the solution you'd like
Add support for components written in Typescript, with a few examples like the d3 examples and one practical interface such as one of the React graphing libraries.

Describe alternatives you've considered
Learning how to interact with external tsx based components using .js.

Additional context
Everything seems to be written using Typescript now and Idyll is a little behind. It would definitely be an upgrade to support .tsx based components.

@mathisonian
Copy link
Member

Agreed this would be a nice thing to support. Under the hood Idyll uses esbuild, which does have support for loading typescript files. I believe we would need to update our component resolution logic to accept .ts or .tsx files (see here).

I would start by updating the component resolver, and testing if additional configuration changes to the esbuild invocation are needed.

@jimidle
Copy link
Author

jimidle commented Jul 12, 2022

I have completed this work, but I cannot create a new pull request because the pull request for #748 requires merging first. Perhaps moving to use git flow as system would help with this. I guess that I should have done this myself.

I don't want to cancel the existing pull request and create a new one because then the PR will cover two features, which is not correct.

I will await your approval of the previous PR then I can submit the PR for this one. Github will notify me when you have done this I suspect.

@mathisonian
Copy link
Member

I've just merged that PR --- thanks for the work on this!

@jimidle
Copy link
Author

jimidle commented Jul 16, 2022

No worries - when I take advantage of someone else's good work, I think it is only polite to give a little bit back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants