rstacruz / flatdoc

Build sites fast from Markdown
http://ricostacruz.com/flatdoc
2.68k stars 260 forks source link

Consider rendering with ReactJS for zero load time. #58

Open jordwalke opened 9 years ago

jordwalke commented 9 years ago

flatdoc looks great. I was considering writing my own documentation renderer with React but flatdoc looks like it has a great start already. Have you considered rendering via reactJS? The benefit to doing so, is that you can still do all the client rendering you like, and client side interactions, but also:

  1. Those client renderings are very fast because ReactJS has a very highly optimized initial render time.
  2. You can seamlessly "prerender" docs on the server, which will just spit out markup that loads instantly in any browser - which is then brought to life after the JavaScript loads (you don't have to know any of this is happening as the user).
jordwalke commented 9 years ago

For development, you'd render on the client. For deploying docs, you'd prerender on the server and have those load instantly for users of the docs themselves.

jordwalke commented 9 years ago

Also, when rendering with ReactJS on the server with markup that doesn't have to be fetched, there's absolutely no flicker when loading the docs.

skynet commented 9 years ago

Great idea!