From 21fb3cb82e43a8cb21e152c5a1b79204a9c1598e Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Fri, 17 May 2024 22:30:21 +0100 Subject: [PATCH] Squashed version of https://github.com/reflex-frp/reflex-dom/pull/470 --- cabal.project | 5 -- cabal.project-nogtk | 5 -- cabal.project.local | 1 + reflex-dom-core/reflex-dom-core.cabal | 22 ++++----- .../src/Reflex/Dom/Builder/Class.hs | 21 ++++---- .../src/Reflex/Dom/Builder/Immediate.hs | 2 + .../src/Reflex/Dom/Builder/Static.hs | 2 + reflex-dom-core/src/Reflex/Dom/Main.hs | 6 +-- reflex-dom-core/src/Reflex/Dom/Prerender.hs | 2 + reflex-dom-core/src/Reflex/Dom/WebSocket.hs | 4 +- .../src/Reflex/Dom/Widget/Basic.hs | 1 + .../src/Reflex/Dom/Widget/Input.hs | 1 + reflex-dom-core/src/Reflex/Dom/Xhr/Foreign.hs | 1 - reflex-dom-core/test/hlint.hs | 1 + reflex-dom-core/test/hydration.hs | 48 ++++++++++--------- .../reflex-dom-test-selenium.cabal | 9 ++-- .../src/Reflex/Dom/Test/Selenium.hs | 13 +++-- reflex-dom/reflex-dom.cabal | 6 +-- zcabal.project | 10 ++++ 19 files changed, 86 insertions(+), 74 deletions(-) create mode 100644 cabal.project.local create mode 100644 zcabal.project diff --git a/cabal.project b/cabal.project index 66bf72d3..4768e2ff 100644 --- a/cabal.project +++ b/cabal.project @@ -3,8 +3,3 @@ packages: reflex-dom/ chrome-test-utils/ reflex-dom-test-selenium/ - -source-repository-package - type: git - location: https://github.com/dfordivam/hspec-webdriver-clone - tag: 0d748b7bb7cd74dce0a55a1ec86b01dbb8a71cd8 diff --git a/cabal.project-nogtk b/cabal.project-nogtk index 6694c040..a3fb1107 100644 --- a/cabal.project-nogtk +++ b/cabal.project-nogtk @@ -7,8 +7,3 @@ package reflex-dom-core package reflex-dom flags: +use-warp -webkit2gtk - -source-repository-package - type: git - location: https://github.com/dfordivam/hspec-webdriver-clone - tag: 0d748b7bb7cd74dce0a55a1ec86b01dbb8a71cd8 diff --git a/cabal.project.local b/cabal.project.local new file mode 100644 index 00000000..a558e04b --- /dev/null +++ b/cabal.project.local @@ -0,0 +1 @@ +ignore-project: False diff --git a/reflex-dom-core/reflex-dom-core.cabal b/reflex-dom-core/reflex-dom-core.cabal index 84b0aecc..bce60953 100644 --- a/reflex-dom-core/reflex-dom-core.cabal +++ b/reflex-dom-core/reflex-dom-core.cabal @@ -67,12 +67,12 @@ flag gc-tests library hs-source-dirs: src build-depends: - aeson >= 0.8 && < 2.2, - base >= 4.7 && < 4.15, + aeson >= 0.8 && < 2.3, + base >= 4.7 && < 4.20, bifunctors >= 4.2 && < 6, bimap >= 0.3 && < 0.5, blaze-builder >= 0.4.1 && < 0.5, - bytestring == 0.10.*, + bytestring >= 0.10 && < 0.13, case-insensitive < 1.3, commutative-semigroups >=0.1 && <0.2, containers >= 0.6 && < 0.7, @@ -81,7 +81,7 @@ library data-default >= 0.5 && < 0.8, dependent-map >= 0.3 && < 0.5, dependent-sum >= 0.6 && < 0.8, - dependent-sum-template >= 0.1 && < 0.2, + dependent-sum-template >= 0.2 && < 0.3, directory >= 1.2 && < 1.4, exception-transformers == 0.4.*, ghcjs-dom >= 0.9.1.0 && < 0.10, @@ -90,15 +90,15 @@ library keycode >= 0.2.1 && < 0.3, lens >= 4.7 && < 5.3, monad-control >= 1.0.1 && < 1.1, - mtl >= 2.1 && < 2.3, - primitive >= 0.5 && < 0.8, + mtl >= 2.1 && < 2.4, + primitive >= 0.5 && < 0.9, random >= 1.1 && < 1.3, ref-tf >= 0.4 && < 0.6, reflex >= 0.8.2.1 && < 1, semigroups >= 0.16 && < 0.20, stm >= 2.4 && < 2.6, text == 1.2.*, - transformers >= 0.3 && < 0.6, + transformers >= 0.3 && < 0.7, network-uri >= 2.6.1 && < 2.7, zenc == 0.1.* @@ -114,7 +114,7 @@ library if flag(split-these) build-depends: - semialign >= 1 && < 1.3, + semialign >= 1 && < 1.4, these >= 1 && < 1.3 else build-depends: @@ -169,8 +169,8 @@ library if flag(use-template-haskell) build-depends: - dependent-sum-template >= 0.1 && < 0.2, - template-haskell >= 2.12.0 && < 2.17 + dependent-sum-template >= 0.2 && < 0.3, + template-haskell >= 2.12.0 && < 2.22 other-extensions: TemplateHaskell cpp-options: -DUSE_TEMPLATE_HASKELL other-modules: @@ -226,7 +226,7 @@ test-suite hydration , websockets , which hs-source-dirs: test - ghc-options: -rtsopts -with-rtsopts=-T -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans + ghc-options: -rtsopts "-with-rtsopts=-T -V0" -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans ghc-prof-options: -fprof-auto -optP-DPROFILING main-is: hydration.hs type: exitcode-stdio-1.0 diff --git a/reflex-dom-core/src/Reflex/Dom/Builder/Class.hs b/reflex-dom-core/src/Reflex/Dom/Builder/Class.hs index c75eb501..dedf268a 100644 --- a/reflex-dom-core/src/Reflex/Dom/Builder/Class.hs +++ b/reflex-dom-core/src/Reflex/Dom/Builder/Class.hs @@ -47,6 +47,7 @@ import Reflex.Requester.Base import qualified Control.Category import Control.Lens hiding (element) +import Control.Monad.Fix import Control.Monad.Reader import qualified Control.Monad.State as Lazy import Control.Monad.State.Strict @@ -278,6 +279,15 @@ elementConfig_eventSpec f (ElementConfig a b c d) = (\d' -> ElementConfig a b c {-# INLINE elementConfig_eventSpec #-} #endif +instance (Reflex t, er ~ EventResult, DomSpace s) => Default (ElementConfig er t s) where + {-# INLINABLE def #-} + def = ElementConfig + { _elementConfig_namespace = Nothing + , _elementConfig_initialAttributes = mempty + , _elementConfig_modifyAttributes = Nothing + , _elementConfig_eventSpec = def + } + data Element er d t = Element { _element_events :: EventSelector t (WrapArg er EventName) --TODO: EventSelector should have two arguments , _element_raw :: RawElement d @@ -542,15 +552,6 @@ instance HasNamespace (ElementConfig er t m) where {-# INLINABLE namespace #-} namespace = elementConfig_namespace -instance (Reflex t, er ~ EventResult, DomSpace s) => Default (ElementConfig er t s) where - {-# INLINABLE def #-} - def = ElementConfig - { _elementConfig_namespace = Nothing - , _elementConfig_initialAttributes = mempty - , _elementConfig_modifyAttributes = Nothing - , _elementConfig_eventSpec = def - } - instance (DomBuilder t m, PerformEvent t m, MonadFix m, MonadHold t m) => DomBuilder t (PostBuildT t m) where type DomBuilderSpace (PostBuildT t m) = DomBuilderSpace m wrapRawElement e = lift . wrapRawElement e @@ -750,7 +751,7 @@ instance HasDocument m => HasDocument (QueryT t q m) class HasSetValue a where type SetValue a :: * setValue :: Lens' a (SetValue a) - + instance Reflex t => HasSetValue (TextAreaElementConfig er t m) where type SetValue (TextAreaElementConfig er t m) = Event t Text setValue = textAreaElementConfig_setValue diff --git a/reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs b/reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs index fce08d03..031997ba 100644 --- a/reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs +++ b/reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs @@ -120,7 +120,9 @@ module Reflex.Dom.Builder.Immediate import Control.Concurrent import Control.Exception (bracketOnError) import Control.Lens (Identity(..), imapM_, iforM_, (^.), makeLenses) +import Control.Monad import Control.Monad.Exception +import Control.Monad.Fix import Control.Monad.Primitive import Control.Monad.Reader import Control.Monad.Ref diff --git a/reflex-dom-core/src/Reflex/Dom/Builder/Static.hs b/reflex-dom-core/src/Reflex/Dom/Builder/Static.hs index 140c25ae..4463ee38 100644 --- a/reflex-dom-core/src/Reflex/Dom/Builder/Static.hs +++ b/reflex-dom-core/src/Reflex/Dom/Builder/Static.hs @@ -19,6 +19,8 @@ import Data.IORef (IORef) import Blaze.ByteString.Builder.Html.Utf8 import Control.Lens hiding (element) import Control.Monad.Exception +import Control.Monad +import Control.Monad.Fix import Control.Monad.Identity import Control.Monad.Primitive import Control.Monad.Ref diff --git a/reflex-dom-core/src/Reflex/Dom/Main.hs b/reflex-dom-core/src/Reflex/Dom/Main.hs index 24219c77..ba6d47ba 100644 --- a/reflex-dom-core/src/Reflex/Dom/Main.hs +++ b/reflex-dom-core/src/Reflex/Dom/Main.hs @@ -58,7 +58,7 @@ import Reflex.Profiled {-# INLINE mainHydrationWidgetWithHead #-} mainHydrationWidgetWithHead :: (forall x. HydrationWidget x ()) -> (forall x. HydrationWidget x ()) -> JSM () -mainHydrationWidgetWithHead = mainHydrationWidgetWithHead' +mainHydrationWidgetWithHead head' body = mainHydrationWidgetWithHead' head' body {-# INLINABLE mainHydrationWidgetWithHead' #-} -- | Warning: `mainHydrationWidgetWithHead'` is provided only as performance tweak. It is expected to disappear in future releases. @@ -67,7 +67,7 @@ mainHydrationWidgetWithHead' = mainHydrationWidgetWithSwitchoverAction' (pure () {-# INLINE mainHydrationWidgetWithSwitchoverAction #-} mainHydrationWidgetWithSwitchoverAction :: JSM () -> (forall x. HydrationWidget x ()) -> (forall x. HydrationWidget x ()) -> JSM () -mainHydrationWidgetWithSwitchoverAction = mainHydrationWidgetWithSwitchoverAction' +mainHydrationWidgetWithSwitchoverAction switchoverAction head' body = mainHydrationWidgetWithSwitchoverAction' switchoverAction head' body {-# INLINABLE mainHydrationWidgetWithSwitchoverAction' #-} -- | Warning: `mainHydrationWidgetWithSwitchoverAction'` is provided only as performance tweak. It is expected to disappear in future releases. @@ -187,7 +187,7 @@ runHydrationWidgetWithHeadAndBodyWithFailure onFailure switchoverAction app = wi {-# INLINE mainWidget #-} mainWidget :: (forall x. Widget x ()) -> JSM () -mainWidget = mainWidget' +mainWidget w = mainWidget' w {-# INLINABLE mainWidget' #-} -- | Warning: `mainWidget'` is provided only as performance tweak. It is expected to disappear in future releases. diff --git a/reflex-dom-core/src/Reflex/Dom/Prerender.hs b/reflex-dom-core/src/Reflex/Dom/Prerender.hs index b7e9cbda..3fbf0cb9 100644 --- a/reflex-dom-core/src/Reflex/Dom/Prerender.hs +++ b/reflex-dom-core/src/Reflex/Dom/Prerender.hs @@ -22,6 +22,8 @@ module Reflex.Dom.Prerender , PrerenderBaseConstraints ) where +import Control.Monad +import Control.Monad.Fix import Control.Monad.Primitive (PrimMonad(..)) import Control.Monad.Reader import Control.Monad.Ref (MonadRef(..), MonadAtomicRef(..)) diff --git a/reflex-dom-core/src/Reflex/Dom/WebSocket.hs b/reflex-dom-core/src/Reflex/Dom/WebSocket.hs index 13e6fedc..b85faacf 100644 --- a/reflex-dom-core/src/Reflex/Dom/WebSocket.hs +++ b/reflex-dom-core/src/Reflex/Dom/WebSocket.hs @@ -8,7 +8,6 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE JavaScriptFFI #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoMonomorphismRestriction #-} @@ -40,9 +39,8 @@ import Control.Concurrent import Control.Concurrent.STM import Control.Exception import Control.Lens -import Control.Monad hiding (forM, forM_, mapM, mapM_, sequence) +import Control.Monad hiding (forM, mapM, mapM_, sequence) import Control.Monad.IO.Class -import Control.Monad.State import Data.Aeson import Data.ByteString (ByteString) import Data.ByteString.Lazy (toStrict) diff --git a/reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs b/reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs index 66e6d5ab..c6dffa40 100644 --- a/reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs +++ b/reflex-dom-core/src/Reflex/Dom/Widget/Basic.hs @@ -72,6 +72,7 @@ import Reflex.Workflow import Control.Arrow import Control.Lens hiding (children, element) +import Control.Monad.Fix import Control.Monad.Reader hiding (forM, forM_, mapM, mapM_, sequence, sequence_) import Data.Align import Data.Default diff --git a/reflex-dom-core/src/Reflex/Dom/Widget/Input.hs b/reflex-dom-core/src/Reflex/Dom/Widget/Input.hs index 2c67fcd3..086a8ed1 100644 --- a/reflex-dom-core/src/Reflex/Dom/Widget/Input.hs +++ b/reflex-dom-core/src/Reflex/Dom/Widget/Input.hs @@ -19,6 +19,7 @@ module Reflex.Dom.Widget.Input (module Reflex.Dom.Widget.Input, def, (&), (.~)) import Prelude import Control.Lens hiding (element, ix) +import Control.Monad import Control.Monad.Fix import Control.Monad.IO.Class import Control.Monad.Reader diff --git a/reflex-dom-core/src/Reflex/Dom/Xhr/Foreign.hs b/reflex-dom-core/src/Reflex/Dom/Xhr/Foreign.hs index 210ac82e..2528f99d 100644 --- a/reflex-dom-core/src/Reflex/Dom/Xhr/Foreign.hs +++ b/reflex-dom-core/src/Reflex/Dom/Xhr/Foreign.hs @@ -1,5 +1,4 @@ {-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE JavaScriptFFI #-} {-# LANGUAGE OverloadedStrings #-} module Reflex.Dom.Xhr.Foreign ( diff --git a/reflex-dom-core/test/hlint.hs b/reflex-dom-core/test/hlint.hs index f4137f2c..a2b4d361 100644 --- a/reflex-dom-core/test/hlint.hs +++ b/reflex-dom-core/test/hlint.hs @@ -20,6 +20,7 @@ main = do , "--ignore=Unnecessary hiding" -- Interferes with cross-version compatibility , "--ignore=Use <$>" , "--ignore=Reduce duplication" --TODO: Re-enable this test + , "--ignore=Eta reduce" -- simplified subsumption , "--ignore=Use list comprehension" , "--ignore=Evaluate" , "--cpp-define=USE_TEMPLATE_HASKELL" diff --git a/reflex-dom-core/test/hydration.hs b/reflex-dom-core/test/hydration.hs index 16269a73..564a6e8c 100644 --- a/reflex-dom-core/test/hydration.hs +++ b/reflex-dom-core/test/hydration.hs @@ -1,4 +1,5 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} @@ -89,8 +90,10 @@ import qualified Test.WebDriver.Capabilities as WD import Test.Util.ChromeFlags import Test.Util.UnshareNetwork --- ORPHAN: https://github.com/kallisti-dev/hs-webdriver/pull/167 + +#if !MIN_VERSION_webdriver(0,10,0) deriving instance MonadMask WD +#endif chromium :: FilePath chromium = $(staticWhich "chromium") @@ -118,18 +121,11 @@ assertBool msg bool = liftIO $ HUnit.assertBool msg bool chromeConfig :: Text -> [Text] -> WD.WDConfig chromeConfig fp flags = WD.useBrowser (WD.chrome { WD.chromeBinary = Just $ T.unpack fp, WD.chromeOptions = T.unpack <$> flags }) WD.defaultConfig -keyMap :: DMap DKey Identity -keyMap = DMap.fromList - [ Key_Int ==> 0 - , Key_Char ==> 'A' - ] - data DKey a where Key_Int :: DKey Int Key_Char :: DKey Char Key_Bool :: DKey Bool - textKey :: DKey a -> Text textKey = \case Key_Int -> "Key_Int" @@ -141,6 +137,21 @@ deriveGEq ''DKey deriveGCompare ''DKey deriveGShow ''DKey +keyMap :: DMap DKey Identity +keyMap = DMap.fromList + [ Key_Int ==> 0 + , Key_Char ==> 'A' + ] + +data Key2 a where + Key2_Int :: Int -> Key2 Int + Key2_Char :: Char -> Key2 Char + +deriveGEq ''Key2 +deriveGCompare ''Key2 +deriveGShow ''Key2 +deriveArgDict ''Key2 + deriving instance MonadFail WD main :: IO () @@ -166,11 +177,11 @@ tests withDebugging wdConfig caps _selenium = do r <- m putStrLnDebug "after" return r - testWidgetStatic :: WD b -> (forall m js. TestWidget (SpiderTimeline Global) m => m ()) -> WD b + testWidgetStatic :: WD b -> (forall m. TestWidget (SpiderTimeline Global) m => m ()) -> WD b testWidgetStatic = testWidgetStaticDebug withDebugging - testWidget :: WD () -> WD b -> (forall m js. TestWidget (SpiderTimeline Global) m => m ()) -> WD b + testWidget :: WD () -> WD b -> (forall m. TestWidget (SpiderTimeline Global) m => m ()) -> WD b testWidget = testWidgetDebug True withDebugging - testWidget' :: WD a -> (a -> WD b) -> (forall m js. TestWidget (SpiderTimeline Global) m => m ()) -> WD b + testWidget' :: WD a -> (a -> WD b) -> (forall m. TestWidget (SpiderTimeline Global) m => m ()) -> WD b testWidget' = testWidgetDebug' True withDebugging session' "text" $ do it "works" $ runWD $ do @@ -1722,7 +1733,7 @@ testWidgetStaticDebug :: Bool -> WD b -- ^ Webdriver commands to run before JS runs and after hydration switchover - -> (forall m js. TestWidget (SpiderTimeline Global) m => m ()) + -> (forall m. TestWidget (SpiderTimeline Global) m => m ()) -- ^ Widget we are testing -> WD b testWidgetStaticDebug withDebugging w = testWidgetDebug True withDebugging (void w) w @@ -1735,7 +1746,7 @@ testWidgetDebug -- ^ Webdriver commands to run before the JS runs (i.e. on the statically rendered page) -> WD b -- ^ Webdriver commands to run after hydration switchover - -> (forall m js. TestWidget (SpiderTimeline Global) m => m ()) + -> (forall m. TestWidget (SpiderTimeline Global) m => m ()) -- ^ Widget we are testing -> WD b testWidgetDebug hardFailure withDebugging beforeJS afterSwitchover = @@ -1752,7 +1763,7 @@ testWidgetDebug' -- ^ Webdriver commands to run before the JS runs (i.e. on the statically rendered page) -> (a -> WD b) -- ^ Webdriver commands to run after hydration switchover - -> (forall m js. TestWidget (SpiderTimeline Global) m => m ()) + -> (forall m. TestWidget (SpiderTimeline Global) m => m ()) -- ^ Widget we are testing (contents of body) -> WD b testWidgetDebug' hardFailure withDebugging beforeJS afterSwitchover bodyWidget = do @@ -1817,12 +1828,3 @@ withAsync' f g = bracket (liftIO $ Async.async f) (liftIO . Async.uninterruptibleCancel) (const g) - -data Key2 a where - Key2_Int :: Int -> Key2 Int - Key2_Char :: Char -> Key2 Char - -deriveGEq ''Key2 -deriveGCompare ''Key2 -deriveGShow ''Key2 -deriveArgDict ''Key2 diff --git a/reflex-dom-test-selenium/reflex-dom-test-selenium.cabal b/reflex-dom-test-selenium/reflex-dom-test-selenium.cabal index df4106fc..a828230a 100644 --- a/reflex-dom-test-selenium/reflex-dom-test-selenium.cabal +++ b/reflex-dom-test-selenium/reflex-dom-test-selenium.cabal @@ -15,13 +15,12 @@ library hs-source-dirs: src build-depends: async, - base >= 4.7 && < 4.15, - bytestring == 0.10.*, + base >= 4.7 && < 4.20, + bytestring >= 0.10 && < 0.13, chrome-test-utils, exceptions, - -- Until hspec-webdriver supports newer hspec-core versions - hspec-core < 2.8, - hspec-webdriver >= 1.2.1, + hspec-core < 2.12, + hspec-webdriver >= 1.2.2, http-types, jsaddle >= 0.9.0.0 && < 0.10, jsaddle-warp, diff --git a/reflex-dom-test-selenium/src/Reflex/Dom/Test/Selenium.hs b/reflex-dom-test-selenium/src/Reflex/Dom/Test/Selenium.hs index b0c14cf2..be7ead10 100644 --- a/reflex-dom-test-selenium/src/Reflex/Dom/Test/Selenium.hs +++ b/reflex-dom-test-selenium/src/Reflex/Dom/Test/Selenium.hs @@ -1,4 +1,5 @@ {-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} @@ -54,7 +55,9 @@ import qualified Test.Hspec.Core.Spec as Hspec import qualified Test.WebDriver as WD import qualified Test.WebDriver.Capabilities as WD +#if !MIN_VERSION_webdriver(0,10,0) deriving instance MonadMask WD +#endif data SeleniumSetupConfig = SeleniumSetupConfig { _seleniumSetupConfig_chromiumPath :: FilePath @@ -116,7 +119,7 @@ type TestWidget t m = data TestWidgetConfig = TestWidgetConfig { _testWidgetConfig_debug :: Bool -- ^ If this flag is set to True, during the test we will emit debug messages - , _testWidgetConfig_headWidget :: (forall m js. TestWidget js (SpiderTimeline Global) m => m ()) + , _testWidgetConfig_headWidget :: (forall m. TestWidget (SpiderTimeline Global) m => m ()) -- ^ We can add widgets here that will be included in the head of the page -- (useful for example to include external js libraries in the tests) , _testWidgetConfig_jsaddlePort :: PortNumber @@ -131,7 +134,7 @@ testWidget -- ^ Webdriver commands to run before the JS runs (i.e. on the statically rendered page) -> WD b -- ^ Webdriver commands to run after hydration switchover - -> (forall m js. TestWidget js (SpiderTimeline Global) m => m ()) + -> (forall m. TestWidget (SpiderTimeline Global) m => m ()) -- ^ Widget we are testing (contents of body) -> WD b testWidget cfg before after widget = testWidget' cfg before (const after) widget @@ -142,7 +145,7 @@ testWidgetStatic :: TestWidgetConfig -> WD a -- ^ Webdriver commands to run before the JS runs (i.e. on the statically rendered page) - -> (forall m js. TestWidget js (SpiderTimeline Global) m => m ()) + -> (forall m. TestWidget (SpiderTimeline Global) m => m ()) -- ^ Widget we are testing (contents of body) -> WD a testWidgetStatic cfg before widget = testWidget' cfg before pure widget @@ -152,7 +155,7 @@ testWidgetHydrated :: TestWidgetConfig -> WD b -- ^ Webdriver commands to run after hydration switchover - -> (forall m js. TestWidget js (SpiderTimeline Global) m => m ()) + -> (forall m . TestWidget (SpiderTimeline Global) m => m ()) -- ^ Widget we are testing (contents of body) -> WD b testWidgetHydrated cfg after widget = testWidget' cfg (pure ()) (const after) widget @@ -166,7 +169,7 @@ testWidget' -- ^ Webdriver commands to run before the JS runs (i.e. on the statically rendered page) -> (a -> WD b) -- ^ Webdriver commands to run after hydration switchover - -> (forall m js. TestWidget js (SpiderTimeline Global) m => m ()) + -> (forall m. TestWidget (SpiderTimeline Global) m => m ()) -- ^ Widget we are testing (contents of body) -> WD b testWidget' (TestWidgetConfig withDebugging headWidget jsaddlePort) beforeJS afterSwitchover bodyWidget = do diff --git a/reflex-dom/reflex-dom.cabal b/reflex-dom/reflex-dom.cabal index 55caaca3..635af032 100644 --- a/reflex-dom/reflex-dom.cabal +++ b/reflex-dom/reflex-dom.cabal @@ -61,7 +61,7 @@ library hs-source-dirs: src-android other-modules: Reflex.Dom.Android.MainWidget build-depends: - aeson >= 1.4 && < 2.2, + aeson >= 1.4 && < 2.3, android-activity == 0.2.*, data-default == 0.7.*, jsaddle >= 0.9.6 && < 0.10 @@ -71,8 +71,8 @@ library cpp-options: -DANDROID build-tools: hsc2hs build-depends: - base >= 4.7 && < 4.15, - bytestring == 0.10.*, + base >= 4.7 && < 4.20, + bytestring >= 0.10 && < 0.13, reflex >= 0.8 && < 1, reflex-dom-core >= 0.6.1.0 && <0.9, text == 1.2.* diff --git a/zcabal.project b/zcabal.project new file mode 100644 index 00000000..66bf72d3 --- /dev/null +++ b/zcabal.project @@ -0,0 +1,10 @@ +packages: + reflex-dom-core/ + reflex-dom/ + chrome-test-utils/ + reflex-dom-test-selenium/ + +source-repository-package + type: git + location: https://github.com/dfordivam/hspec-webdriver-clone + tag: 0d748b7bb7cd74dce0a55a1ec86b01dbb8a71cd8