thesayyn / protoc-gen-ts

Compile protocol buffer messages to TypeScript.
MIT License
360 stars 74 forks source link

Generation with target=web #218

Closed Hartigan closed 11 months ago

Hartigan commented 1 year ago

Hi I use protoc-gen-ts for generation typescript code for grpc service for webpage:

protoc \
    --ts_out=./generated \
    --ts_opt=target=web \
    --ts_opt=unary_rpc_promise=true \
    sample.proto

But generated code contains import * as grpc_1 from "@grpc/grpc-js"; and grpc-js definitions. I expect only grpc-web definitions with target=web option

scippio commented 1 year ago

I have a same problem :( I don't know how generate code for using in my web app. I still getting: process is not defined

thesayyn commented 1 year ago

Unfortunately, we don't have the switch to only generate client code vs server code. PRs welcome.

thesayyn commented 11 months ago

This is fixed with the rust rewrite.