You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In our codebase using type aliases and plain javascript objects it the idiom for the application code. We are currently using ts-proto and custom built libraries for the infrastructure code to make this possible. The custom libraries we built are similar to connect-es so I was looking into if we could just use connect-es instead. What I found was that use of connect-es is dependent on the use of the specific flavor of classes generated by buf code generation. These do not fit in our codebase as we don't use classes, just plain objects and type aliases.
Describe the solution you'd like
It was suggested in this comment that connect-es could support alternative "runtimes". I think this means being able to pass connect-es the serialization functions separate from the data. This way we could use any type of code generation we want and still make use of the connect-es libraries.
Please specify whether the request is for Connect for Web or Connect for
Node.js.
Both
Describe alternatives you've considered
Building our own implementation of connect protocol from scratch. Would be nice to use the reference implementation to avoid that work.
Additional context
I would like to avoid making this into a debate of what is idiomatic or not in javascript/typescript. If the request does not align with the goals of es-connect then please just close this issue instead.
The text was updated successfully, but these errors were encountered:
srikrsna-buf
changed the title
Support alternate "runtimes" (eg. plain javascript object types aliases generated by ts-proto)
Support alternate protobuf "runtimes"
Feb 28, 2024
Is your feature request related to a problem? Please describe.
In our codebase using type aliases and plain javascript objects it the idiom for the application code. We are currently using ts-proto and custom built libraries for the infrastructure code to make this possible. The custom libraries we built are similar to connect-es so I was looking into if we could just use connect-es instead. What I found was that use of connect-es is dependent on the use of the specific flavor of classes generated by buf code generation. These do not fit in our codebase as we don't use classes, just plain objects and type aliases.
Here is an example of code causing the coupling: https://github.com/bufbuild/protobuf-es/blob/8745d7224980eff85344b68d018c956359626e3e/packages/protobuf/src/service-type.ts#L62
Describe the solution you'd like
It was suggested in this comment that connect-es could support alternative "runtimes". I think this means being able to pass connect-es the serialization functions separate from the data. This way we could use any type of code generation we want and still make use of the connect-es libraries.
Please specify whether the request is for Connect for Web or Connect for
Node.js.
Both
Describe alternatives you've considered
Building our own implementation of connect protocol from scratch. Would be nice to use the reference implementation to avoid that work.
Additional context
I would like to avoid making this into a debate of what is idiomatic or not in javascript/typescript. If the request does not align with the goals of es-connect then please just close this issue instead.
The text was updated successfully, but these errors were encountered: