-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[Bug]: 8.0.alpha default reactDocgen generates different output than in 7.x #25059
Comments
@valentinpalkovic it would be great if we could support tsconfig paths in the |
Relates to reactjs/react-docgen#456. @shilman we could indeed try to provide a custom importer, which handles path aliases, or someone/we contribute directly to react-docgen. |
At least reactjs/react-docgen#456 was fixed in Storybook by adjusting react-docgen's default resolver. It will be part of the next 8.0.0-rc.2 prerelease! |
react-docgen also does not seem to work in my setup:
i am unsure whether it is a problem similar to reactjs/react-docgen#456 or something else |
Facing the exact same issue as @macrozone, with React 18 and Vite, if I'm not mistaken |
The problem also occurs with tuple types generated from string arrays with const assertion, i.e.
This way of defining types is very useful as you can define the values only once as both type and values. Repro here: https://stackblitz.com/edit/github-y9fajh?file=src%2Fstories%2FExample.tsx Only string literal unions work as expected with I'm using 8.5.0-alpha.3 |
Describe the bug
react-docgen
generates different (and incomplete) documentation thanreact-docgen-typescript
; and once #24165 lands the default documentation generated by Storybook will be significantly "bad" for typescript users using typescript path aliases and enums.EDIT (@valentinpalkovic):
react-docgen
Originally posted by @csantos1113 in #24165 (comment)
To Reproduce
vite-tsconfig-paths
for those paths to resolve in vitereact-docgen
(which will be the default in 8.0 once React: Setreact-docgen
to default TS docgen #24165 is merged)react-docgen
(which will be the default in 8.0 once React: Setreact-docgen
to default TS docgen #24165 is merged)vite-tsconfig-paths
react-docgen-typescript
insteadSystem
Additional context
I understand there are foundational differences between the two libraries, and react-docgen has a bunch of open TypeScript related issues: https://github.com/reactjs/react-docgen/issues?q=is%3Aissue+is%3Aopen+typescript and the decision behind Storybook swapping the default docsgen library, and that keeping these 2 libraries working "the same" is not responsibility of the Storybook team ❤️
This is not really an issue with storybook per se, but the Storybook team might help push this forward in the right direction 🙏
I'm opening this issue per @shilman request: #24165 (comment)
Related issues
Related issues at react-docgen
The text was updated successfully, but these errors were encountered: