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

npm:@grpc/grpc-js support #23714

Open
1 of 3 tasks
satyarohith opened this issue May 6, 2024 · 2 comments
Open
1 of 3 tasks

npm:@grpc/grpc-js support #23714

satyarohith opened this issue May 6, 2024 · 2 comments
Assignees

Comments

@satyarohith
Copy link
Member

satyarohith commented May 6, 2024

We're actively working to support https://www.npmjs.com/package/@grpc/grpc-js in Deno. This issue tracks the progress.

The following client examples work with deno canary:

  • helloworld
  • cancellation
  • interceptors
  • deadline
  • metadata
  • keepalive

You can test them by cloning https://github.com/satyarohith/grpc-node/tree/es_examples and running the server using node and client using deno. We will focus on server examples once we have all the client examples working.

TODO:

  • error_handling client example
  • server examples
  • TBD

Related issues:

@AlfieJones
Copy link

It'd be awesome if we could get the static generation working too. ts-proto makes it pretty easy to generate the code with es modules & typescript.

I put together a fork of your fork with the typescript generated for the helloworld example: https://github.com/AlfieJones/grpc-node/tree/es_examples.

I used the following to generate the types:

protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=. ./examples/protos/helloworld.proto --ts_proto_opt=outputServices=grpc-js,importSuffix=.js

Currently, I'm getting the following error for that example:
"Request message serialization failure: Cannot read properties of undefined (reading 'from')"

@satyarohith
Copy link
Member Author

error_handling client example works with #23755

➜  examples git:(main) denod run -A --unstable-byonm error_handling/client.js
[1] Calling SayHello with name:""
Warning: Not implemented: Http2Session.socket
[1] Received error 3 INVALID_ARGUMENT: request missing required field: name
[2] Calling SayHello with name:"sr"
Warning: Not implemented: Http2Session.socket
[2] Received response Hello sr
[3] Calling SayHelloStreamReply with name:""
Warning: Not implemented: Http2Session.socket
[3] Received expected error 3 INVALID_ARGUMENT: request missing required field: name
[3] Received status with code=INVALID_ARGUMENT details=request missing required field: name
[4] Calling SayHelloStreamReply with name:"sr"
Warning: Not implemented: Http2Session.socket
[4] Received response Hello sr
[4] Received response Hello sr
[4] Received response Hello sr
[4] Received response Hello sr
[4] Received response Hello sr
[4] Received status with code=OK details=OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants