-
Notifications
You must be signed in to change notification settings - Fork 974
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
[Change request] Disable reactDocgen task in storybook build, increasing SB build performance #5052
Comments
Thanks @Philzen! I'll try to have a look sometime this week. And most of the storybook config files are here: https://github.com/redwoodjs/redwood/tree/main/packages/testing/config/storybook. This one specifically is probably what you're looking for: https://github.com/redwoodjs/redwood/blob/main/packages/testing/config/storybook/main.js. |
@jtoar Thanks, now i slowly get it after checking the RedwoodJS Storybook reference. As much as i don't want to live without this optimization in my projects and thus can only highly recommend it, i feel this requires additional steps to make this explicit (so users don't fall into a pit of failure when they try to activate the DocGen-Plugin): Either
|
@virtuoushub thoughts on this one? @thedavidprice do we have any plans for the docs feature of storybook? |
Not a strong one, but I think I lean towards option 2:
Also curious how much Storybook 6.5 will help performance so maybe this tweak won't be necissary? ( see: https://storybook.js.org/blog/storybook-lazy-compilation-for-webpack/ ) |
My guess is that this is a miss on our part. @virtuoushub a good next step with the Storybook team would be to set up an audit where they critique our default setup and let us know what might be missing and what might be uneccesary. Also, this work was originally done by Peter P. — we can loop him in when the time is right. Near-termAs of 1.0, removing anything is technically a breaking change unless we can demonstrate otherwise. I think our next steps to get there should be:
How does all that sound? |
In my experience, performance is all over the map with Some notes on the status of this issue:
|
I think for now we just do a better job in our docs showing how to disable unused addons/features of those addons (like @Philzen's above suggestion ) rather than taking an opinion on defaults. see also: https://storybook.js.org/addons/tag/essentials related: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#docs-framework-refactor-for-react cc @thedavidprice / @jtoar |
Just saying 😉
@shilman can you elaborate? Our dev team has been using this option for ages in our projects now, and all storybook controls work fine. Our assumption back then was that docgen is only required if the storybook includes docs, but from looking at the docs i'm not that sure anymore. All i know is that when i disable it on my comparably slow machine, the rebuild time is cut down by ~25 – 30 % (also in Storybook 6.5.x), thus enhancing the development flow quite perceptible. |
@Philzen - I hear you, however the amount of Storybook configuration permutations makes it so having a default decision for every possibility is not in scope. What we have is a set of opinionated defaults, with the option for user overrides. opinion ⌚
imho this loss of a feature is not what we want for our default out of the box experience; so, I am of the opinion to leave the current defaults as is, and document our findings to aid others in the performance gains you have found. In terms of the "docs" tab, this is a known issue when If the above opinion on defaults for |
Hey @virtuoushub thanks for your patience with me until here – there actually was a lack of understanding from my side for quite a while. I have tested with re-enabled
… i sincerely didn't get it, although now as i see it, it kinda obvious 🤦 😆 When we set Our project is all Chakra UI, and that means our custom components either get a listing of ~63 inferred controls of which we normally want to touch three in average, with basically all the others requiring an object configuration making the whole component break as soon as the Set object-Button is clicked – or we'll not get a single one (for any component using BTW, i can confirm that Now as i have retested it i can only affirm that i'd never go back to the default setting – configuring a few controls via the But absolutely hear you when you say that people with other project setups have very good experiences with it and that you want to keep an "all batteries included"-philosophy for freshly created RedwoodJS projects. Hence my suggestion would be to keep the default setting, but give developers a hint about their options in the config-file, something like: // `web/config/storybook.config.js`
module.exports = {
addons: [ /* ... */ ],
features: { /* ... */ },
typescript: {
/** Default setting infers properties from your components and generates controls in storybook from them.
Set to `reactDocgen: false` if you want faster rebuild times and prefer to configure them yourself anyway
via `args` and `argTypes` (@see https://storybook.js.org/docs/react/writing-stories/args) */
reactDocgen: 'react-docgen-typescript'
}
} What do you think? |
This makes storybook rebuild components considerably faster:
Although the "docs" tab is not used in the RedwoodJS storybook setup at all, it seems to be included in the storybook dependency stack and executed by default. This causes re-rendering to pause / stop / meditate / waste our precious time at 70% of the rebuilt:
Above snippet disables this build step. An additional comment could be added so RedwoodJS users know where to look should they ever decide they need the DogGenPlugin in their storybook.
Would have contributed this as PR straightaway, but somehow could not find the origin of
web/config/storybook.config.js
in this repo.The text was updated successfully, but these errors were encountered: