on develop help sign in
Merge branch 'develop' into avoid-run-with-replace-when-hydrating
commit97dd3bca57ff8de29645d9eaffb9509c42869fcf authorElliot Cameron <3noch@users.noreply.github.com> dateThu 20 Feb 2020, 11:13 (7 years ago) parentf51f7736424eb9
7 files changed+40−18
cabal.project+1 dep/reflex-platform/github.json+3−3 reflex-dom-core/ChangeLog.md+15 reflex-dom-core/reflex-dom-core.cabal+5−5 reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs+5−10 reflex-dom-core/test/hydration.hs+10 reflex-dom/ChangeLog.md+1
cabal.projectnew file+1
@@ -0,0 +1 @@
1+packages: reflex-dom-core, reflex-dom
dep/reflex-platform/github.json+3−3
@@ -1,7 +1,7 @@
11{
22 "owner": "reflex-frp",
33 "repo": "reflex-platform",
4− "branch": "develop",
5− "rev": "e7b76dd552a10916c7d8702c11292dac4f4299ea",
6− "sha256": "0s1183arrwldcs50qhzgnv94v24n9bgq6dfq64wp0a3q2nzyvgwh"
4+ "branch": "master",
5+ "rev": "510b990d0b11f0626afbec5fe8575b5b2395391b",
6+ "sha256": "09cmahsbxr0963wq171c7j139iyzz49hramr4v9nsf684wcwkngv"
77}
reflex-dom-core/ChangeLog.md+15
@@ -1,5 +1,11 @@
11# Revision history for reflex-dom-core
22
3+## Unreleased
4+
5+* Support GHC 8.8.
6+
7+* Fix attribute support for explicitly namespaced elements
8+
39## 0.5.3
410
511* Deprecate a number of old inflexible widget helpers in `Reflex.Dom.Widget.Basic`:
@@ -24,21 +30,30 @@
2430## 0.5.2
2531
2632* Update to use new dependent-sum/map packages and drop dependency on `*Tag` classes (e.g., `ShowTag`).
33+
2734* Update version bounds of base, containers, and stm
35+
2836* Update to use the newly split `these`/`semialign` packages. To use the pre-split `these` package, set the `split-these` flag to false.
37+
2938* Reintroduce "data-ssr": elements without this attribute are skipped during
3039 hydration.
40+
3141* Fix an issue in the hydration tests that prevented the test from finding the chromium executable
42+
3243* Relax constraints on `dyn` and `widgetHold` to match the ones in `networkView` and `networkHold` respectively
44+
3345* Fix prerender for RequesterT so that it doesn't accidentally discard a request that is made at the same moment as getPostBuild's Event fires
3446
3547## 0.5.1
3648
3749* Added support for marking elements with a "data-skip-hydration" attribute, which will cause hydration to ignore and skip over them.
50+
3851* Removed "data-ssr" attributes from statically rendered output.
3952
4053## 0.5
4154
4255* Add HydrationDomBuilderT to support hydration of statically rendered DOM nodes. See the note at the top of Reflex.Dom.Builder.Immediate.
56+
4357* As a result of the hydration changes, the Prerender class has changed, the type of `prerender` has changed and it is now a class method.
58+
4459* Add the Reflex.Dom.Xhr.FormData module to make posting formdata over xhr more convenient.
reflex-dom-core/reflex-dom-core.cabal+5−5
@@ -48,7 +48,7 @@ library
4848 hs-source-dirs: src
4949 build-depends:
5050 aeson >= 0.8 && < 1.5,
51− base >= 4.7 && < 4.13,
51+ base >= 4.7 && < 4.14,
5252 bifunctors >= 4.2 && < 6,
5353 bimap >= 0.3 && < 0.4,
5454 blaze-builder,
@@ -69,11 +69,11 @@ library
6969 lens >= 4.7 && < 5,
7070 monad-control >= 1.0.1 && < 1.1,
7171 mtl >= 2.1 && < 2.3,
72− primitive >= 0.5 && < 0.7,
72+ primitive >= 0.5 && < 0.8,
7373 random,
7474 ref-tf == 0.4.*,
7575 reflex >= 0.6.2 && < 0.7,
76− semigroups >= 0.16 && < 0.19,
76+ semigroups >= 0.16 && < 0.20,
7777 stm >= 2.4 && < 2.6,
7878 text == 1.2.*,
7979 transformers >= 0.3 && < 0.6,
@@ -84,7 +84,7 @@ library
8484 hs-source-dirs: src-ghcjs
8585 build-depends:
8686 ghcjs-base,
87− hashable == 1.2.*
87+ hashable >= 1.2 && < 1.4
8888 else
8989 hs-source-dirs: src-ghc
9090 if !os(windows)
@@ -92,7 +92,7 @@ library
9292
9393 if flag(split-these)
9494 build-depends:
95− semialign >= 1 && < 1.1,
95+ semialign >= 1 && < 1.2,
9696 these >= 1 && < 1.1
9797 else
9898 build-depends:
reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs+5−10
@@ -141,7 +141,7 @@ import Data.Text (Text)
141141import Foreign.JavaScript.Internal.Utils
142142import Foreign.JavaScript.TH
143143import GHCJS.DOM.Document (Document, createDocumentFragment, createElement, createElementNS, createTextNode, createComment)
144−import GHCJS.DOM.Element (getScrollTop, removeAttribute, removeAttributeNS, setAttribute, setAttributeNS, hasAttribute, hasAttributeNS)
144+import GHCJS.DOM.Element (getScrollTop, removeAttribute, removeAttributeNS, setAttribute, setAttributeNS, hasAttribute)
145145import GHCJS.DOM.EventM (EventM, event, on)
146146import GHCJS.DOM.KeyboardEvent as KeyboardEvent
147147import GHCJS.DOM.MouseEvent
@@ -766,15 +766,10 @@ hydrateElement elementTag cfg child = do
766766 let skipAttr = "data-hydration-skip" :: DOM.JSString
767767 ssrAttr = "data-ssr" :: DOM.JSString
768768 shouldSkip :: DOM.Element -> HydrationRunnerT t m Bool
769− shouldSkip e = case cfg ^. namespace of
770− Nothing -> do
771− skip <- hasAttribute e skipAttr
772− ssr <- hasAttribute e ssrAttr
773− pure $ skip || not ssr
774− Just ns -> do
775− skip <- hasAttributeNS e (Just ns) skipAttr
776− ssr <- hasAttributeNS e (Just ns) ssrAttr
777− pure $ skip || not ssr
769+ shouldSkip e = do
770+ skip <- hasAttribute e skipAttr
771+ ssr <- hasAttribute e ssrAttr
772+ pure $ skip || not ssr
778773 childDom <- liftIO $ readIORef childDelayedRef
779774 let rawCfg = extractRawElementConfig cfg
780775 doc <- askDocument
reflex-dom-core/test/hydration.hs+10
@@ -22,6 +22,7 @@
2222
2323import Prelude hiding (fail)
2424import Control.Concurrent
25+import Control.Lens.Operators
2526import Control.Monad hiding (fail)
2627import Control.Monad.Catch
2728import Control.Monad.Fail
@@ -770,6 +771,15 @@ tests withDebugging wdConfig caps _selenium = do
770771 prerender_ (pure ()) (liftIO $ trigger "Client")
771772 textNode $ TextNodeConfig "Initial" $ Just e
772773
774+ describe "namespaces" $ session' $ do
775+ it "dyn can be nested in namespaced widget" $ runWD $ do
776+ testWidget (pure ()) (checkTextInTag "svg" "one") $ do
777+ let svgRootCfg = def
778+ & (elementConfig_namespace ?~ "http://www.w3.org/2000/svg")
779+ & (elementConfig_initialAttributes .~ ("width" =: "100%" <> "height" =: "100%" <> "viewBox" =: "0 0 1536 2048"))
780+ void $ element "svg" svgRootCfg $ do
781+ dyn_ $ text "one" <$ pure ()
782+
773783 describe "runWithReplace" $ session' $ do
774784 it "works" $ runWD $ do
775785 replaceChan :: Chan Text <- liftIO newChan
reflex-dom/ChangeLog.md+1
@@ -18,4 +18,5 @@
1818## 0.5
1919
2020* Re-export new hydration widget "mainWidget" functions.
21+
2122* The use-warp flag now properly takes precedence on macOS.