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 TypeScript #33

Closed
koddsson opened this issue Dec 6, 2018 · 6 comments
Closed

Support TypeScript #33

koddsson opened this issue Dec 6, 2018 · 6 comments

Comments

@koddsson
Copy link
Contributor

koddsson commented Dec 6, 2018

Hey hey @danielholmes 👋

I'm wondering if we can support TypeScript in relay-compiler-webpack-plugin? I've been poking around and it seems like relay-compiler now supports multiple languages and this has spawned relay-compiler-language-typescript.

I looked at the source and tried to debug a bit but can't seem to figure it out right now. I think we are hardcoding js as a parser config in the codebase and this should now be dynamic depending on the language options key.

I'm more then willing to work on this and I'll be looking at this more soon but I figured I'd open this up in case you'd have any good ideas on how we can do this.

@danielholmes
Copy link
Collaborator

Yea I'm happy to support this, I noticed they were setting up for multiple language support last time I was poking around too.

First steps I can do are some refactors so we reference the JS language module that relay-compiler provides (a bunch of that stuff is hardcoded here atm such as file extensions). From what I can see, the RelayCompilerBin is a good reference point - it basically performs the same function as we do of setting up + configuring the relay compiler.

But when it comes to checking it works with other languages, I'll need some help. I have zero experience with typescript and don't have the motivation or time right now to learn it

@koddsson
Copy link
Contributor Author

koddsson commented Dec 6, 2018

Cool! No worries, I can do the TypeScript testing and come configuring and hopefully some of the work as well 🙆‍♂️

@danielholmes
Copy link
Collaborator

danielholmes commented Dec 7, 2018

@koddsson There's a languagePlugin option now available in both v1.0.2 and v2.0.0-rc.2 . Let me know if you run in to any troubles using it with typescript

@koddsson
Copy link
Contributor Author

Sorry @danielholmes, I had a Christmas party on Saturday and didn't have time to dive into this. Something did break from RC1 to RC2 and now I get a Module not found: TypeError: _getWriter is not a function error before even supplying the languagePlugin parameter. I'm looking into seeing if I can isolate it and figure out what's borked.

@koddsson
Copy link
Contributor Author

Turns out I had the wrong relay-compiler installed in my application code! I'm writing a test right now and if that passes I'll close this!

@koddsson
Copy link
Contributor Author

I think we are good here, thanks for the help ✨

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