Skip to content

Commit 976f099

Browse files
roberthhvr
authored andcommitted
Add servant-client-jsaddle
- servant-client-jsaddle: Remove some debug printing - Update .travis.yml with haskell-ci - servant-client-jsaddle: bump base bounds - Add libgirepository1.0-dev - servant-client-jsaddle: bump upper bound on containers - servant-client-jsaddle: relax upper bound on semigroupoids - servant-client-jsaddle: bump servant-client-core dependency - servant-client-jsaddle: fix compatibility - servant-client-jsaddle: import correct module - .travis.yml: run xvfb for headless GUI testing - Use ghcjs-dom instead of jsaddle-dom directly. - Also use ghcjs-dom in tests. - Ignore exceptions on send - they are handled in toResponse. - Apparently ghcjs-dom does use the same exception these days. - Got rid of obsolete comment. - Make sure response gets handled even in case of exception. - Update servant-client-jsaddle/servant-client-jsaddle.cabal Dependingon ghcjs-dom avoids the dependency on jsaddle-dom on ghcjs and have slightly better performance on ghcjs. Co-Authored-By: Herbert Valerio Riedel <[email protected]>
0 parents  commit 976f099

File tree

9 files changed

+678
-0
lines changed

9 files changed

+678
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
X.Y
2+
----
3+
4+
Initial release

LICENSE

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Copyright (c) 2014-2016, Zalora South East Asia Pte Ltd, Servant Contributors
2+
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
* Neither the name of Zalora South East Asia Pte Ltd nor the names of other
17+
contributors may be used to endorse or promote products derived
18+
from this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# `servant-client-jsaddle`
2+
3+
This is a an implementation of the `servant-client-core` API on top of `jsaddle`, a framework that lets you write Haskell programs that compile to javascript to run in a browser or compile to native code that connects to a browser.
4+
5+
It is similar to `servant-client-ghcjs`, except it supports native compilation and native GHCi. It even reuses some of the logic from `servant-client-ghcjs`.
6+
7+
# Build
8+
9+
This package comes with a test suite that depends on `jsaddle-webkit2gtk`. You may want to skip that because of the heavy dependency footprint.
10+
11+
cabal new-build --allow-newer=aeson,http-types --disable-tests
12+
13+
# Usage
14+
15+
TBD. Similar to `servant-client` and `servant-client-ghcjs`.

Setup.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Distribution.Simple
2+
main = defaultMain

servant-jsaddle.cabal

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: servant-jsaddle
2+
version: 0.16
3+
synopsis:
4+
automatic derivation of querying functions for servant webservices for jsaddle
5+
6+
description:
7+
This library lets you automatically derive Haskell functions that
8+
let you query each endpoint of a <http://hackage.haskell.org/package/servant servant> webservice.
9+
.
10+
See <http://haskell-servant.readthedocs.org/en/stable/tutorial/Client.html the client section of the tutorial>.
11+
.
12+
<https://github.com/haskell-servant/servant/blob/master/servant-client/CHANGELOG.md CHANGELOG>
13+
14+
license: BSD3
15+
license-file: LICENSE
16+
author: Servant Contributors
17+
maintainer: [email protected]
18+
copyright:
19+
2014-2016 Zalora South East Asia Pte Ltd, 2016-2017 Servant Contributors
20+
21+
category: Servant, Web
22+
build-type: Simple
23+
cabal-version: >=1.10
24+
tested-with:
25+
GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5
26+
, GHCJS ==8.4
27+
28+
homepage: http://haskell-servant.readthedocs.org/
29+
bug-reports: http://github.com/haskell-servant/servant/issues
30+
extra-source-files:
31+
CHANGELOG.md
32+
README.md
33+
34+
source-repository head
35+
type: git
36+
location: http://github.com/haskell-servant/servant.git
37+
38+
library
39+
default-language: Haskell2010
40+
hs-source-dirs: src
41+
ghc-options: -Wall
42+
exposed-modules:
43+
Servant.Client.Internal.JSaddleXhrClient
44+
Servant.Client.JSaddle
45+
46+
-- Bundled with GHC: Lower bound to not force re-installs
47+
-- text and mtl are bundled starting with GHC-8.4
48+
build-depends:
49+
base >=4.9 && <4.13
50+
, bytestring >=0.10.8.1 && <0.11
51+
, containers >=0.5.7.1 && <0.7
52+
, mtl >=2.2.2 && <2.3
53+
, text >=1.2.3.0 && <1.3
54+
, transformers >=0.5.2.0 && <0.6
55+
56+
if impl(ghcjs -any)
57+
build-depends: ghcjs-base
58+
59+
-- Servant dependencies.
60+
-- Strict dependency on `servant-client-core` as we re-export things.
61+
build-depends: servant-client-core >=0.16 && <0.16.1
62+
build-depends:
63+
base-compat >=0.10.5 && <0.11
64+
, case-insensitive >=1.2.0.0 && <1.3
65+
, exceptions >=0.10.0 && <0.11
66+
, ghcjs-dom
67+
, http-media >=0.7.1.3 && <0.9
68+
, http-types >=0.12.2 && <0.13
69+
, jsaddle >=0.9.6.0 && <0.10
70+
, monad-control >=1.0.2.3 && <1.1
71+
, semigroupoids >=5.3.1 && <5.4
72+
, string-conversions >=0.3 && <0.5
73+
, transformers-base >=0.4.4 && <0.5
74+
75+
if impl(ghc >=8.0)
76+
ghc-options: -Wno-redundant-constraints
77+
78+
test-suite spec
79+
type: exitcode-stdio-1.0
80+
ghc-options: -Wall
81+
default-language: Haskell2010
82+
hs-source-dirs: test
83+
main-is: Spec.hs
84+
85+
if impl(ghcjs -any)
86+
build-depends:
87+
base
88+
, servant-jsaddle
89+
90+
else
91+
other-modules: Servant.Client.JSaddleSpec
92+
93+
-- Dependencies inherited from the library. No need to specify bounds.
94+
build-depends:
95+
base
96+
, bytestring
97+
, containers
98+
, exceptions
99+
, ghcjs-dom
100+
, http-media
101+
, http-types
102+
, jsaddle
103+
, mtl
104+
, process
105+
, semigroupoids
106+
, servant
107+
, servant-client-core
108+
, servant-jsaddle
109+
, servant-server
110+
, string-conversions
111+
, text
112+
, wai
113+
, wai-cors
114+
, wai-extra
115+
, warp
116+
, websockets
117+
118+
-- Additonal dependencies
119+
build-depends:
120+
aeson
121+
, hspec
122+
, jsaddle-warp
123+
, QuickCheck
124+
125+
build-tool-depends: hspec-discover:hspec-discover >=2.4.4 && <2.5

0 commit comments

Comments
 (0)