Fork me on GitHub
#babashka
<
2021-06-22
>
Lyderic Dutillieux10:06:18

Hey, I was wondering two things : • Is there a way to make the clj-http lib work with babashka • If not, is there a way to 'shadow' clj-http with clj-http-lite (kind of the same feature as yarn resolutions, each time sci sees a clj-http namespace it resolves it to clj-http-lite Thanks in advance

borkdude10:06:07

@lyderic.dutillieux clj-http doesn't work (from source) with babashka. clj-http-lite does work (https://github.com/babashka/clj-http-lite). You could "fake" clj-http by defining similar namespaces and just def-ing vars that point to the clj-http-lite ones. Can you provide some background as to why you need this?

borkdude10:06:11

Also babashka packages both babashka.curl and org.httpkit.client which you could also use to "fake" clj-http, which saves you the burden of loading clj-http-lite from source.

Lyderic Dutillieux10:06:21

The use case is that I have a leiningen project with some utilities that rely on clj-http and are used in production, and now I'ld like to have some developer tasks to execute some of these functions. I could use leiningen tasks actually, but if babashka supports it, I'm enclined to use it 🤓

borkdude10:06:53

@lyderic.dutillieux if you control the code, then it's easier. you could just make .cljc files and use :bb reader conditionals

Lyderic Dutillieux10:06:59

Good to know, thanks for the pointers :)