-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Addon docs: Display @deprecated props #9721
Comments
Great feature @ricovitch!!! cc @patricklafrance |
@domyen if you can provide some guidance for the UI I can add support for deprecated in 6.0 |
That’s awesome! Can you tell me more. Is this the use case of a component
api (props) changing and the component author wanting to mark it as
deprecated?
…On Fri, Feb 7, 2020 at 12:28 PM Patrick Lafrance ***@***.***> wrote:
@domyen <https://github.com/domyen> if you can provide some guidance for
the UI I can add support for deprecated in 6.0
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9721?email_source=notifications&email_token=AACAJWKTD5CDFK6F2UHW743RBWK2ZA5CNFSM4KPDLQ3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELD32PY#issuecomment-583515455>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACAJWNYBYD72DTI6ZHHH2TRBWK2ZANCNFSM4KPDLQ3A>
.
|
@domyen yes this is exactly what it is. Here's how it could be use:
|
Thanks for the context @patricklafrance and @ricovitch. Styleguidist has a pleasant deprecated experience! That's a good starting point for us. Strawman design with a few adjustments.
For instance this would render everything the comment as normal but omit
In practice, the way I'd use this myself in Storybook's Design System is to start with the badge.
It's also common for component libraries to have other badges like "Experimental" and "Undocumented". We could use the same technique to show them as well. What do y'all think? |
@domyen thanks! I like the idea of moving the props at the end of the table and using badges for “deprecated” and “experimental”. My only concerns here is about the deprecation message. I feel like there should be more emphasis on it since it’s not near the badge. What do you think? |
@domyen love the idea of the @deprecated and @experimental badges. I also agree with @patricklafrance about the emphasis on the message. Would it be possible to put the badges near the message ? I'm asking myself about usefulness of leaving the original message if it's deprecated. |
I like @domyen's layout since it makes good use of space. We could lighten the original usage message, type, and default value to subdue them, so they are still available but the deprecation method is the focus. |
Thanks for the feedback everyone. The intended behavior here is to extract I don't think we need to do anything to the description. It's easier to implement and leaves the control in the authors hands. If they want to replace the message with alternate instructions they should do that via a regular comment. |
Repro: 94a8ae7 |
Hello guys! |
I don’t think this has been built yet. Would be open to a PR from folks in
the community.
…On Fri, Dec 4, 2020 at 3:20 PM Guilherme Prezzi ***@***.***> wrote:
Hello guys!
Any updates?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9721 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACAJWIPIRSNVJVMLVHE5YDSTFACBANCNFSM4KPDLQ3A>
.
|
I have another workaround using compodoc json:
It allows usage
|
this pr mark LocationBias as deprecated in favor of the new Geolocation component. I checked if storybook have some feature to inform user that a component is deprecated, there's an open feature request: storybookjs/storybook#9721 for displaying @deprecated props but nothing official yet. I did come across a custom addon: https://storybook.js.org/addons/@etchteam/storybook-addon-status which seems to work quite nicely. Show "Deprecated" status for location bias stories: <img width="782" alt="Screen Shot 2022-11-16 at 4 31 20 PM" src="https://user-images.githubusercontent.com/36055303/202298691-49bd8a5a-9332-4f93-8f42-0a7c408ae052.png"> J=SLAP-2448 TEST=none
Anything new on the issue? What's the best way to implement |
We are also interested in this so that we don't need to add an additional note elsewhere for deprecated props. I'd be happy to throw something together if someone can point me to the right area of the code (kind of dizzying navigating between the packages). |
Hello! Are there any updates on this? Would be amazing to have this as the current |
For anyone interested, we currently manage deprecated props by using a specific jsdoc description
Also we declare deprecated props separately from supported props, so that argstable display them at the end of the table.
I would love the possibility to display a badge in addition to the description, to make it more obvious. |
I'm using the Even still, I can't get the automatic deprecation working with the comment. |
For library maintainers using storybook docs to document components props, it's very useful to be able to document deprecated props.
We just migrated from styleguidist to storybook and this was nicely managed with styleguidist by parsing "@deprecated" jsdoc comments.
Corresponding prop would then be displayed striked through, and bold, making it easy to visualize for end users.
Describe the solution you'd like
Please parse "@deprecated" jsdoc comments and add styles in Props table for them
Describe alternatives you've considered
For now we have filtered deprecated props in the tsDocgenLoaderOptions / propFilter config.
So we do not display them, but that's a temporary solution.
EDIT : We replaced js doc "@deprecated" comments with something like this as a workaround
Are you able to assist bring the feature to reality?
I would like to help, but i really don't know where to start.
Additional context
Styleguidist deprecated props display
The text was updated successfully, but these errors were encountered: