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

React-vite: Docgen HMR is broken #25471

Open
qiaogaolong opened this issue Jan 5, 2024 · 4 comments
Open

React-vite: Docgen HMR is broken #25471

qiaogaolong opened this issue Jan 5, 2024 · 4 comments

Comments

@qiaogaolong
Copy link

qiaogaolong commented Jan 5, 2024

Describe the bug

Comments on jsdoc modification or type modification will not be hot updated

To Reproduce

No response

System

No response

Additional context

No response

@qiaogaolong
Copy link
Author

If you extract the type declaration and then introduce it, the description will be modified and will not be updated until you restart the project.
And even if you write this on the same page, you have to refresh the page to see it. Why doesn't it support hot updates?

@qiaogaolong
Copy link
Author

image
Changes here will not take effect if you refresh the page unless you restart the project.
This is the recurring address:https://stackblitz.com/edit/github-aca5uv-rsoya7?file=src%2Fstories%2FButton.tsx,src%2Fstories%2FButton.types.ts,src%2Fstories%2FButton.stories.ts

@shilman shilman changed the title storybook/react-vite, React-vite: Docgen HMR is broken Jan 5, 2024
@shilman shilman moved this to Empathy Backlog in Core Team Projects Jan 5, 2024
@vanessayuenn vanessayuenn modified the milestones: 8.0-beta, 8.0-RC Jan 9, 2024
@vanessayuenn vanessayuenn moved this from Empathy Backlog to Empathy - Ready for work in Core Team Projects Jan 23, 2024
@vanessayuenn vanessayuenn modified the milestones: 8.0-beta, 8.0-RC Jan 29, 2024
@vanessayuenn vanessayuenn modified the milestones: 8.0-RC, 8.0-nice to have Feb 12, 2024
@vanessayuenn vanessayuenn moved this from Empathy - Ready for work to Empathy Backlog in Core Team Projects Feb 13, 2024
@ndelangen
Copy link
Member

This is due to the HMR event being handled by the react-refresh plugin.

Storybook depends on the HMR event being bubbled further up, however the react-refresh plugin catches the HMR, and doesn't let the event propagate.

This causes storybook to not be aware of the module changing.

So as of right now, when react-fast-refresh is enabled, storybook project annotations won't HMR.

@vanessayuenn what do you think the best way forwards is for this ticket?

@shilman
Copy link
Member

shilman commented May 21, 2024

Possibly related to #26881 @valentinpalkovic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Empathy Backlog
Status: No status
Development

No branches or pull requests

5 participants