weave-gitops-enterprise icon indicating copy to clipboard operation
weave-gitops-enterprise copied to clipboard

Spike: Investigate newer/better gRPC generation library

Open jpellizzari opened this issue 2 years ago • 1 comments

Our gRPC gen library may be a bit old/stagnant. There may be other options out there, like this: https://buf.build/blog/protobuf-es-the-protocol-buffers-typescript-javascript-runtime-we-all-deserve

What we would want:

  • Explicit nullable types (rather than having everything be nullable)
  • Similar workflow to present (TS output, service addresses, etc)
  • Can we go from go types to a protobuf definition? Skip the convertToBlah functions?

jpellizzari avatar Oct 24 '23 15:10 jpellizzari

Unfortunately the https://github.com/bufbuild/protobuf-es/issues/372#issuecomment-1403555349 does not support google.http annotations we use. So embracing that one in particular might require moving away from grpc-gateway which might be a lot.

Another option here might be generating TS clients/types from the openapiv2 definitions that are already generated from the protobufs.. there is quite an ecosystem of openapi -> clientgen stuff.

Can we go from go types to a protobuf definition? Skip the convertToBlah functions?

This would be really cool to address. I guess this is a pretty standard protobuf use case and might not be too hard? Doing it for libs we don't completely own might be tricker. Not sure.

foot avatar Oct 24 '23 15:10 foot