on develop help sign in
Get rid of traces in Reflex.Dom.Widget.Basic and Reflex.Dom.Internal
f992dc4Ryan Trinkle
src/Reflex/Dom/Internal.hs−1
@@ -197,7 +197,6 @@ mainWidgetWithCss css w = runWebGUI $ \webView -> do
197attachWidget :: (IsHTMLElement e) => e -> Widget Spider (Gui Spider SpiderHost (HostFrame Spider)) a -> IO a
197attachWidget :: (IsHTMLElement e) => e -> Widget Spider (Gui Spider SpiderHost (HostFrame Spider)) a -> IO a
198attachWidget rootElement w = runSpiderHost $ do --TODO: It seems to re-run this handler if the URL changes, even if it's only the fragment
198attachWidget rootElement w = runSpiderHost $ do --TODO: It seems to re-run this handler if the URL changes, even if it's only the fragment
199 Just doc <- liftM (fmap castToHTMLDocument) $ liftIO $ nodeGetOwnerDocument rootElement
199 Just doc <- liftM (fmap castToHTMLDocument) $ liftIO $ nodeGetOwnerDocument rootElement
200− liftIO $ putStrLn "Using Widget2"
201 frames <- liftIO newChan
200 frames <- liftIO newChan
202 rec let guiEnv = GuiEnv doc (writeChan frames . runSpiderHost) runWithActions :: GuiEnv Spider SpiderHost
201 rec let guiEnv = GuiEnv doc (writeChan frames . runSpiderHost) runWithActions :: GuiEnv Spider SpiderHost
203 runWithActions dm = do
202 runWithActions dm = do
src/Reflex/Dom/Widget/Basic.hs+3−3
@@ -167,7 +167,7 @@ listWithKey vals mkChild = do
167 endPlaceholder <- text' ""
167 endPlaceholder <- text' ""
168 (newChildren, newChildrenTriggerRef) <- newEventWithTriggerRef
168 (newChildren, newChildrenTriggerRef) <- newEventWithTriggerRef
169 performEvent_ $ fmap (const $ return ()) newChildren --TODO: Get rid of this hack
169 performEvent_ $ fmap (const $ return ()) newChildren --TODO: Get rid of this hack
170− children <- hold Map.empty $ traceEventWith (\x -> "newChildren: " <> show (Map.size x)) newChildren
170+ children <- hold Map.empty newChildren
171 addVoidAction $ switch $ fmap (mergeWith (>>) . map snd . Map.elems) children
171 addVoidAction $ switch $ fmap (mergeWith (>>) . map snd . Map.elems) children
172 runWidget <- getRunWidget
172 runWidget <- getRunWidget
173 let buildChild df k v = runWidget df $ do
173 let buildChild df k v = runWidget df $ do
@@ -228,7 +228,7 @@ listWithKey' initialVals valsChanged mkChild = do
228 return (result, (childStart, childEnd))
228 return (result, (childStart, childEnd))
229 Just df <- liftIO $ documentCreateDocumentFragment doc
229 Just df <- liftIO $ documentCreateDocumentFragment doc
230 initialState <- iforM initialVals $ \k v -> subWidgetWithVoidActions (toNode df) $ wrapChild k v --Note: we have to use subWidgetWithVoidActions rather than runWidget here, because running post-build actions during build can cause not-yet-constructed values to be read
230 initialState <- iforM initialVals $ \k v -> subWidgetWithVoidActions (toNode df) $ wrapChild k v --Note: we have to use subWidgetWithVoidActions rather than runWidget here, because running post-build actions during build can cause not-yet-constructed values to be read
231− children <- holdDyn initialState $ traceEventWith (\x -> "newChildren: " <> show (Map.size x)) newChildren
231+ children <- holdDyn initialState newChildren
232 addVoidAction $ switch $ fmap (mergeWith (>>) . map snd . Map.elems) $ current children
232 addVoidAction $ switch $ fmap (mergeWith (>>) . map snd . Map.elems) $ current children
233 Just p <- liftIO $ nodeGetParentNode endPlaceholder
233 Just p <- liftIO $ nodeGetParentNode endPlaceholder
234 liftIO $ nodeInsertBefore p (Just df) (Just endPlaceholder)
234 liftIO $ nodeInsertBefore p (Just df) (Just endPlaceholder)
@@ -277,7 +277,7 @@ listViewWithKey' vals mkChild = do
277 endPlaceholder <- text' ""
277 endPlaceholder <- text' ""
278 (newChildren, newChildrenTriggerRef) <- newEventWithTriggerRef
278 (newChildren, newChildrenTriggerRef) <- newEventWithTriggerRef
279 performEvent_ $ fmap (const $ return ()) newChildren --TODO: Get rid of this hack
279 performEvent_ $ fmap (const $ return ()) newChildren --TODO: Get rid of this hack
280− children <- hold Map.empty $ traceEventWith (\x -> "newChildren: " <> show (Map.size x)) newChildren
280+ children <- hold Map.empty newChildren
281 addVoidAction $ switch $ fmap (mergeWith (>>) . map snd . Map.elems) children
281 addVoidAction $ switch $ fmap (mergeWith (>>) . map snd . Map.elems) children
282 runWidget <- getRunWidget
282 runWidget <- getRunWidget
283 let buildChild df k v = runWidget df $ do
283 let buildChild df k v = runWidget df $ do