-
Notifications
You must be signed in to change notification settings - Fork 349
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
Why are outputted protos not classes #780
Comments
Avoiding classes was just one of the original "idiomatic TS / just POJOs" design goals for ts-proto, and I think that has generally worked out + is what most users prefer / like about the library. It is not
I kinda thought we had an option to output |
Thanks, this is what I was looking for! Not outputting the whole type registry infra would be super useful - getting it to play nicely with Bazel at the moment is difficult. |
Good! Fwiw I think adding a |
I'm trying out migrating to this from a different proto library because in general this looks much better! However we have hit a bit of a roadblock. We have variables that are of types of multiple kinds of protos. For example, we have a function that looks like:
Because
ts-proto
generates an output of:rather than classes, there doesn't seem to be a way of validating the proto type in this scenario -
instanceof
doesn't work with interfaces. Is there an expected way of accomplishing this?See https://github.com/dataform-co/dataform/pull/1462/files#diff-8ac9e2a1b048a5e2289c9d7b9fcf1955150ce19191b86fc76c0e6cd7a643148a for full WIP.
The text was updated successfully, but these errors were encountered: