-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
resolving broken deprecation message in docs #165
resolving broken deprecation message in docs #165
Conversation
Thank you for your pull request. As you may know, we require contributors to sign our Contributor License Agreement, and we don't seem to have you on file and listed as active anymore. In order for us to review and merge your code, please email cla@fb.com with your details so we can update your status. |
I've signed the CLA previously, but let me know if you need anything else here. |
This doesn't seem like it'll show the deprecation reason though. Without getting too UI |
@@ -496,7 +496,7 @@ class TypeDoc extends React.Component { | |||
{': '} | |||
<TypeLink type={field.type} onClick={onClickType} /> | |||
{ | |||
field.isDeprecated && | |||
field.deprecationReason && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to show that inline somehow?
It'll probably be something like:
{
field.deprecationReason && [
<span className="doc-alert-text">{' (DEPRECATED)'}</span>,
<MarkdownContent
className="doc-alert-text"
markdown={field.deprecationReason}
/>
]
}
Instead of reusing doc-alert-text
, though, it'd be nice to get a grey-ish text for the deprecation reason.
Thanks for the contribution @brandonblack! I'd love to get the deprecation reason as well if that's not too much troubles for you. |
@@ -496,7 +496,7 @@ class TypeDoc extends React.Component { | |||
{': '} | |||
<TypeLink type={field.type} onClick={onClickType} /> | |||
{ | |||
field.isDeprecated && | |||
field.deprecationReason && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, what's happening here?
It's entirely possible that a field is deprecated but also fails to provide a reason.
The previous code looks more correct, so we may need to look elsewhere for the source of the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leebyron looks like we're no longer passing in isDeprecated
to the DocExplorer at all. This was working, but broke in the last release. Nothing else references isDeprecated
so it wasn't noticed. Everywhere else we're simply interacting with the deprecationReason
only.
This patch sorts the issue out, but as you noted is probably just fixing a symptom of the actual issue (eg. we're not passing in both of these field values).
How about I modify this to be field.isDeprecated || field.deprecationReason
since that's really what we want anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did it get removed from the introspection query?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leebyron Hmm. Yeah, I really don't know -- definitely not removed.
Digging through commits here and in graphql-js
I don't see anything that would have caused this to change recently. It may be that this never worked as advertised.
In any case, I think checking the presence of either of these fields is what we want since deprecationReason
is an optional field.
I've resolved this in 0aa9163
Also, this doesn't have to be done in this PR, but I think we should actually filter out fields into two groups, such that all the deprecated fields appear in their own section after the supported fields. We could have this section collapsed by default if we wish. |
Yeah this is ideal. Hyo and I think we've found the reason behind the confusion and breakage |
…25.2 Update codemirror to the latest version 🚀
Relates to:
#157 (comment)
Correcting usages of
field.isDeprecated
in docs to look atfield.deprecationReason
instead restores this functionality.![screen shot 2016-09-15 at 2 09 26 pm](https://cloud.githubusercontent.com/assets/489331/18568448/3660a450-7b52-11e6-83b5-5acca93b1ced.png)
##CC: @davidcelis @Globegitter