Eliminate protobuf dependencies when using useBinaryFormat: false
#1287
Labels
enhancement
New feature or request
useBinaryFormat: false
#1287
Is your feature request related to a problem? Please describe.
I would like a smaller package when not using protobuf serialization.
Both the
ConnectRPC
protocol andgrpc-web
(application/grpc-web+json
) support JSON encoding as an alternative to protobuf. In these schemes, most of the protobuf logic is not necessary. These libraries take up a significant portion of a package (67% of the 55kb in this example).Describe the solution you'd like
I would like to rely solely on
JSON.parse
andJSON.stringify
and eliminate protobuf from the dependency tree. Unfortunately, theprotobuf
package is scattered around the tree. This would likely require changes to the generated code.While this is relevant to both Node and Web client implementations, it is more important for web.
Describe alternatives you've considered
I have tried various tree shaking and deadcode elimination techniques but have not had much success. Snipping code (i.e., replacing with stubs) is effective but cumbersome and prone to regressions.
Additional context
This is very similar--and possibly identical--to #1030.
Thanks!
The text was updated successfully, but these errors were encountered: