haskell-servant / servant-multipart

Support for file uploads in multipart/form-data for servant
https://hackage.haskell.org/package/servant-multipart
40 stars 37 forks source link

GHCJS compilation #48

Open NCrashed opened 4 years ago

NCrashed commented 4 years ago

If you try to compile the package with GHCJS (for instance, for generation of frontend from servant API), you will get:

error: no C compiler provided for this platform
NCrashed commented 4 years ago

I have split package to api and backend part. https://github.com/hexresearch/servant-multipart/commit/92b6cb3458d51642e448862756d70d6df760e5b6

tfc commented 3 years ago

Hi, i could use this, too. Would you mind opening a pull request in this repo in order to upstream it?

tfc commented 3 years ago

@maksbotan @arianvp any way to get this in? i would also port the pull request to this repo if necessary.

maksbotan commented 3 years ago

Indeed, if for some weird reason you guys use servant-multipart with GHCJS (why tho?), it should be splitted into servant-multipart-api, servant-multipart-client and servant-multipart (containing server code).

I would appreciate a draft PR that I can improve on. Basically, please make the current package a subdir of the repo and add two more packages, like servant itself does it.

tfc commented 3 years ago

Indeed, if for some weird reason you guys use servant-multipart with GHCJS (why tho?), it should be splitted into servant-multipart-api, servant-multipart-client and servant-multipart (containing server code).

Does anything speak against doing that (i am eager to learn)? I look at this from a perspective where i have an API which simply contains file uploads and need to generate client code for it.

I would appreciate a draft PR that I can improve on. Basically, please make the current package a subdir of the repo and add two more packages, like servant itself does it.

Makes sense.

gdeest commented 3 years ago

Just a quick heads-up here,

There was some discussion about merging most sub-projects, including servant-multipart, into the main servant repository (see: https://github.com/haskell-servant/servant/issues/1404 ). The main reason is that the cookbooks induce a dependency loop between the various projects, and updates introduce frequent breakages.

Maybe is this a good opportunity to do so for this project ? CI is already setup for GHCJS there.

gdeest commented 3 years ago

For the record, I am :+1: for the split.