on develop help sign in
Merge remote-tracking branch 'meditans/develop' into cn-return-correct-result-for-wheel
commit42b703ec1f03d241481086cf4c71bda881915cf4 authorCarlo Nucera <carlo.nucera@protonmail.com> dateFri 28 Feb 2020, 15:07 (7 years ago) parent1b87f3c7439e26
8 files changed+51−25
cabal.project+1 dep/reflex-platform/github.json+3−3 reflex-dom-core/ChangeLog.md+26 reflex-dom-core/reflex-dom-core.cabal+5−5 reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs+5−10 reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs−7 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+26
@@ -1,5 +1,22 @@
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+
9+* Remove deprecation warnings for the following widgets in
10+ `Reflex.Dom.Widget.Basic`:
11+
12+ * `Link`
13+ * `button`
14+ * `dtdd`
15+ * `linkClass`
16+ * `link`
17+ * `tabDisplay`
18+ * `tableDynAttr`
19+
320## 0.5.3
421
522* Deprecate a number of old inflexible widget helpers in `Reflex.Dom.Widget.Basic`:
@@ -27,21 +44,30 @@
2744## 0.5.2
2845
2946* Update to use new dependent-sum/map packages and drop dependency on `*Tag` classes (e.g., `ShowTag`).
47+
3048* Update version bounds of base, containers, and stm
49+
3150* Update to use the newly split `these`/`semialign` packages. To use the pre-split `these` package, set the `split-these` flag to false.
51+
3252* Reintroduce "data-ssr": elements without this attribute are skipped during
3353 hydration.
54+
3455* Fix an issue in the hydration tests that prevented the test from finding the chromium executable
56+
3557* Relax constraints on `dyn` and `widgetHold` to match the ones in `networkView` and `networkHold` respectively
58+
3659* 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
3760
3861## 0.5.1
3962
4063* Added support for marking elements with a "data-skip-hydration" attribute, which will cause hydration to ignore and skip over them.
64+
4165* Removed "data-ssr" attributes from statically rendered output.
4266
4367## 0.5
4468
4569* Add HydrationDomBuilderT to support hydration of statically rendered DOM nodes. See the note at the top of Reflex.Dom.Builder.Immediate.
70+
4671* 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.
72+
4773* 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
@@ -768,15 +768,10 @@ hydrateElement elementTag cfg child = do
768768 let skipAttr = "data-hydration-skip" :: DOM.JSString
769769 ssrAttr = "data-ssr" :: DOM.JSString
770770 shouldSkip :: DOM.Element -> HydrationRunnerT t m Bool
771− shouldSkip e = case cfg ^. namespace of
772− Nothing -> do
773− skip <- hasAttribute e skipAttr
774− ssr <- hasAttribute e ssrAttr
775− pure $ skip || not ssr
776− Just ns -> do
777− skip <- hasAttributeNS e (Just ns) skipAttr
778− ssr <- hasAttributeNS e (Just ns) ssrAttr
779− pure $ skip || not ssr
771+ shouldSkip e = do
772+ skip <- hasAttribute e skipAttr
773+ ssr <- hasAttribute e ssrAttr
774+ pure $ skip || not ssr
780775 childDom <- liftIO $ readIORef childDelayedRef
781776 let rawCfg = extractRawElementConfig cfg
782777 doc <- askDocument
reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs−7
@@ -138,7 +138,6 @@ dynComment t = do
138138display :: (PostBuild t m, DomBuilder t m, Show a) => Dynamic t a -> m ()
139139display = dynText . fmap (T.pack . show)
140140
141−{-# DEPRECATED button "Use 'elAttr'' in combination with 'domEvent' instead" #-}
142141button :: DomBuilder t m => Text -> m (Event t ())
143142button t = do
144143 (e, _) <- element "button" def $ text t
@@ -272,25 +271,21 @@ dynamicAttributesToModifyAttributesWithInitial attrs0 d = do
272271 return $ if Map.null p then Nothing else Just p
273272 return modificationsNeeded
274273
275−{-# DEPRECATED Link "Will be removed when 'linkClass' and 'link' are removed. Follow those functions' deprecation instructions." #-}
276274newtype Link t
277275 = Link { _link_clicked :: Event t ()
278276 }
279277
280−{-# DEPRECATED linkClass "Use 'elAttr'' in combination with 'domEvent' for just clicks. Use 'routeLink' for Obelisk navigation" #-}
281278linkClass :: DomBuilder t m => Text -> Text -> m (Link t)
282279linkClass s c = do
283280 (l,_) <- elAttr' "a" ("class" =: c) $ text s
284281 return $ Link $ domEvent Click l
285282
286−{-# DEPRECATED link "Use 'elAttr'' in combination with 'domEvent' for just clicks. Use 'routeLink' for Obelisk navigation" #-}
287283link :: DomBuilder t m => Text -> m (Link t)
288284link s = linkClass s ""
289285
290286divClass :: forall t m a. DomBuilder t m => Text -> m a -> m a
291287divClass = elClass "div"
292288
293−{-# DEPRECATED dtdd "Use an application specific widget generating function" #-}
294289dtdd :: forall t m a. DomBuilder t m => Text -> m a -> m a
295290dtdd h w = do
296291 el "dt" $ text h
@@ -301,7 +296,6 @@ blank = return ()
301296
302297-- TODO: Move to an example project.
303298-- | A widget to display a table with static columns and dynamic rows.
304−{-# DEPRECATED tableDynAttr "Use an application specific widget generating function" #-}
305299tableDynAttr :: forall t m r k v. (Ord k, DomBuilder t m, MonadHold t m, PostBuild t m, MonadFix m)
306300 => Text -- ^ Class applied to <table> element
307301 -> [(Text, k -> Dynamic t r -> m v)] -- ^ Columns of (header, row key -> row value -> child widget)
@@ -321,7 +315,6 @@ tableDynAttr klass cols dRows rowAttrs = elAttr "div" (Map.singleton "style" "zo
321315-- | A widget to construct a tabbed view that shows only one of its child widgets at a time.
322316-- Creates a header bar containing a <ul> with one <li> per child; clicking a <li> displays
323317-- the corresponding child and hides all others.
324−{-# DEPRECATED tabDisplay "Use an application specific widget generating function" #-}
325318tabDisplay :: forall t m k. (MonadFix m, DomBuilder t m, MonadHold t m, PostBuild t m, Ord k)
326319 => Text -- ^ Class applied to <ul> element
327320 -> Text -- ^ Class applied to currently active <li> element
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.