From 5162ce307dbd5a8b75570bf8b3c8f6f98ab3fd58 Mon Sep 17 00:00:00 2001 From: s-ol Date: Thu, 1 Nov 2018 19:23:13 +1100 Subject: load static render before UI --- lib/mmmfs/init.moon | 5 ++--- render.moon | 13 ++++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/mmmfs/init.moon b/lib/mmmfs/init.moon index 172f0ef..d0de45b 100644 --- a/lib/mmmfs/init.moon +++ b/lib/mmmfs/init.moon @@ -22,9 +22,8 @@ render = (root, path) -> export BROWSER BROWSER = Browser root, path - str = tohtml BROWSER - str ..= on_client rehydrate, path - str + content = tohtml BROWSER + content, on_client rehydrate, path { :Key diff --git a/render.moon b/render.moon index 422ebd6..ef7f505 100644 --- a/render.moon +++ b/render.moon @@ -21,7 +21,8 @@ else with require 'root' \mount! -content = assert (render root, path), "no content" +content, rehydrate = render root, path +assert content, "no content" with io.open output_name, 'w' \write " @@ -36,13 +37,15 @@ with io.open output_name, 'w' - - + - - #{content} + + + + + #{rehydrate} " \close! -- cgit v1.2.3