-
Notifications
You must be signed in to change notification settings - Fork 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
docs(ComponentDoc): refactor and optimize #2123
Conversation
…React into docs/refactor-component-doc # Conflicts: # docs/app/Components/ComponentDoc/ComponentProp/ComponentPropEnum.js
ff81326
to
e68cc88
Compare
gulp/plugins/gulp-react-docgen.js
Outdated
parsed.props = _.sortBy(parsed.props, 'name') | ||
|
||
result[relativePath] = parsed | ||
result[componentName] = parsed |
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.
posixPath
is now calculated by plugin. For key
in docgenInfo.json
will be used a component name, it's unique, so we don't to regexps to find the component info ✌️
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.
We need to make it windows compatible, so it needs to use Noed's path
module for path modification. We cannot hardcode forward or backward slashes.
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've shipped a small change, looks correct. I don't have a windows PC near and I'm not familar with path
. If you have better solution, feel free to push updates.
ca97829
to
fb6bee0
Compare
Codecov Report
@@ Coverage Diff @@
## master #2123 +/- ##
=======================================
Coverage 99.76% 99.76%
=======================================
Files 150 150
Lines 2597 2597
=======================================
Hits 2591 2591
Misses 6 6
Continue to review full report at Codecov.
|
@levithomason It's another try, it's different from that you see in #2070.
|
There are still some windows build breaking forward slashes in here, but we'll address those if we hear from windows users. |
Released in |
Splitted from #2070 for the easier review of proposed changes.
This PR is part of work (#1981, #2012) that improves docs usability and performance. Contains the deep refactor of
ComponentDoc
.Naming
This PR includes refactor of
ComponentDoc
. As before, I've refactored it to smaller components and move downshowPropsFor
toComponentProps
. But I met naming problem and I hope for your help there.ComponentProps
=>ComponentTable
- after performed refactoring, this component has been renamed, since by context it is a table with of propsComponentProps/*
=>ComponentProp/*
- there are numerous small components that represent props, I moved them there and it's what makes me doubt