Skip to content

Support JS #85

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

Open
jasonkuhrt opened this issue Nov 27, 2019 · 14 comments
Open

Support JS #85

jasonkuhrt opened this issue Nov 27, 2019 · 14 comments
Labels
lang/js Related to JavaScript language interop scope/framework Related to something affecting the entire tool e.g. add JS support type/feat Add a new capability or enhance an existing one

Comments

@jasonkuhrt
Copy link
Member

jasonkuhrt commented Nov 27, 2019

Instances

@jasonkuhrt jasonkuhrt added the type/improve Something existing is made better, does not affect the interface (example: better error message) label Nov 27, 2019
@jasonkuhrt jasonkuhrt added type/feat Add a new capability or enhance an existing one and removed type/improve Something existing is made better, does not affect the interface (example: better error message) labels Apr 14, 2020
@jasonkuhrt jasonkuhrt changed the title JS support Support JavaScript Apr 24, 2020
@jasonkuhrt jasonkuhrt added the scope/framework Related to something affecting the entire tool e.g. add JS support label Apr 24, 2020
@ArcticSpaceFox
Copy link

Is this something anybody works on?

@jasonkuhrt
Copy link
Member Author

Hey @Sm03leBr00t, probably not in Q2 at least.

@ArcticSpaceFox
Copy link

What do you mean Q2? Sorry, I am just a beginner, I love the way nexus works, but typescript for me is just a pain in the ass, excuse my language. Feel free to reach out @jasonkuhrt via email :[email protected]

@jasonkuhrt
Copy link
Member Author

@Sm03leBr00t I mean the months of April/May/June.

I hear you, its definitely a learning curve, and a tradeoff. In case it helps we have some curated content to onboard with TS here: https://www.nexusjs.org/#/getting-started/onboarding?id=pre-requisites

@ArcticSpaceFox
Copy link

@jasonkuhrt Thanks mate, hope to hear more from you

@jasonkuhrt
Copy link
Member Author

Question about this recently graphql-nexus/nexus#773

@ryanking1809
Copy link

ryanking1809 commented May 12, 2020

Hey gang, +1 for javascript support, and thought I'd add my 2 cents.

I get the benefits of typescript, and it's great that Prisma and Nexus are written in typescript - it speeds up my development a lot!
But I don't think Nexus should be concerned about external typing and force people to use typescript (Prisma doesn't do this, nor does Nexus Schema, which I currently use). I've personally found typescript a huge pain in the arse to learn, and whilst I'd like to get around to it one day, it currently slows down my development process too much. Additionally, you might need to account for people using flow or other type checkers as well.

The only thing stopping me from using Nexus is I have to learn typescript first. It would be great if you supported javascript, that way I could learn typescript when I'm ready and have the time :)

ps. The framework looks like it'll be amazing and I can't wait to try it! Thanks for all the work you're putting into it!

@jasonkuhrt
Copy link
Member Author

jasonkuhrt commented May 13, 2020

Thanks for the input @ryanking1809. JavaScript will probably be supported one day, but it is a matter of priority. If many users want it then we'll do it sooner. Otherwise it might take a little longer. Either way we have no intention of not supporting JavaScript right now.

While it may seem simple we actually leverage the TS AST for quite a few features, and not just type safety ones e.g. #833.

Maybe Nexus for JS would use Babel for its AST work. Maybe we could use Babel for the TS parts too.

Another approach could be JS without 100% feature parity with the TS version (such as aforementioned #833).

@ryanking1809
Copy link

All good, thanks @jasonkuhrt. It's hard for me to tell what features will be dropped from reading #833 but if it's easy to do, could be worth testing.

@jasonkuhrt
Copy link
Member Author

jasonkuhrt commented May 16, 2020

what features will be dropped from reading #833

That one is about, all modules that import nexus get automatically added to the final bundle. We use the AST to figure this out. Frankly we could implement this one with just regex if we had to. And again Babel is another way.

@platocrat
Copy link

platocrat commented May 17, 2020

Hey gang, +1 for javascript support, and thought I'd add my 2 cents.

I get the benefits of typescript, and it's great that Prisma and Nexus are written in typescript - it speeds up my development a lot!
But I don't think Nexus should be concerned about external typing and force people to use typescript (Prisma doesn't do this, nor does Nexus Schema, which I currently use). I've personally found typescript a huge pain in the arse to learn, and whilst I'd like to get around to it one day, it currently slows down my development process too much. Additionally, you might need to account for people using flow or other type checkers as well.

The only thing stopping me from using Nexus is I have to learn typescript first. It would be great if you supported javascript, that way I could learn typescript when I'm ready and have the time :)

ps. The framework looks like it'll be amazing and I can't wait to try it! Thanks for all the work you're putting into it!

@jasonkuhrt I agree with @ryanking1809; having to learn TS first is a real pain for people who already built their apps entirely JS.

After spending more time examining the examples in prisma-examples/javascript/ and prisma-examples/typescript/, I realized that it would be faster for me to learn TS than to build a manual JS workaround myself. I'm sure they are other people besides us two who have found themselves in similar situations.

Saying this is a pain is to say the least, as I was getting ready to deploy my app and now realize that I have to spend my entire day having to learn some TS to be able to implement a deployable fullstack Prisma, GraphQL Nexus, and Next app.

@ro8t
Copy link

ro8t commented May 20, 2020

Yes, having to work all the way up to deployment with JavaScript and then realizing you must convert your codebase to Typescript is excruciatingly painful.
Could you guys provide a more specific approximation of when support will be released?
If not, what kind of software help is needed, and perhaps the community can swoop in to save the day and help you release JS support sooner rather than later?

Also happy to privately share my email for updates!

@jasonkuhrt
Copy link
Member Author

Could you guys provide a more specific approximation of when support will be released?

If the number of 👍 here ever show it as a primary bottleneck to adoption then that would give it priority.

@jasonkuhrt jasonkuhrt added the lang/js Related to JavaScript language interop label Jun 11, 2020
@jasonkuhrt
Copy link
Member Author

Added a new label to help track JS issues lang/js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/js Related to JavaScript language interop scope/framework Related to something affecting the entire tool e.g. add JS support type/feat Add a new capability or enhance an existing one
Projects
None yet
Development

No branches or pull requests

5 participants