protoc-gen-ts
protoc-gen-ts copied to clipboard
feat: grpc-web support
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
any progress?
@eyouyou I am going to put effort into this week. I made it work with a go server with rollup + typescript on the web.