From f1a1fe51fa6483e9c7326dd8b8214c55406b343f Mon Sep 17 00:00:00 2001 From: Patrick Steele-Idem Date: Tue, 18 Apr 2017 10:54:17 -0600 Subject: [PATCH] Improved docs for SSR --- docs/server-side-rendering.md | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/docs/server-side-rendering.md b/docs/server-side-rendering.md index c844ac376..48b70c5b8 100644 --- a/docs/server-side-rendering.md +++ b/docs/server-side-rendering.md @@ -27,6 +27,12 @@ module.exports = function(req) { > - [hapi](/docs/hapi) > - [koa](/docs/koa) +## UI Bootstrapping + +When a page is rendered on the server, additional code is added to the output HTML to allow the UI to instantly boot in the browser. This additional code allows UI components rendered on the server to be mounted in the browser automatically. For each _top-level_ UI component, Marko will serialize the component's data (including `input` and `state` and any properties added to the UI component instance) so that each top-level UI component can be re-rendered and mounted when the page loads in the browser. Only a "partial" re-render is done for each top-level UI component. That is, when doing the partial re-render in the browser, the DOM is not updated and no virtual DOM is actually produced. + +Marko encodes required information into attributes of rendered HTML elements and it also generates `