on develop help sign in
temp
commit785099bba0e93a42dc89a4d309519687466cea38 authorTom Smalley <tfsmalley@gmail.com> dateTue 20 Nov 2018, 15:54 (8 years ago) parent79463a3
3 files changed+30−46
reflex-dom-core/reflex-dom-core.cabal+23−22 reflex-dom-core/src/Reflex/Dom/Builder/Static.hs+1 reflex-dom-core/src/Reflex/Dom/Prerender.hs+6−24
reflex-dom-core/reflex-dom-core.cabal+23−22
@@ -64,6 +64,7 @@ library
6464 monad-control >= 1.0.1 && < 1.1,
6565 mtl >= 2.1 && < 2.3,
6666 primitive >= 0.5 && < 0.7,
67+ random,
6768 ref-tf == 0.4.*,
6869 reflex == 0.5.*,
6970 semigroups >= 0.16 && < 0.19,
@@ -144,31 +145,31 @@ library
144145 build-depends:
145146 dependent-sum == 0.4.*
146147
147−test-suite hlint
148− build-depends: base, hlint
149− hs-source-dirs: test
150− main-is: hlint.hs
151− type: exitcode-stdio-1.0
148+--test-suite hlint
149+-- build-depends: base, hlint
150+-- hs-source-dirs: test
151+-- main-is: hlint.hs
152+-- type: exitcode-stdio-1.0
152153
153154-- broken test on base 4.11 & ghc 8.4.3
154155-- needs to be updated for changes in GHC.Stats
155−test-suite gc
156− build-depends: base
157− , reflex
158− , reflex-dom-core
159− , jsaddle
160− , jsaddle-warp
161− , linux-namespaces
162− , process
163− , temporary
164− , unix
165− hs-source-dirs: test
166− ghc-options: -rtsopts -with-rtsopts=-T -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
167− ghc-prof-options: -fprof-auto -optP-DPROFILING
168− main-is: gc.hs
169− type: exitcode-stdio-1.0
170− if !os(linux) || !arch(x86_64) || impl(ghc >= 8.4.0)
171− buildable: False
156+--test-suite gc
157+-- build-depends: base
158+-- , reflex
159+-- , reflex-dom-core
160+-- , jsaddle
161+-- , jsaddle-warp
162+-- , linux-namespaces
163+-- , process
164+-- , temporary
165+-- , unix
166+-- hs-source-dirs: test
167+-- ghc-options: -rtsopts -with-rtsopts=-T -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
168+-- ghc-prof-options: -fprof-auto -optP-DPROFILING
169+-- main-is: gc.hs
170+-- type: exitcode-stdio-1.0
171+-- if !os(linux) || !arch(x86_64) || impl(ghc >= 8.4.0)
172+-- buildable: False
172173
173174source-repository head
174175 type: git
reflex-dom-core/src/Reflex/Dom/Builder/Static.hs+1
@@ -264,6 +264,7 @@ instance SupportsStaticDomBuilder t m => DomBuilder t (StaticDomBuilderT t m) wh
264264 --TODO: Do not escape quotation marks; see https://stackoverflow.com/questions/25612166/what-characters-must-be-escaped-in-html-5
265265 shouldEscape <- asks _staticDomBuilderEnv_shouldEscape
266266 let escape = if shouldEscape then fromHtmlEscapedText else byteString . encodeUtf8
267+ modify ("<!--text-->" :) -- TODO FIXME
267268 modify . (:) =<< case mSetContents of
268269 Nothing -> return (pure (escape initialContents))
269270 Just setContents -> hold (escape initialContents) $ fmapCheap escape setContents --Only because it doesn't get optimized when profiling is on
reflex-dom-core/src/Reflex/Dom/Prerender.hs+6−24
@@ -74,30 +74,12 @@ prerender server client = do
7474 endPrerenderBlock
7575 pure a
7676
77−instance ( HasJS js m
78− , HasJS js (Performable m)
79− , HasJSContext m
80− , HasJSContext (Performable m)
81− , MonadJSM m
82− , MonadJSM (Performable m)
83− , MonadFix m
84− , MonadFix (Performable m)
85− , ReflexHost t
86− ) => Prerender js (ImmediateDomBuilderT t m) where
77+instance (PrerenderClientConstraint js m, ReflexHost t) => Prerender js (ImmediateDomBuilderT t m) where
8778 prerenderClientDict = Just Dict
8879 startPrerenderBlock = return ()
8980 endPrerenderBlock = return ()
9081
91−instance ( HasJS js m
92− , HasJS js (Performable m)
93− , HasJSContext m
94− , HasJSContext (Performable m)
95− , MonadJSM m
96− , MonadJSM (Performable m)
97− , MonadFix m
98− , MonadFix (Performable m)
99− , ReflexHost t
100− ) => Prerender js (HydrationDomBuilderT t m) where
82+instance (PrerenderClientConstraint js m, ReflexHost t) => Prerender js (HydrationDomBuilderT t m) where
10183 prerenderClientDict = Just Dict
10284 startPrerenderBlock = do
10385 depth <- HydrationDomBuilderT $ asks _hydrationDomBuilderEnv_prerenderDepth
@@ -132,10 +114,10 @@ deleteToPrerenderEnd = do
132114 | t == endMarker -> do
133115 d <- liftIO $ readIORef depth
134116 if d == 0
135− then pure True
136− else do
137− liftIO $ modifyIORef' depth pred
138− pure False
117+ then pure True
118+ else do
119+ liftIO $ modifyIORef' depth pred
120+ pure False
139121 _ -> pure False
140122 pure $ n == "SCRIPT" && attrCheck) DOM.Element
141123 deleteBetweenInclusive startNode endNode