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
I'm facing the specific problem that a significant amount of the generated script size of a project mine consists of scripts generated by ts-proto. I was looking into limiting what is being generated, and found the outputEncodeMethods option to be too limited: generally speaking, I have two top-level types, and for one (the request type) I only want to generate an encode method, while for the other (the response type), I only want to generate a decode method.
I would therefore like to have options to limit the generation of encode resp. decode methods to only specific types. A similar suggestion has also been made as a comment to #773: #773 (comment)
I also have a branch in which I implemented a possible solution that simply regular expressions. I'm not sure though whether this is sufficient as a general solution. I will submit a PR for it.
The text was updated successfully, but these errors were encountered:
Hi @akrennmair ; thanks for the PR! I guess that makes sense...
Out of curiosity, for your use case, is each type only primitives? Or does it have other messages?
I.e. I could see something like:
message Person -> you want to encode Person, but
message Person has a address = Address field and a pets = repeated Pet field
Such that to "encode Person", you actually end up ending encode methods for ~4-5 different messages, which seems like it would make keeping the regex updated kind of tedious? Or do you think that wouldn't be a problem?
I have been thinking as well whether it could become too tedious to manually manage the regular expression, so I wonder whether it would also makes sense to add inverted options, i.e. output{Encode,Decode}ExcludeTypes where any types matching that regex would not have their encode resp. decode methods generated.
I'm facing the specific problem that a significant amount of the generated script size of a project mine consists of scripts generated by ts-proto. I was looking into limiting what is being generated, and found the
outputEncodeMethods
option to be too limited: generally speaking, I have two top-level types, and for one (the request type) I only want to generate anencode
method, while for the other (the response type), I only want to generate adecode
method.I would therefore like to have options to limit the generation of
encode
resp.decode
methods to only specific types. A similar suggestion has also been made as a comment to #773: #773 (comment)I also have a branch in which I implemented a possible solution that simply regular expressions. I'm not sure though whether this is sufficient as a general solution. I will submit a PR for it.
The text was updated successfully, but these errors were encountered: