Open MarioSimou opened 1 year ago
This is a bug in https://github.com/joshwooding/vite-plugin-react-docgen-typescript
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: https://github.com/joshwooding/vite-plugin-react-docgen-typescript/pull/17 and https://github.com/joshwooding/vite-plugin-react-docgen-typescript/pull/20. But both provided solutions drastically increased build time and are therefore not manageable. That was also the reason why https://github.com/joshwooding/vite-plugin-react-docgen-typescript/pull/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.
@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.
@valentinpalkovic https://github.com/joshwooding/vite-plugin-react-docgen-typescript/releases/tag/v0.2.3 It seems that joshwooding/vite-plugin-react-docgen-typescript has released a new version to fix the problem. Can we upgrade it again?
I've released a snapshot to test my changes and make sure they don't have a huge performance impact
@joshwooding/vite-plugin-react-docgen-typescript@0.0.0-snapshot-20231005222330
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