josemarluedke / docfy

Build fully personalized documentation sites; write content and demos in Markdown.
https://docfy.dev
MIT License
75 stars 26 forks source link

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

Open NullVoxPopuli opened 3 years ago

NullVoxPopuli commented 3 years ago

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

So, maybe:

josemarluedke commented 3 years ago

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

NullVoxPopuli commented 2 years ago

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 🤔