git.iko.soy/typeable/servant-reflex
on master help sign in
Merge pull request #81 from benkolera/reflex-dom-0.5

Bumping to latest reflex platform (reflex-dom 0.5 and reflex 0.6) @benkolera I set up cachix for my github account and pushed `servant-reflex` build artifacts up there. Testing with a branch similar to your PR, it all works great on Travis! Wondering if I should have Travis push, too.

commit44595630e2d1597911ecb204e792d17db7e4a4ee authorGreg Hale <ImAlsoGreg@gmail.com> dateSun 14 Apr 2019, 16:43 (8 years ago) parentd022114491dd80
6 files changed+19−55
exec/Example.hs+1−1 nix/hspec-webdriver.patch−36 nix/reflex-platform.nix+2−2 nix/servant-snap.nix+9 servant-reflex.cabal+3−3 travis.nix+4−13
exec/Example.hs+1−1
@@ -21,7 +21,7 @@ import Servant.API
2121import API
2222import Data.Proxy
2323import Text.Read (readMaybe)
24−import Reflex.Dom hiding (run)
24+import Reflex.Dom.Core hiding (run)
2525------------------------------------------------------------------------------
2626import Servant.Reflex
2727import Servant.Reflex.Multi
nix/hspec-webdriver.patchdeleted−36
@@ -1,36 +0,0 @@
1−diff --git a/Test/Hspec/WebDriver.hs b/Test/Hspec/WebDriver.hs
2−index 3162656..313360c 100644
3−--- a/Test/Hspec/WebDriver.hs
4−+++ b/Test/Hspec/WebDriver.hs
5−@@ -111,7 +111,8 @@ import Data.Traversable (traverse)
6−
7− import qualified Test.Hspec as H
8− import Test.Hspec hiding (shouldReturn, shouldBe, shouldSatisfy, shouldThrow, pending, pendingWith, example)
9−-import Test.Hspec.Core.Spec (Result(..), Item(..), Example(..), SpecTree, Tree(..), fromSpecList, runSpecM)
10−+import qualified Test.Hspec.Core as H
11−+import Test.Hspec.Core.Spec (Result(..), ResultStatus(..), Item(..), Example(..), SpecTree, Tree(..), fromSpecList, runSpecM)
12−
13− import Test.WebDriver (WD, Capabilities)
14− import qualified Test.WebDriver as W
15−@@ -398,7 +399,7 @@ procTestSession cfg cap s = do
16−
17− instance Eq multi => Example (WdExample multi) where
18− type Arg (WdExample multi) = WdTestSession multi
19−- evaluateExample (WdPending msg) _ _ _ = return $ Pending msg
20−+ evaluateExample (WdPending msg) _ _ _ = return $ Result "" $ Pending Nothing msg
21− evaluateExample (WdExample multi (WdOptions {skipRemainingTestsAfterFailure}) wd) _ act _ = do
22− prevHadError <- newIORef False
23− aborted <- newIORef False
24−@@ -445,9 +446,9 @@ instance Eq multi => Example (WdExample multi) where
25− merr <- readIORef prevHadError
26− mabort <- readIORef aborted
27− return $ case (merr, mabort) of
28−- (True, _) -> Pending (Just "Previous example had an error")
29−- (_, True) -> Pending (Just "Session has been aborted")
30−- _ -> Success
31−+ (True, _) -> Result "" $ Pending Nothing (Just "Previous example had an error")
32−+ (_, True) -> Result "" $ Pending Nothing (Just "Session has been aborted")
33−+ _ -> Result "" $ Success
34−
35− --------------------------------------------------------------------------------
36− --- Utils
nix/reflex-platform.nix+2−2
@@ -1,7 +1,7 @@
11let
2− rev = "3d232e2d1d8e8d10fbafc928972c901c764ae324";
2+ rev = "a15d3a2411e7ca7d4ee4853b57c72fe83faee272";
33in import (builtins.fetchTarball
44 {
55 url = "https://github.com/reflex-frp/reflex-platform/archive/${rev}.tar.gz";
6− sha256 = "15ysjn0aknbl06spn4qls7xapm0d3qw2awx6k8jl28zwkaid45yg";
6+ sha256 = "1dsvw0lah7761vndip1hqal4fjpjv84ravinnfhy83jgfav5ivna";
77 }) {}
nix/servant-snap.nixnew file+9
@@ -0,0 +1,9 @@
1+# Servant-snap is stuck a bit behind atm. But we have a fork that mostly works
2+# except for streaming, which is good enough for this test server. See:
3+# https://github.com/haskell-servant/servant-snap/issues/20
4+{ nixpkgs ? import <nixpkgs> {}}: self: super:
5+self.callCabal2nix "servant-snap" (nixpkgs.fetchgit {
6+ url = "https://github.com/antislava/servant-snap.git";
7+ rev = "fc9658e8f52ebce9e4f304ea0c6705d697d4fa84";
8+ sha256 = "0zlipmx1fb73mhpnndwmdmigxxrsdnsnb1157pgsrxpx89l9pjig";
9+}) {}
servant-reflex.cabal+3−3
@@ -36,8 +36,8 @@ library
3636 jsaddle >= 0.8 && < 0.10,
3737 mtl >= 2.2.1 && < 2.3,
3838 network-uri >= 2.6 && < 2.7,
39− reflex >= 0.5 && < 0.6,
40− reflex-dom-core == 0.4 && < 0.5,
39+ reflex >= 0.5 && < 0.7,
40+ reflex-dom-core >= 0.4 && < 0.6,
4141 safe >= 0.3.9 && < 0.4,
4242 servant >= 0.8 && < 0.15,
4343 servant-auth >= 0.2.1 && < 0.4,
@@ -54,7 +54,7 @@ executable example
5454 buildable: True
5555 else
5656 buildable: False
57− build-depends: aeson, reflex, servant-reflex, base, scientific, servant, reflex-dom, text
57+ build-depends: aeson, reflex, servant-reflex, base, scientific, servant, reflex-dom-core, text
5858 default-language: Haskell2010
5959 main-is: Example.hs
6060 other-modules: API
travis.nix+4−13
@@ -18,26 +18,17 @@ let
1818
1919 ghcjsPkgs = with lib; reflexPlatform.${jsCompiler}.override {
2020 overrides = self: super: {
21− http-media = dontCheck super.http-media;
22− servant = do [ dontCheck doJailbreak ] super.servant;
21+ http-media = dontCheck super.http-media;
22+ servant = dontCheck super.servant;
23+ lens-aeson = dontCheck super.lens-aeson;
2324 servant-reflex = lib.appendConfigureFlag
2425 (self.callPackage ./default.nix {}) "-fExample";
25− uri-bytestring = doJailbreak super.uri-bytestring;
26− http-api-data = dontHaddock super.http-api-data;
2726 };
2827 };
2928
3029 ghcPkgs = with lib; reflexPlatform.${nativeCompiler}.override {
3130 overrides = self: super: {
32− heist = do [ doJailbreak dontCheck ] super.heist;
33− http-media = dontCheck super.http-media;
34− snap = doJailbreak (self.callHackage "snap" "1.1.1.0" {});
35− hspec-webdriver = lib.appendPatch super.hspec-webdriver
36− ./nix/hspec-webdriver.patch;
37− hspec-snap = doJailbreak super.hspec-snap;
38− snap-server = dontCheck super.snap-server;
39− servant-snap = do [ dontCheck doJailbreak ] (self.callHackage "servant-snap" "0.8.1" {});
40− skylighting = dontCheck super.skylighting;
31+ servant-snap = dontCheck ((import ./nix/servant-snap.nix {}) self super);
4132 testdriver = self.callCabal2nix "testdriver" ./testdriver {};
4233 testserver = import nix/testserver.nix ghcjsPkgs.servant-reflex self super;
4334 };