Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Improve gRPC rpc service generation #3594

Closed
achingbrain opened this issue Mar 17, 2021 · 2 comments
Closed

Improve gRPC rpc service generation #3594

achingbrain opened this issue Mar 17, 2021 · 2 comments
Assignees
Labels
kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked

Comments

@achingbrain
Copy link
Member

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 with protobuf -> json generation handled by protobuf.js in the protocol module.

We have load-serivces.js files in both the client and the server which turn the json generated from the protobuf files into data structures used by @improbable-eng/grpc and @grpc/grpc but really we should be passing js stubs generated by protobuf.js instead of the json - this would let us use the types generated from the protobuf files and also means we can use the smaller minimal protobuf.js distribution instead of the light version - 6.5kb vs 16kb - https://www.npmjs.com/package/protobufjs#distributions

protobuf.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 output js+d.ts instead of json and remove the load-services.js files.

@achingbrain achingbrain added status/ready Ready to be worked kind/enhancement A net-new feature or improvement to an existing feature labels Mar 17, 2021
@whizzzkid whizzzkid assigned achingbrain and unassigned whizzzkid May 23, 2023
@SgtPooki
Copy link
Member

js-ipfs is being deprecated in favor of Helia. You can #4336 and read the migration guide.

Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterward (see #4336).

Leaving open for you to handle Alex.

@achingbrain
Copy link
Member Author

Not planned for js-ipfs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants