Re:Slate, create beautiful, responsive API documentation
by Aeolun on Tuesday August 18, 2020 @08:33AM
(#24197847)
If you load all the content from the start, you also push the entire index to the client.
It could even be faster because all the HTML markup can be left out for the search index.
Re:Slate, create beautiful, responsive API documentation
by throwanem on Tuesday August 18, 2020 @09:20AM
(#24198200)
If you do it as separate static pages, though (per the upstream comment: "I wonder if there's a better way than having everything on a single page with very little compartmentalization...") then you're no longer pushing all the content to the client at once. That limits the scope of the browser's built-in search to the current page, and thus necessitates the additional complexity to regain support for searching over all the docs.
I don't know how I feel about the way they're managing the URL fragment. The way they're calling pushState, it adds history entries while scrolling, and that makes the back button behave nonintuitively; I think I'd rather see history entries created only when I click a header, or otherwise take some specific action to demonstrate the intent. That makes the back behavior easier to reason about, and also preserves the easy deep linkability that they are, imo rightly, going for.