react-ssg icon indicating copy to clipboard operation
react-ssg copied to clipboard

[Todo] Should solve for the following problems

Open zaydek opened this issue 5 years ago • 1 comments

  • ~~How to React~~
  • How to ~~<ClientRender>~~ or <ServerRender> routes with React
  • ~~How to markdown with React~~
  • ~~How to route with React (react-router-dom or page-based routing?)~~ (title is not automatic because of routing — if we use vs. <Link> this is probably not the case)
  • And by extension how to blog with React (probably needs support for front matter parsing / JSON)
  • ~~How to Duomo with React~~ (not fully integrated)

zaydek avatar Dec 05 '20 12:12 zaydek

Is it possible to model routing compositionally and if so then we can lean into client vs. server-rendered components. Alternatively, if we need to resolve to a data structure, this is probably easier since it’s basically a property we look for and conditionally render.

So the thing is , for dynamic routes we don’t need to do this: ReactDOMServer.renderToString(<Document route={routes[key]} />. In theory we just render an empty <div id="root">. That should be fine since the entry point for esbuild doesn’t care about this — esbuild simply compiles JS, and the SSG file actually generate the HTML files.

zaydek avatar Dec 14 '20 17:12 zaydek