grpc / grpc-web

gRPC for Web Clients
https://grpc.io
Apache License 2.0
8.59k stars 765 forks source link

import public not supported in TypeScript code generator #1339

Open augi opened 1 year ago

augi commented 1 year ago

It looks like import public feature of Protofile is not supported correctly when generating TypeScript code.

The generated code contains plain import * as in the file that corresponds to the Protofile with import public, and so the file where the transitive type is used is invalid, because of missing import. As TypeScript doesn't support a feature like import public (IMHO), the code generator should generate the transitive imports manually.

sampajano commented 1 year ago

Thanks for the report @augi! This sounds reasonable to me :)

Is this an important use case for you? If you'd like to contribute a solution here, would be happy to provide code reviews 😃

augi commented 1 year ago

Hello, we could change the protos so we solved this by using just plain _import_s. So it is not a blocker for us.

sampajano commented 1 year ago

Aha ok good to know about the alternative!

Agreed that this would be a good to have still 😃