-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat(docs): restore enum expansion on docs page #1266
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
Conversation
Codecov Report@@ Coverage Diff @@
## master #1266 +/- ##
=======================================
Coverage 95.91% 95.91%
=======================================
Files 882 882
Lines 4917 4917
=======================================
Hits 4716 4716
Misses 201 201
Continue to review full report at Codecov.
|
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.
Thanks, I'd like to get this support back. There are some reasons it was removed initially. I've left a comment here to address that I think will allow us to add the basic functionality back in.
return SUI[parts[1]] | ||
} else if (parts[1] === '_meta') { | ||
// these look like Sidebar._meta.props.animation | ||
return _.get(this.props, `meta.props.${parts[3]}`, value) |
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.
_meta.props
is in the process of going away and the values are being inlined into the propTypes
checkers, example. You can see progress here. Given this, we're removing all traces of _meta.props
from the codebase.
In this case, we should probably just not parse the meta.props
here at all, for now. Most the enums will show up automatically because the values can be parsed by react-docgen. Those that cannot will be those that have more complicated checkers, which, we'll have to solve another way.
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.
Removed
Thanks! |
This restores the enum display in the docs lost by #731
To get it to work I'm now parsing the docgen to get the correct values which has it's limitations. docgen is very literal when it comes to programatic propTypes, so I've tried expanding the easy ones but there's a few occurrences that are more difficult to make work (see last screenshot for an example)


