Skip to content

realize ssr_

jiyinyiyong edited this page Sep 1, 2021 · 1 revision

realize-ssr!

This one is complicated. I wrote a long post before trying to explain this new feature. The code looks like this:

def ssr? (some? (.!querySelector js/document "|meta.respo-ssr"))
def mount-target (.!querySelector js/document "|.app"))

if ssr?
  realize-ssr! mount-target
    comp-container @*store ssr-stages
    , dispatch!

The job of realize-ssr! function is to simulate a virtual DOM of currently rendered HTML from server, so that the followed virtual DOM rendering steps can run a little easier.

Clone this wiki locally