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

Is there an example of how to use the grpc-web implementation? #955

Closed
johnlabarge opened this issue Oct 18, 2023 · 1 comment
Closed

Is there an example of how to use the grpc-web implementation? #955

johnlabarge opened this issue Oct 18, 2023 · 1 comment

Comments

@johnlabarge
Copy link

johnlabarge commented Oct 18, 2023

I'm not exactly sure how to use the code that is generated by this project though I don't run into most of the issues that I was running into with other typescript grpc attempts (the dreaded d.ts problem), I'm having trouble getting my head around how to use the client to transport messages. I did a generation of the GrpcWeb implementation expecting something like a new MyService(host) that I could use. I'm not following how to use this.

@stephenh
Copy link
Owner

Hi @johnlabarge , yeah, per the disclaimer in the readme, ts-proto is more of a toolkit to setup protobuf stacks (with a wide variety of frameworks/conventions/etc) instead of a polished out-of-the-box that does just one thing well, which means having great tutorials for every combination/framework/etc is just not something we have.

Per grpc-web, probably the best resource is this integration test:

https://github.com/stephenh/ts-proto/blob/main/integration/grpc-web/client-ts.ts

If you'd like to turn that into a small snippet in the readme, or add a note in the readme that links to that, that would be great/very appreciated! Thanks!

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