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

Proposal: enhance JSDoc deprecate parameter description #976

Closed
xDivisionByZerox opened this issue May 20, 2022 · 11 comments
Closed

Proposal: enhance JSDoc deprecate parameter description #976

xDivisionByZerox opened this issue May 20, 2022 · 11 comments
Assignees
Labels
c: docs Improvements or additions to documentation c: feature Request for new feature s: needs decision Needs team/maintainer decision
Milestone

Comments

@xDivisionByZerox
Copy link
Member

Clear and concise description of the problem

As a developer using faker I want to see some intel about a deprecated method in intellisense. This could help me to figure out what I should use instead without waiting for a log that tells me.

Suggested solution

Add meaningful documentation to JSDocs deprecated parameter.

Like:

/**
  * @deprecated
  * Use faker.name.firstName instead.
  * /
faker.name.firstname()

This would result in a more excellent information box resulting and in a better developer experience by not only telling me that a method is deprecated but telling me what I should do instead.
Like:
image

Alternative

Don't do anything

Additional context

rxjs is doing the same for their operators (just ONE reference)

@xDivisionByZerox xDivisionByZerox added s: pending triage Pending Triage c: docs Improvements or additions to documentation c: feature Request for new feature s: needs decision Needs team/maintainer decision and removed s: pending triage Pending Triage labels May 20, 2022
@xDivisionByZerox xDivisionByZerox added this to the vFuture milestone May 20, 2022
@xDivisionByZerox xDivisionByZerox changed the title Proposal Proposal: enhance JSDocs deprecate parameter May 20, 2022
@ST-DDT
Copy link
Member

ST-DDT commented May 20, 2022

Should we include that also in our api docs page?

@xDivisionByZerox
Copy link
Member Author

Should we include that also in our api docs page?

I think that would be a great idea. I don't use the API docs TBH so I didn't realize they could be in need of this feature as well.

@import-brain
Copy link
Member

import-brain commented May 21, 2022

Should we include that also in our api docs page?

Yeah, I also think this would be a great idea. It would definitely improve the docs.

@xDivisionByZerox xDivisionByZerox changed the title Proposal: enhance JSDocs deprecate parameter Proposal: enhance JSDocs deprecate parameter description Jun 13, 2022
@xDivisionByZerox xDivisionByZerox changed the title Proposal: enhance JSDocs deprecate parameter description Proposal: enhance JSDoc deprecate parameter description Jun 13, 2022
@xDivisionByZerox
Copy link
Member Author

Currently, we provide this information via the @see parameter. Would we move this into the @deprecated parameter description and no longer use it (@see) for deprecations?

@xDivisionByZerox xDivisionByZerox self-assigned this Jun 13, 2022
@import-brain
Copy link
Member

Currently, we provide this information via the @see parameter. Would we move this into the @deprecated parameter description and no longer use it (@see) for deprecations?

Yeah, I think it would be more clear if we moved the information to the @deprecated parameter and wrote something like "Use this function instead".

@ST-DDT
Copy link
Member

ST-DDT commented Jun 13, 2022

If it generates a clickable link for the docs, sure go for it.

@xDivisionByZerox
Copy link
Member Author

Do you mean in the docs? Because currently there is no link in the JSDoc in my IDE :/

@ST-DDT
Copy link
Member

ST-DDT commented Jun 13, 2022

I'm referring to the api docs website:
Example: https://fakerjs.dev/api/address.html#cityPrefix

@Shinigami92
Copy link
Member

Here an image, as the link posted above by @ST-DDT will get stale some day

image

@Shinigami92
Copy link
Member

Repeating my message here from: #1067 (comment)

I would say @see => links to the replacement, @Deprecation message => message = a human readable text about what's going on 🤔

@xDivisionByZerox
Copy link
Member Author

This has been resolved by #1067.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: docs Improvements or additions to documentation c: feature Request for new feature s: needs decision Needs team/maintainer decision
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants