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 for annotating deprecated fields #39

Open
samstradling opened this issue Jul 8, 2022 · 0 comments
Open

Support for annotating deprecated fields #39

samstradling opened this issue Jul 8, 2022 · 0 comments

Comments

@samstradling
Copy link

If a field is deprecated in the proto definitions, such as

message MyMessage {
  string field_a = 1;
  string field_b = 2 [deprecated = true];
}

Would it be possible to add a deprecated annotation to the generated types:

export type MyMessage = {
  fieldA?: string
  /**
   * @deprecated
   */
  fieldB?: string[]
}

If it did, the typescript compiler picks this up giving a warning:
Screenshot 2022-07-08 at 18 40 35

This is useful when deprecating an old field (and often moving to a new one) in a large codebase as it gives a visual indication where the old one is used.

@samstradling samstradling changed the title Support for deprecated fields Support for annotating deprecated fields Jul 8, 2022
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

1 participant