Skip to content

Conversation

@khankuan
Copy link
Contributor

Initial implementation for #82. Open to any feedbacks to get the feature available as soon as possible :)

@fkling
Copy link
Member

fkling commented Jul 1, 2016

So, what would be the difference between composes and dependencies now?

Do you think this handler needs to be part of react-docgen core? I'm hesitant to include any more handlers. I think this could every well be a plugin that people can use if they want to. I think we'd only need to make it easier to include handlers via the command line. What do you think?

@khankuan
Copy link
Contributor Author

khankuan commented Jul 1, 2016

I feel that composes feels like it is targeted for the case:

<div>
  <A { ...propsA } />
  <B { ...propsB } />
</div>

Whereas dependencies does not really imply any propTypes and focus on the components that are referenced in the render method. I felt that it is unnecessary to enforce that composition is done via propTypes with the spread operator. In some cases, there is no need to declare the propTypes as well such as:

<div>
  My Content
  <Divider />
  My Second Content
</div>

Also, the proposed method also includes native tags that can be useful as well.

I thought that the composition is one of the fundamental strengths of React and documenting component dependencies is an obvious benefit to be included by default. I would think that dependencies might be more useful than composes for beginners. Is there a list of plugins that are build on top of react-docgen? Personally, I would like having the handler here with all the build and test processes already well crafted and we have more radar on future regressions.

Another consideration is to combine composes and dependencies but it might dilute the meaning of composes for devs that are already using it.

Cheers :)

@khankuan
Copy link
Contributor Author

Hey, wondered if the PR could be reconsidered. Otherwise, would it be possible to cherry pick just the changes on this file: https://github.com/khankuan/react-docgen/blob/4dfb0fbc5d9ff43df9fdc5f1dfd9f6797f129728/src/utils/resolveToModule.js

@fkling
Copy link
Member

fkling commented Oct 11, 2017

You probably don't need this anymore but I update resolveToModule in 2c6e55a 😉

@fkling fkling closed this Oct 11, 2017
fkling added a commit that referenced this pull request Oct 11, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants