Skip to content
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

v11 automatic Typescript support does not play well with 3rd party components #1508

Closed
ghost opened this issue Jan 3, 2020 · 4 comments
Closed
Labels

Comments

@ghost
Copy link

ghost commented Jan 3, 2020

Current behavior

RSG v11's automatic Typescript support does not seem to play well with 3rd party components.
In <v11, in combination with react-docgen-typescript, props and methods were correctly parsed after setting the propsparser property in the config. From > v11 react-docgen was upgraded so react-docgen-typescript was no longer required.

To reproduce

Clone https://github.com/dysticus/example . It contains 2 branches: notworking and working. Not working is with v11, working is with <v11 and react-docgen-typescript.

Start the styleguide. You'll see in the the non-functional version no props and no methods, in the working branch they do appear.

Expected behavior

Props and methods should be extracted for 3rd parties to, like in versions before v11.

Thanks!

@thecodejack
Copy link
Contributor

thecodejack commented Jan 5, 2020

I see this warning in nonworking branch which means react-docgen unable to parse the component. Can you please raise the issue with react-docgen?

image

@thecodejack
Copy link
Contributor

Did a bit a of code walkthrough and realized, react-docgen never supported thirdparty lib parsing. As mentioned in https://react-styleguidist.js.org/docs/thirdparties.html#how-styleguidist-works , it always parses static files we produce. But with react-docgen-typescript, it checks for types / interfaces and them for prop parsing.

I don't see react-docgen fixing the issue anytime soon. Probable solution I can see is, suggest react-docgen-typescript for third party component parsing like before in documentation with the release.

What do you suggest @sapegin ?

@sapegin
Copy link
Member

sapegin commented Jan 6, 2020

Yeah, I guess properly documenting what's not supported by react-docgen and supported by react-docgen-typescript would be good start.

@stale
Copy link

stale bot commented Apr 5, 2020

😴 This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week without any further activity. Consider opening a pull request if you still have this issue or want this feature.

@stale stale bot added the wontfix label Apr 5, 2020
@stale stale bot closed this as completed Apr 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants