Skip to content

jsdoc @deprecated is not discoverable when compiled with the removeComments flag #1025

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

Closed
dnalborczyk opened this issue Sep 23, 2021 · 1 comment · Fixed by #1033
Closed

Comments

@dnalborczyk
Copy link
Contributor

dnalborczyk commented Sep 23, 2021

because of this issue any jsdoc @ deprecated tags are not discoverable by users. e.g. this one:

* @deprecated Use `buildSubgraphSchema` instead.

depending on the timeline of the removal, some possible solutions:

  • remove the flag to strip out comments
  • in the above typescript issue is a workaround mentioned, essentially compiling twice: once for javascript, once for the ambient types. I don't think it's worth the trouble.
  • one could (search and) inject the @ deprecated tag after the build into the ambient files.
  • do nothing, leave as is - might be removed soon anyways

or better, one could also use the node.js wrapper function util.deprecate() which essentially writes a deprecated message [once for the lifetime of the application] to the console. doing so would notify javascript and typescript users regardless of what IDE has been used.

I can also provide a PR with the suggested wrapper.

@trevor-scheer
Copy link
Contributor

Thanks @dnalborczyk, I like the last suggestion and TIL. Since these warnings are natively suppressible I'd certainly entertain a PR which implements this 👍

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

Successfully merging a pull request may close this issue.

2 participants