Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support alternate protobuf "runtimes" #1030

Open
jonaskello opened this issue Feb 28, 2024 · 1 comment
Open

Support alternate protobuf "runtimes" #1030

jonaskello opened this issue Feb 28, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jonaskello
Copy link

jonaskello commented 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.

@jonaskello jonaskello added the enhancement New feature or request label Feb 28, 2024
@srikrsna-buf 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
@timostamm
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants