-
-
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]: Storybook fails to regenerate react docs in HMR - v7 #21729
Comments
Also, experiencing this issue. It makes it very frustrating to iterate on documentation. @valentinpalkovic do you know much about what needs to be done to fix that bug? I would be happy to make a contribution if I knew where I should be looking |
@william-will-angi The Vite Plugin only instantiates the Typescript builder in the very beginning and doesn't launch a watcher, which takes care of updates. There were attempts to fix this issue: joshwooding/vite-plugin-react-docgen-typescript#17 and joshwooding/vite-plugin-react-docgen-typescript#20. But both provided solutions drastically increased build time and are therefore not manageable. That was also the reason why joshwooding/vite-plugin-react-docgen-typescript#17 was reverted. |
Since the issue lies in the vite plugin, I'll close this issue now. Please let me know if you think there's something else that can be done here. |
@valentinpalkovic |
I've released a snapshot to test my changes and make sure they don't have a huge performance impact
|
We are reverting this change, as it was too slow in many projects. |
Describe the bug
I am trying the latest storybook version and came across an issue that took me a while to find. When am running storybook in dev mode, using vite as a framework, any change I make on my code is tracked and triggers a HMR. Essentially, this is an HTTP request that fetches the latest changes of my component. As long as I am not changing anything related to the types of my component, the component will run as expected and I won't notice any issues, but if I change the types of my component, the react-docgen fails to trigger and updates the docs of my component. In order to pull the latest type changes, I need to restart the storybook server, which is not very convenient
To Reproduce
yarn storybook
.Button.tsx
file and add update theButtonProps
type adding a new property. Add aconsole.log
somewhere within the compoent using the new prop.hmr update
and a new request triggered in the Network tab related toButton.tsx
file. Even if the new file includes the new logic I have added in my component, react-docgen didn't trigger a new generation, meaning that the docs still lacking the new prop I have addedRepository
System
Additional context
No response
The text was updated successfully, but these errors were encountered: