Métriques du dépôt
- Stars
- (11 091 stars)
- Métriques de merge PR
- (Métriques PR en attente)
Description
Objective
This is a biggie, but the core of this issue is: Make styleguidist fast.
The Problem
Semantic UI Components is a superb example of the type of use case react-styleguidist is so well suited to solve. However, the rendered styleguide is painfully slow. Items like #204 will certainly help, but the root of the problem is that we render all components on the start page.
Proposed Solution
There's probably more than a few ways that we can optimize how styleguidist renders the components, but one that I think might have the biggest bang for the buck is to use something like react-virtualized. Although react-virtualized is pitched as mainly meant for tabular data, I think it can fit this use case as well. The key being that we shouldn't render all of the components, just the ones within the viewport.
Challenge
My hunch is that this will require a re-architecture of how we load in/pass components down the tree in react-styleguidist. Right now they're passed in in such a way that I think it would prove difficult to just "pop in" something like react-virtualized (since the components are split by sections). We would also need to be careful with preserving any modified state in the component (e.g. any edits in the CodeMirror box, etc).
Alternatives
Another approach would be to only render one section at a time. This is probably a relatively low hanging fruit, but I think not as nice of a solution as still being able to scroll through all the components in a project as you can today.
Anyway, this just a thought and I wanted to get the ball rolling. What do you guys think?