Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add servant-client-jsaddle #1018

Closed
wants to merge 25 commits into from

Conversation

roberth
Copy link
Contributor

@roberth roberth commented Jul 28, 2018

Contributions welcome :)

To do

  • hlint
  • see if it builds on the CI: no GHCJS dependency!
  • add usage example
  • improve typedarray use in sendXhr

@phadej
Copy link
Contributor

phadej commented Nov 8, 2018

Oh. This went completely under my radar. I'll check this tomorrow.

@roberth
Copy link
Contributor Author

roberth commented Jan 21, 2019

Blip. :)

Copy link
Contributor

@alpmestan alpmestan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phadej OK with this?

@phadej
Copy link
Contributor

phadej commented Jan 21, 2019

I'll add this to travis first, let's see then.


testServer :: Server TestApi
testServer x = do
liftIO $ putStrLn "Hello tehre"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/tehre/there/?

@vaibhavsagar
Copy link
Contributor

Is there any way I can help move this along?

@roberth
Copy link
Contributor Author

roberth commented Jan 31, 2019

@phadej did you make any progress with travis ci?

@alpmestan
Copy link
Contributor

Hello,

Sorry for the delay! Both @phadej and I have been quite busy lately. I think we just need to add this new package to the cabal.project file and use haskell-ci to regenerate the travis script. Do you feel like giving it a shot or do you want us to drive this home?

@vaibhavsagar
Copy link
Contributor

@alpmestan I tried to do this here: roberth#1

@alpmestan
Copy link
Contributor

@vaibhavsagar Your patch seems to be changing GHC versions, not just the list of packages to test?

@vaibhavsagar
Copy link
Contributor

@alpmestan I think I misunderstood what you wanted me to do earlier. I've tried again now, can you have another look?

@vaibhavsagar
Copy link
Contributor

I accidentally force-pushed to the wrong branch, sorry about that!

@alpmestan
Copy link
Contributor

Is the diff against servant's master branch? Still seems like there are too many changes, wrt GHC versions etc.

@phadej knows better though, so he may have more precise feedback.

@vaibhavsagar
Copy link
Contributor

Yes, the diff is against servant's master branch.

Attempt to generate .travis.yml using haskell-ci
@alpmestan
Copy link
Contributor

alpmestan commented Feb 1, 2019

Apparently there's a conflict with our current travis script now, so the job won't run... Sorry about that, do you want to look into it?

@vaibhavsagar
Copy link
Contributor

Fixed.

@alpmestan
Copy link
Contributor

OK, I now see:

cabal: Could not resolve dependencies:
[__0] trying: cookbook-basic-auth-0.1 (user goal)
[__1] trying: base-4.12.0.0/installed-4.1... (dependency of
cookbook-basic-auth)
[__2] next goal: servant-client-jsaddle (user goal)
[__2] rejecting: servant-client-jsaddle-0.13 (conflict:
base==4.12.0.0/installed-4.1..., servant-client-jsaddle => base>=4.7 && <4.11)
[__2] fail (backjumping, conflict set: base, servant-client-jsaddle)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, cookbook-basic-auth,
servant-client-jsaddle

@phadej
Copy link
Contributor

phadej commented Feb 2, 2019

jsaddle packages don't support recent versions of dependencies,
e.g. no install plan with GHC-8.6: https://matrix.hackage.haskell.org/#/package/jsaddle/0.9.5.0/ghc-8.6.3@1548602028

I had to add: and an install plan with GHC-8.4.4 is found: (didn't try to build though)

-- jsaddle
allow-newer:
jsaddle:aeson,
jsaddle:exceptions,
jsaddle:lens,
jsaddle-webkit2gtk:aeson,
jsaddle-webkit2gtk:haskell-gi-base,
jsaddle-dom:base-compat,
jsaddle-dom:lens

-- Ubuntu packages:
-- libgirepository1.0-dev
-- libwebkit2gtk-4.0-dev


`aeson` is restricted to `<1.3` (1.3.0.0 uploaded at Wed Mar 7 18:38:53 UTC 2018)
`exceptions` is <0.9; and (0.10 uploaded  at Sun Mar 11 15:01:38 UTC 2018)

---

I cannot commit to maintain `servant-client-jsaddle` if `jsaddle` itself isn't maintained. Getting `jsaddle` to track dependencies with less only few month lag is a hard requirement, unfortunately.

I pushed my branch to https://github.com/haskell-servant/servant/compare/wip-servant-client-jsaddle

@phadej phadej added the blocked label Feb 2, 2019
@vaibhavsagar
Copy link
Contributor

I can't seem to reproduce this build failure locally.

@vaibhavsagar
Copy link
Contributor

Ah, it looks like this is due to 4fab471.

@vaibhavsagar
Copy link
Contributor

The 8.4 and 8.6 builds are choking on building jsaddle-dom, and I'm beginning to think that replacing jsaddle-webkit2gtk with something else like jsaddle-warp might reduce the number of dependencies and finally allow this build to complete.

@alpmestan
Copy link
Contributor

We have faith in you @vaibhavsagar.

@phadej
Copy link
Contributor

phadej commented Feb 8, 2019 via email

Copy link
Contributor

@eskimor eskimor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added PR for PR: #1122

, http-media
, http-types
, jsaddle
, jsaddle-dom
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good reason we are using jsaddle-dom instead of ghcjs-dom?

It is usually preferred to use ghcjs-dom instead of jsaddle-dom directly, as it avoids some overhead when compiled with ghcjs. Also as other libraries usually depend on ghcjs-dom- jsaddle-dom does become an additional build dependency when using servant-reflex-jsaddle right now.

I am going to provide a PR for this PR, changing that dependency and fixing some imports.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason was portability. Looks like ghcjs-dom provides the same portability, so sgtm.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eskimor using ghcjs-dom might also unblock the 8.4 and 8.6 builds, which are currently failing when trying to compile JSDOM.Types

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not, as ghcjs-dom has a similar module - and on ghc it is even the same.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ghcjs-dom uses jsaddle-dom on ghc under the hood)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

@dredozubov
Copy link
Member

I was able to build it with jsaddle-warp and updated 0.16: https://github.com/dredozubov/servant/tree/wip-servant-client-jsaddle-016 I've probably messed up the .travis.yml merge, but overall it's good news

, case-insensitive >= 1.2.0.0 && < 1.3.0.0
, containers >= 0.5 && < 0.7
, exceptions >= 0.8 && < 0.11
, http-media
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are version bounds ommitted for these deps?

Co-Authored-By: Herbert Valerio Riedel <hvr@gnu.org>
@hvr
Copy link
Contributor

hvr commented May 30, 2019

Btw, what's blocking this PR currently? Also, it seems like the .travis.yml file diverged from the merge base?

@phadej
Copy link
Contributor

phadej commented May 30, 2019

This version of the patch requires xfvb and libwebkit2gtk-4.0-dev and other crap from CI. I recall there was a branch of this branch which doesn't need all of that, but it didn't emerge into PR.

To be clear: I know very little about jsaddle, so cannot cleanup myself. This PR isn't such I could just press merge.

@dredozubov
Copy link
Member

dredozubov commented May 30, 2019

I have a branch that I updated to use 0.16 https://github.com/dredozubov/servant/tree/wip-servant-client-jsaddle-016

It has a few rough edges: I may have screwed up the merge of .travis.yml(I haven't bothered to check) and I skipped the streaming part for the request handling. Nonetheless, it builds with jsaddle-warp and I've used it in an application.

Should I force-push it here or create a PR for this PR?

@phadej
Copy link
Contributor

phadej commented May 30, 2019

.travis.yml can be regenerated with haskell-ci, if it conflicts, just regenerate.

This is @roberths branch, I have no idea who can or cannot push there; but I wouldn't.

@eskimor
Copy link
Contributor

eskimor commented May 30, 2019

@dredozubov just create a PR for the PR and ping me.

@phadej
Copy link
Contributor

phadej commented May 30, 2019

Btw, I'd like the clean-history PR at the end. Dozens of commits with merge commits in between won't be merged.

@phadej
Copy link
Contributor

phadej commented Sep 28, 2019

servant-jsaddle merged.

@phadej phadej closed this Sep 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants