prisma-labs / graphql-framework-experiment

Code-First Type-Safe GraphQL Framework
https://nexusjs.org
MIT License
673 stars 66 forks source link

Support JS #85

Open jasonkuhrt opened 4 years ago

jasonkuhrt commented 4 years ago

Instances

ArcticSpaceFox commented 4 years ago

Is this something anybody works on?

jasonkuhrt commented 4 years ago

Hey @Sm03leBr00t, probably not in Q2 at least.

ArcticSpaceFox commented 4 years ago

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 :Sm03leBr00t@pb.me

jasonkuhrt commented 4 years ago

@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 commented 4 years ago

@jasonkuhrt Thanks mate, hope to hear more from you

jasonkuhrt commented 4 years ago

Question about this recently https://github.com/graphql-nexus/nexus/discussions/773

ryanking1809 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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