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

Give the ability to export encode and decode methods in a separate way #773

Open
Frabat opened this issue Feb 7, 2023 · 3 comments
Open

Comments

@Frabat
Copy link
Contributor

Frabat commented Feb 7, 2023

Hi!
Currently I'm working on a project where we're using TS-proto to generate interfaces from protobuf files.
We are also using the encode methods generated by ts-proto to serialize binary messages.
Since we don't really need decode methods, and since those take up a lot of space, could be reasonable to insert a flag to generate only the encode (or decode) methods instead of both?

I've already did an edit for this, if this feature makes sense to you I could open a PR.

@stephenh
Copy link
Owner

stephenh commented Feb 7, 2023

Hi @Frabat ; sure if you wanted to modify the existing outputEncodeMethods to support values like:

outputEncodeMethods = true | false | "encode-only" | "decode-only"

I think that'd be fine. Thanks!

@Frabat
Copy link
Contributor Author

Frabat commented Feb 7, 2023

Ok awesome! I'll finish and open a pull request

@akornatskyy
Copy link

consider to look at this from the client vs server standpoint, e.g. in case of client I am interested in encode for request but decode for response... for the server it is the other way around.

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

No branches or pull requests

3 participants