on develop help sign in
Change "ssr" attr to "data-ssr"

http://w3c.github.io/html/single-page.html#embedding-custom-non-visible-data-with-the-data-attributes

commit97432ad124cf2badad0d8f7f32f43cc92a5c32dc authorTom Smalley <tfsmalley@gmail.com> dateMon 31 Dec 2018, 15:09 (8 years ago) parent4ab344e
3 files changed+4−4
reflex-dom-core/src/Reflex/Dom/Builder/Hydration.hs+1−1 reflex-dom-core/src/Reflex/Dom/Builder/Static.hs+1−1 reflex-dom-core/test/hydration.hs+2−2
reflex-dom-core/src/Reflex/Dom/Builder/Hydration.hs+1−1
@@ -439,7 +439,7 @@ makeElement elementTag cfg child = do
439439 Nothing -> setAttribute e n v
440440 Just ans -> setAttributeNS e (Just ans) n v
441441 pure e
442− ssrAttr = "ssr" :: DOM.JSString
442+ ssrAttr = "data-ssr" :: DOM.JSString
443443 hasSSRAttribute :: DOM.Element -> HydrationRunnerT t m Bool
444444 hasSSRAttribute e = case cfg ^. namespace of
445445 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
287287 StaticDomBuilderT $ do
288288 let shouldEscape = elementTag `Set.notMember` noEscapeElements
289289 (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)
291291 selectValue <- asks _staticDomBuilderEnv_selectValue
292292 let addSelectedAttr attrs sel = case Map.lookup "value" attrs of
293293 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
265265 it "has ssr attribute, removes ssr attribute" $ runWD $ do
266266 let checkSSRAttr = do
267267 e <- WD.findElem $ WD.ByTag "div"
268− assertAttr e "ssr" (Just "")
268+ assertAttr e "data-ssr" (Just "")
269269 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"
271271
272272 describe "inputElement" $ do
273273 describe "hydration" $ session' $ do