This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
Improve gRPC rpc service generation #3594
Labels
kind/enhancement
A net-new feature or improvement to an existing feature
status/ready
Ready to be worked
In order to implement bidirectional streaming in the gRPC server and client we mix
@improbable-eng/grpc
on the client and@grpc/grpc
on the server withprotobuf
->json
generation handled byprotobuf.js
in the protocol module.We have
load-serivces.js
files in both the client and the server which turn thejson
generated from theprotobuf
files into data structures used by@improbable-eng/grpc
and@grpc/grpc
but really we should be passingjs
stubs generated byprotobuf.js
instead of thejson
- this would let us use the types generated from theprotobuf
files and also means we can use the smallerminimal
protobuf.js
distribution instead of thelight
version - 6.5kb vs 16kb - https://www.npmjs.com/package/protobufjs#distributionsprotobuf.js
can generate server/client stubs for gRPC rpc APIs but currently only for unary calls. protobufjs/protobuf.js#1115 adds support for client/server/bidirectional streaming code/type gen - this needs to be landed somehow, then we can change our stub generation to outputjs+d.ts
instead ofjson
and remove theload-services.js
files.The text was updated successfully, but these errors were encountered: