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 Browser supported, or just Node? #202

Open
pusolito opened this issue Oct 9, 2023 · 7 comments
Open

Is Browser supported, or just Node? #202

pusolito opened this issue Oct 9, 2023 · 7 comments

Comments

@pusolito
Copy link

pusolito commented Oct 9, 2023

I'm curious if this will work in the browser as well. I tried a simple app and get a lot of errors related to missing modules. My guess is that it is due to grpc-js really being grpc-node in that it seems intended only for Node and not Browser. Can you confirm if Browsers are expected to work?

@andrewparmet
Copy link
Collaborator

Serialization does work in the browser - the conformance tests aren't run there, but there are various unit tests that execute in headless Firefox in CI.

I haven't tried running grpc-js in the browser but the runtime in this project should work anywhere it works.

@pusolito
Copy link
Author

pusolito commented Oct 10, 2023

Looks like grpc-js is not meant to work in the browser. Would you consider adding grpc-web support to enable this use case.

@andrewparmet
Copy link
Collaborator

Do you have an idea of what support for grpc-web would look like?

@pusolito
Copy link
Author

It sounds like the folks on the gRPC-web project might be able to assist and they could better answer your questions about support. My guess is it wouldn't be too much different than the work you already did for the node version in the grpc-lite library.

@andrewparmet
Copy link
Collaborator

Looks standard - we'd need to support generating a browser-compatible stub: https://github.com/grpc/grpc-web/blob/master/net/grpc/gateway/examples/echo/tutorial.md#generate-protobuf-messages-and-service-client-stub

We're able to invoke the grpc-kotlin generator for JVM directly since it's written in Kotlin. It may be possible to invoke the grpc-web plugin via forking a process and mangling package names the same way we do for grpc-kotlin.

@pusolito
Copy link
Author

Checking in to see if there is a planned timeline to incorporate this into the library.

@andrewparmet
Copy link
Collaborator

There is no planned timeline. Feel welcome to take a stab at an implementation, or I'll comment here if I begin significant work I wouldn't want to duplicate.

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