Open cdelfabbro opened 2 months ago
@valentinpalkovic any idea what's going on here?
I am having the same issue, and we are not able to work with react-docgen-typescript
in local development.
The refresh time is around ~10 seconds at best, but usually around ~20 seconds for anything to update after a file has been saved.
Changing to using react-docgen
fixes this, so we have gone for this as a solution for now:
typescript: {
reactDocgen:
env.NODE_ENV === 'production'
? 'react-docgen-typescript'
: 'react-docgen',
}
Any Update on that?
Same issue, held me back from upgrading for a long time but I finally caved and looked into it more.
The ts docgen dependency, @joshwooding/vite-plugin-react-docgen-typescript
on version 0.3.0
is great and fast, but just bumping to 0.3.1
breaks and is super slow again. I checked this by manually downgrading it in my package-lock.json
This checks out because in storybook 8.1.0 changelog:
Dependencies: Upgrade
@joshwooding/vite-plugin-react-docgen-typescript
to0.3.1
and the commit for the docgen plugin was dealing with HMR issues.
Edit: Looking into that dependency, in 0.3.0 it wasn't even doing docgen on hot reload, only on initial startup. That's why it was so fast. There has got to be a way to cache or speed that up right?
The developer experience for 10s+ reload times is not workable and your options are to:
I have found by default it is including all node_modules *.tsx
files (Not respecting storybook's stories
) so I have gained some performance (~5s down to 2s) by setting include
property:
typescript: {
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
include: ['src/**/*.{ts,tsx}']
}
}
Describe the bug
Upgrading to storybook v8.1.0 and higher when having https://storybook.js.org/docs/api/main-config-typescript#reactdocgen set to
react-docgen-typescript
drastically increases the time of fast refresh (from a few milliseconds to several seconds, on an empty project).Reproduction link
https://stackblitz.com/~/github.com/cdelfabbro/demo-issue-sb-docgen
Reproduction steps
label
prop of thePrimary
story (line 21) then save.reactDocgen: "react-docgen-typescript"
byreactDocgen: "react-docgen"
(line 15) then save.For the step 5: downgrade to storybook
v8.0.10
will have the same result.System
Additional context
No response