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 #3

Closed
dpup opened this issue Apr 19, 2024 · 0 comments · Fixed by #21
Closed

Support for annotating deprecated fields #3

dpup opened this issue Apr 19, 2024 · 0 comments · Fixed by #21
Labels
enhancement New feature or request

Comments

@dpup
Copy link
Owner

dpup commented Apr 19, 2024

From grpc-ecosystem#39

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.

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.

@dpup dpup added the enhancement New feature or request label Apr 19, 2024
dpup added a commit that referenced this issue May 12, 2024
@dpup dpup closed this as completed in #21 May 12, 2024
dpup added a commit that referenced this issue May 12, 2024
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

Successfully merging a pull request may close this issue.

1 participant