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

architectural question: Can i codegen the client code for talking to the server ? #167

Closed
joeblew99 opened this issue May 25, 2016 · 3 comments

Comments

@joeblew99
Copy link

I am looking at two options:
go-swagger which because its swagger.json based, allos me to also generate the client proxy code that is used by the clent to the talk to the server. It all works but i feel that the GRPC approach is better for various reasons that are not work listing here.

So for GRPCS,I would like to know what my options are for code generating the Client code.
I have a react web client and a react native client.

I am wondering if, for the react native client, i can generate the client proxy directly off the GRPC schema itself as native code for IOS and Android.

@tmc
Copy link
Collaborator

tmc commented Jun 13, 2016

Sure, you could do so. I'm not sure if js client generation is something grpc-gateway should take on directly as needs will differ dramatically.

Here are basic starts of Flow and Elm type generators https://github.com/tmc/grpcutils/tree/master/protoc-gen-flowtypes https://github.com/tmc/grpcutils/tree/master/protoc-gen-elmtypes

I'd love for these (or something similar) to grow and generate client code as well (contributions welcomed).

@joeblew99
Copy link
Author

I agree. Its not something grpc-gateway should do i am starting to realise. At first i thought it was, but now i can see its possible for web browsers to talk to the rpc server itself. Grpc-gateway becomes a server for older third party acess essentially i guess ?

This is worth looking at. They are generating typescript and integrating with react.
https://github.com/cockroachdb/cockroach/tree/master/ui

Thanks for your links, and your efforts with that. I think i will try out those also.

@joeblew99
Copy link
Author

I would be happy to add more to your repo actually.
its exactly what i was looking for. I simple best practice example of where code gen can make our clent code more predictable / type safe etc

@yugui yugui closed this as completed Aug 23, 2016
@tamalsaha tamalsaha mentioned this issue Mar 30, 2017
1 task
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

3 participants