docfy icon indicating copy to clipboard operation
docfy copied to clipboard

Pre-render pages + build to JSON (or some other format) for smaller bundle size.

Open NullVoxPopuli opened this issue 3 years ago • 2 comments

As a design system grows, it'd be great to offload most of the content to be on-demand.

So, maybe:

  • all the pages are pre-rendered
  • but when doing in-app transitions, each page (or group of pages? idk) is a remote request?

NullVoxPopuli avatar Mar 22 '21 19:03 NullVoxPopuli

Yeah, I thought about this, but I don't like the idea of sending the JSON with HTML/Handlebars over. It would also mean we need to compile templates on the client. A different approach would be relying on Route Splitting as other documentation sides do. In Ember, you can do that using Embroider.

Note, Embroider doesn't work with Prember yet: https://github.com/ef4/prember/issues/59

josemarluedke avatar Mar 22 '21 20:03 josemarluedke

I think I would still like an option to do this, because for a mostly internal set of docs, shipping the compiler is an acceptable tradeoff, and we want to optimize build time. Our docs at this moment can take ~ 20-30 minutes to build on C.I. now. I believe 15-20 of those minutes could be totally eliminated by just not compiling all those docs during the build. Waiting for embroider isn't really an option because a giant tree of dependencies that need support first 🤔

NullVoxPopuli avatar Sep 30 '21 09:09 NullVoxPopuli