Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Question: How do I generate client code #108

Closed
chris-kruining opened this issue Jan 17, 2022 · 7 comments
Closed

Question: How do I generate client code #108

chris-kruining opened this issue Jan 17, 2022 · 7 comments

Comments

@chris-kruining
Copy link

Hi,

I've just managed to get your plugin up and running as a replacement for --js-out. however I still generate client code with the grpc-web plugin, but that plugin has hardcoded to suffix all files with _pb, so that also means for the imports.

can I:
a) replace grpc-web with something else that generates my client stub?
b) convince this plugin to add the _pb suffix to imports (would require a patch I presume since replaceExtension(dependency, ""); has a hardcoded empty string)

@chris-kruining
Copy link
Author

nvm, I am straight up an idiot. I did not realize the plugin creates the client in the same file. old habits I suppose. Sorry to bother for nothing...

@thesayyn
Copy link
Owner

Hey,

Recently I started working on #102 which will workaround grpc-web generation. currently, the clients are generated for node.

@chris-kruining
Copy link
Author

Hey,

Recently I started working on #102 which will workaround grpc-web generation. currently, the clients are generated for node.

awesome!! need any help? recently client-to-server streaming became a reality with fetch upload streaming. Do you reckon you could implement that as well? Or could I assist by doing that myself? I also have a "feature request" of sorts that implements async generators for streaming requests in either direction :D

Again, not afraid to get my hand dirty, so just tell me if I can assist :D

@thesayyn
Copy link
Owner

I like your enthusiasm. In that PR the generation part is complete but am trying to get an e2e test running. I tend to break things without noticing.

I believe that in order to support CLIENT_STREAMING (possibly BIDI_STREAMING), you need to do some upstream work in grpc-web, tonic-web, and envoy-proxy which would be a lot of work I imagine. I would love to see this landed though.

I don't know if they would ever want to use a platform API that is not widely supported by major browser vendors.

Sometimes it is the resistance that holds you back instead of the work.

@chris-kruining
Copy link
Author

hmm, but with a working implementation of client and bidi streaming, is grpc-web no long a thing of the past, wouldn't those 2 features make browsers compatible to the point it is just another grpc client? AFAIK that is why grpc-web exists, because the browser did not support upload streaming and is therefor incompatible with grpc.

So I would think that there is not much upstream issue as an envoy proxy for example could just speak grpc both ways instead of having to translate to grpc-web.

@thesayyn
Copy link
Owner

AFAIK that is why grpc-web exists, because the browser did not support upload streaming and is therefor incompatible with grpc.

it exists because some browsers do not support HTTP/2 specific features such as frames.

So I would think that there is not much upstream issue as an envoy proxy for example could just speak grpc both ways instead of having to translate to grpc-web.

envoy proxy could speak to the origin server any way it wants but it needs to understand what grpc-web says.

Repository owner locked and limited conversation to collaborators Jan 17, 2022
@thesayyn thesayyn converted this issue into discussion #109 Jan 17, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants