-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Render a Section in Isolated mode #333
Comments
I can't see a use case for that, to be honest. What's your use case? |
@okonet Additionally, we have lots of heavy components (HTML and SVG based) and the initial loading time on the browser can be longer that what we would want. And finally, the scrolling from the first component to the last one is massive. Too much information on a single page. |
I think we need to improve routing than hacking a feature for developers ;-) Show only the first section by default and and make links in the sidebar open sections in isolated mode. |
@sapegin If that's the plan, I think I will create a fork for our needs for now, as I described in my initial comment, and will move back to the original styleguidist once the routing is implemented :) |
It’s not a plan you but something that would be nice to have. So any help is very appreciated ;-) Would you mind sending a pull request with your changes? |
@sapegin Sure, I will work on this the next few days and will create the Pull Request :) |
+1 for a better routing system. I think https://github.com/router5/router5 is worth looking at. As for me, I still don't see a lot of value to render sections isolated. What I can imagine though is an introduction of "pages" that could be rendered separately (== isolated) using the better routing system. Each page could consist of "sections". |
Actually I have a use case for isolated sections: I have a UI guidelines page with complex examples of different UI patterns composed of many components. So I spend a lot of time writing examples on this page and it would be nice to have just this page in a browser and not the whole style guide. |
So if anyone wants to send a pull request for that it would be super cool ;-) |
@sapegin I'm working on this. Hopefully a PR will come in late next week :) |
@Knorcedger Awesome! 🍕 |
Created a PR here #394 Need some help to run the tests, looks like |
I agree that there are reasons one may want to display only one section (and/or component) at a time. This encapsulates the focus and provides visual boundaries to the documentation a user may care about at one time. Many component libraries with a similar layout (sidebar navigation for sections & components) will only display one thing at a time. I think this could be exposed as a simple This might be a request slightly different than what currently represents "isolated mode" since what I'm describing would include the navigation elements and the currently selected section or component documentation. |
I have a potentially similar use case: I have a bunch of simple components and a smaller number of more complex components and currently I keep them separated in two sections of a single RSG document. I would very much like to be able to split it into two separate (but cross-linked in the sidebar) RSGs with separate bundle files. |
@n1313 So you want the sidebar to show a combined tree of two independent style guides? |
This would be the perfect goal, yes. My team is considering splitting our big project into separate smaller packages and moving to a mono-repo structure, and having something that would allow developers to focus on one small thing at a time while being able to travel to another small thing reasonably quickly would be fantastic. At the moment the rough plan is to run separate styleguidist instances in each of the packages and create a "gateway" page that links all of them manually, which is kinda meh. |
I also would love a way to show a single component at a time. We've run into the issue where our styleguide is so large that it won't even load unless you go directly to an isolated component. |
Sounds like a lot of people might benefit from a simple way to have more control over the router to help achieve this. |
The question is not just about routing, this is about splitting a massive multi-megabyte js bundle into smaller chunks so that the browser doesn't die trying to parse it, and then either showing these chunks one by one or loading them on demand. |
You are right that it may not be solved wholly by routing, although that might be a logical split point for async on-demand bundles (when using webpack). Each route for a component or section would load it's bundle and the common/shared bundles.
You are also right @n1313 that routing wouldn't necessarily solve anything for your goals, outright. |
Yeah, both features would be great (I’ll try to create an issue to track it and discuss possible implementation). I think proper routing would be the first step to achieve that. |
Here it is: #494 ;-) |
Was released in 5.3.0. |
Hello,
I noticed that while it is possible to open a Component in Isolated mode, that's not possible for a Section.
With a slight modification in index.js to provide a single Section and no Components for
ReactDOM.render
I was able to render just a Section.I believe that this feature should have the same arrow that someone can see in each component to open in Isolated mode and a specific url (/#!/SECTION_NAME).
If you guys agree, I think I could work on a pull request to make this possible.
The text was updated successfully, but these errors were encountered: