From d81c8e263824d1ff28adaedecb37fecdad393214 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 9 Aug 2018 19:29:30 -0400 Subject: [PATCH] Make StaticWidget work with the Reflex profiler --- reflex-dom-core/src/Reflex/Dom/Builder/Static.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reflex-dom-core/src/Reflex/Dom/Builder/Static.hs b/reflex-dom-core/src/Reflex/Dom/Builder/Static.hs index 5443a931..69398f15 100644 --- a/reflex-dom-core/src/Reflex/Dom/Builder/Static.hs +++ b/reflex-dom-core/src/Reflex/Dom/Builder/Static.hs @@ -41,13 +41,13 @@ import Data.Text.Encoding import Data.Tuple import GHC.Generics import Reflex.Class +import Reflex.Dom.Main (DomHost, DomTimeline, runDomHost) import Reflex.Dom.Builder.Class import Reflex.Dynamic import Reflex.Host.Class import Reflex.PerformEvent.Base import Reflex.PerformEvent.Class import Reflex.PostBuild.Base -import Reflex.Spider import Reflex.TriggerEvent.Class data StaticDomBuilderEnv t = StaticDomBuilderEnv @@ -283,12 +283,12 @@ instance SupportsStaticDomBuilder t m => DomBuilder t (StaticDomBuilderT t m) wh wrapRawElement () _ = return $ Element (EventSelector $ const never) () --TODO: Make this more abstract --TODO: Put the WithWebView underneath PerformEventT - I think this would perform better -type StaticWidget x = PostBuildT Spider (StaticDomBuilderT Spider (PerformEventT Spider (SpiderHost Global))) +type StaticWidget x = PostBuildT DomTimeline (StaticDomBuilderT DomTimeline (PerformEventT DomTimeline DomHost)) {-# INLINE renderStatic #-} renderStatic :: StaticWidget x a -> IO (a, ByteString) renderStatic w = do - runSpiderHost $ do + runDomHost $ do (postBuild, postBuildTriggerRef) <- newEventWithTriggerRef let env0 = StaticDomBuilderEnv True Nothing ((res, bs), FireCommand fire) <- hostPerformEventT $ runStaticDomBuilderT (runPostBuildT w postBuild) env0