rules_ts icon indicating copy to clipboard operation
rules_ts copied to clipboard

Why is gen_connect_es deprecated?

Open antspy opened this issue 10 months ago • 2 comments

Hi,

I am generating gRPC interfaces using ts_proto_library and setting gen_connect_es=True.

This attribute however is marked as deprecated - how come? What should use use instead? Note that I am using gRPC, not necessarily connectRPC.

antspy avatar Jun 21 '25 18:06 antspy

Hey Antspy, my guess would be that this is because the new version 2 of Connect-ES no longer uses a separate protoc-gen-connect-es plugin when generating Connect code (https://buf.build/blog/connect-es-v2#:~:text=for%20these%20APIs.-,Simplified%20code%20generation,-Connect%2DES%202.0).

That's to say: if the node_modules you're passing to ts_proto_library have a high enough version, I think it "just works"? Sorry, I'm a total bazel noob.

As for workarounds... that I'm less sure about. If you're still going through ts_proto_library I think if you're using the new version of protoc-gen-es it should automatically be generating the *_connect.pb.d.ts and js files and providing them even if you don't set gen_connect_es=True to my knowledge. (I think(?) they updated the internals of ts_proto_library so that when using v2 of protoc-gen-es ts_proto_library tries to export both the connect and regular protobuf generated files without needing extra flags to ts_proto_library)

tenzinhl avatar Jul 16 '25 19:07 tenzinhl

Thank you for your answer! That's good to know, I will have a closer look. Right now I am using gRPC anyway, so I have to call the protoc compiler directly to generate the gRPC code, but if I switch to connectRPC then I will investigate this more.

Thank you!

antspy avatar Jul 22 '25 17:07 antspy