grpc-web icon indicating copy to clipboard operation
grpc-web copied to clipboard

import public not supported in TypeScript code generator

Open augi opened this issue 2 years ago • 3 comments

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.

augi avatar May 17 '23 13:05 augi

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 😃

sampajano avatar May 26 '23 00:05 sampajano

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

augi avatar May 26 '23 03:05 augi

Aha ok good to know about the alternative!

Agreed that this would be a good to have still 😃

sampajano avatar May 26 '23 23:05 sampajano