protoc-gen-ts icon indicating copy to clipboard operation
protoc-gen-ts copied to clipboard

feat: grpc-web support

Open thesayyn opened this issue 3 years ago • 1 comments

This is a branch for the initial support for the generation of grpc-web compatible clients. protoc-gen-ts always supported grpc-web but the generated source files that are generated through protoc-gen-grpc-web have always required manual intervention such as replacing imports to use protoc-gen-ts counterpart of generated pb.

Currently, one has to change imports require("./type_pb") with require("./type")

With native support of grpc-web clients, one will only have to present --ts_opt=target=web to generate grpc-web compatible clients instead of nodejs.

web implementation supports the official grpc-web implementation. other implementations such as improbable-eng/grpc-web can be added later if there is community interest!

supported RPC types are as follows;

  • UNARY
  • SERVER_STREAMING

closes #97

thesayyn avatar Dec 02 '21 10:12 thesayyn

any progress?

eyouyou avatar Jul 01 '22 09:07 eyouyou

@eyouyou I am going to put effort into this week. I made it work with a go server with rollup + typescript on the web.

thesayyn avatar Nov 15 '22 04:11 thesayyn