-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
API docs not generated for imported types #6818
Comments
Yes, indeed, we have the very same issue between
I think that it's even worse to have a duplication between the documentation and the source code. |
I disagree, we have time to get the docs generation right, let's not cloud the source. I am staunchly against duplication of any kind. |
I started some experiments: I'm not very familiar with the toolset but it seems quite reasonable from my initial time with it. I've asked for some guidance from the react-docgen project. |
@rosskevin Should we close this issue? I can live with the duplication. |
Yes |
@rosskevin Thanks :) |
Problem description
Example:
Hidden
API docsimport type {HiddenProps} from './types'
. This is done to prevent a cyclic dependency problem, as theHiddenProps
are imported by three (to be four) files:Hidden
HiddenJs
HiddenCss
(TBD)Grid
(tight integration withHidden
)I am very strongly against duplicating props just so we have documentation. In this case, we have two public components so we would probably have three copies of a reasonably extensive set of properties.
This is not the lone case, as our responsive components reference
type Breakpoint
as well, though this one seems easier as it is a bit simpler.I raised an issue and learned that react-docgen doesn't resolve imported types. I have been thinking about the solution. Duplication is a last resort and I don't think we are there yet.
Note that this is not specific to use of flow, it is also a problem importing reusable prop-types.
I am open to ideas on solutions. It is something that must be addressed before
next
is generally available.The text was updated successfully, but these errors were encountered: