on develop help sign in
Change "ssr" attr to "data-ssr"
97432adTom Smalley
reflex-dom-core/src/Reflex/Dom/Builder/Hydration.hs+1−1
@@ -439,7 +439,7 @@ makeElement elementTag cfg child = do
439 Nothing -> setAttribute e n v
439 Nothing -> setAttribute e n v
440 Just ans -> setAttributeNS e (Just ans) n v
440 Just ans -> setAttributeNS e (Just ans) n v
441 pure e
441 pure e
442− ssrAttr = "ssr" :: DOM.JSString
442+ ssrAttr = "data-ssr" :: DOM.JSString
443 hasSSRAttribute :: DOM.Element -> HydrationRunnerT t m Bool
443 hasSSRAttribute :: DOM.Element -> HydrationRunnerT t m Bool
444 hasSSRAttribute e = case cfg ^. namespace of
444 hasSSRAttribute e = case cfg ^. namespace of
445 Nothing -> hasAttribute e ssrAttr <* removeAttribute e ssrAttr
445 Nothing -> hasAttribute e ssrAttr <* removeAttribute e ssrAttr
reflex-dom-core/src/Reflex/Dom/Builder/Static.hs+1−1
@@ -287,7 +287,7 @@ instance SupportsStaticDomBuilder t m => DomBuilder t (StaticDomBuilderT t m) wh
287 StaticDomBuilderT $ do
287 StaticDomBuilderT $ do
288 let shouldEscape = elementTag `Set.notMember` noEscapeElements
288 let shouldEscape = elementTag `Set.notMember` noEscapeElements
289 (result, innerHtml) <- lift $ lift $ runStaticDomBuilderT child $ StaticDomBuilderEnv shouldEscape Nothing
289 (result, innerHtml) <- lift $ lift $ runStaticDomBuilderT child $ StaticDomBuilderEnv shouldEscape Nothing
290− attrs0 <- foldDyn applyMap (Map.insert "ssr" "" $ cfg ^. initialAttributes) (cfg ^. modifyAttributes)
290+ attrs0 <- foldDyn applyMap (Map.insert "data-ssr" "" $ cfg ^. initialAttributes) (cfg ^. modifyAttributes)
291 selectValue <- asks _staticDomBuilderEnv_selectValue
291 selectValue <- asks _staticDomBuilderEnv_selectValue
292 let addSelectedAttr attrs sel = case Map.lookup "value" attrs of
292 let addSelectedAttr attrs sel = case Map.lookup "value" attrs of
293 Just v | v == sel -> attrs <> Map.singleton "selected" ""
293 Just v | v == sel -> attrs <> Map.singleton "selected" ""
reflex-dom-core/test/hydration.hs+2−2
@@ -265,9 +265,9 @@ tests wdConfig caps _selenium = do
265 it "has ssr attribute, removes ssr attribute" $ runWD $ do
265 it "has ssr attribute, removes ssr attribute" $ runWD $ do
266 let checkSSRAttr = do
266 let checkSSRAttr = do
267 e <- WD.findElem $ WD.ByTag "div"
267 e <- WD.findElem $ WD.ByTag "div"
268− assertAttr e "ssr" (Just "")
268+ assertAttr e "data-ssr" (Just "")
269 pure e
269 pure e
270− testWidget' checkSSRAttr (\e -> assertAttr e "ssr" Nothing) $ el "div" $ text "hello world"
270+ testWidget' checkSSRAttr (\e -> assertAttr e "data-ssr" Nothing) $ el "div" $ text "hello world"
271
271
272 describe "inputElement" $ do
272 describe "inputElement" $ do
273 describe "hydration" $ session' $ do
273 describe "hydration" $ session' $ do