unisonweb / elm-browser

A Unison Github repo explorer in Elm
MIT License
34 stars 4 forks source link

Use wai-cli. #6

Closed zenhack closed 4 years ago

zenhack commented 4 years ago

This gives us a lot of nice options (e.g. setting the port to listen on) for free.

mitchellwrosen commented 4 years ago

I'm not sure about this one, just because of the dep footprint. What might we want from wai-cli besides a port parser?

zenhack commented 4 years ago

It doesn't seem like a particularly huge dependency. But, it also gives us some nice deployment options, tls handling, etc. which might be nice if at some point somebody wants to run one of these in a publicly facing context.

Admittedly the port thing is all that I personally care about right now, just because I already had something running on 8080 on my local machine.

mitchellwrosen commented 4 years ago

I think the TLS, CGI, etc. stuff is probably better handled by nginx, load-balancer, something else :man_shrugging:

Could we therefore revisit the wai-cli dependency another time? (Agree that the port should be made configurable, for sure.)

zenhack commented 4 years ago

I mean, feel free to leave this pr hanging if you're ambivalent about it. But again, it just doesn't seem like it's a particularly huge dependency to me; is there something it's pulling in that seems like it would actually pose a problem? I'm just not seeing the practical concern.

Sure, we could write bits of this ourselves, but why?

mitchellwrosen commented 4 years ago

I checked it out, the number of additional dependencies wai-cli brings in is actually quite high:

> Cabal 2.4.1.0
> aeson 1.4.4.0
> ansi-terminal 0.9.1
> asn1-encoding 0.9.5
> asn1-parse 0.9.4
> asn1-types 0.3.3
> base-compat 0.10.5
> base-orphans 0.8.1
> base64-bytestring 1.0.0.2
> basement 0.0.11
> cabal-doctest 1.0.6
> cereal 0.5.8.1
> clock 0.8
> colour 2.3.5
> cookie 0.4.4
> cryptonite 0.25
> data-default-class 0.1.2.0
> dlist 0.8.0.7
> easy-file 0.2.2
> exceptions 0.10.2
> fast-logger 2.4.16
> ghc-boot-th 8.6.5
> hourglass 0.2.12
> memory 0.14.18
> monads-tf 0.1.0.3
> mtl 2.2.2
> old-locale 1.0.0.7
> old-time 1.1.0.3
> options 1.2.1.1
> parsec 3.1.14.0
> pem 0.2.4
> pretty 1.1.3.6
> resourcet 1.2.2
> socket-activation 0.1.0.2
> tagged 0.8.6
> template-haskell 2.14.0.0
> th-abstraction 0.3.1.0
> time-compat 1.9.2.2
> tls 1.4.1
> tls-session-manager 0.0.3
> transformers-compat 0.6.5
> unix-time 0.4.7
> unliftio-core 0.1.2.0
> uuid-types 1.0.3
> vector 0.12.0.3
> void 0.7.3
> wai-cli 0.2.1
> wai-extra 3.0.28
> wai-logger 2.3.5
> warp-tls 3.2.7
> x509 1.7.5
> x509-store 1.6.7
> x509-validation 1.6.11

Given that, do you still believe this dependency is worth incurring?

zenhack commented 4 years ago

The vast majority of those are very popular packages; I feel like the first time we pull in almost any non-trivial lib we're going to pull in like 80% of those (template-haskell? mtl? parsec? vector?).

The only bits I'd even blink at would be the tls related deps & socket-activation. It looks like most of those can be disabled via package flags on wai-cli, if that makes you more comforable (though I don't know off hand to specify that as part of the dependency?)

But ultimately I don't feel very strongly; if you do we can avoid the dep.

mitchellwrosen commented 4 years ago

Cool :+1: gonna close this one out. I've added a simple port parser to the CLI in the meantime (and defaulted to 8180 instead).