Exploration for Server-side Rendering

Over the last year, I’ve been exploring the different approaches that people have taken to achieve SSR with Elm.

Rather than using JSDOM or Puppeteer, @eeue56’s elm-static-html-lib took a JavaScript object, decoded it (from a decode function referenced in Main) in Elm and then was passed into the Main’s view function to render as a HTML on the server.

However that library is now deprecated as of 0.19, although it was forked by Daniel Wehner: https://github.com/dawehner/elm-static-html-lib.

The tradeoff with the above, was that the Model needed to be identical to the JavaScript object.

With all of the different approaches, I haven’t seen a rehydration technique similar to what was used by @ktosiek. @ktosiek, I think if you can further develop your elm-ssr-demo exploration, so that it encompasses tasks and commands, that would be awesome.

Also as a side note, the elm-ssr-demo isn’t working for me now we have the 0.19.1 update – I’m getting a “Mangling failed on regexp” error.

1 Like