This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-21
Channels
- # announcements (9)
- # babashka (45)
- # beginners (45)
- # calva (1)
- # clojure (40)
- # clojure-austin (16)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-norway (35)
- # clojure-uk (4)
- # clojurescript (11)
- # conjure (3)
- # cursive (4)
- # datalevin (14)
- # datavis (1)
- # datomic (8)
- # emacs (6)
- # hyperfiddle (7)
- # introduce-yourself (3)
- # joyride (17)
- # missionary (16)
- # off-topic (2)
- # pedestal (9)
- # polylith (27)
- # re-frame (7)
- # reitit (1)
- # releases (1)
- # shadow-cljs (17)
- # sql (17)
- # tools-build (19)
- # tools-deps (15)
- # xtdb (15)
I'm trying to work with bb
and Conjure
in a project that I know to be working (it runs in our CI 🙂 )
When I try to evaluate a namespace that requires e.g. medley.core
, the Conjure repl tells me that it does not know that ns.
Do I need to run some bb
command to "install" dependencies?
Adapting this example to Conjure: https://github.com/babashka/babashka/blob/master/doc/projects.md#medley
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {medley/medley {:mvn/version "1.3.0"}}}')
vim somescript.clj
(require '[medley.core :as m])
(m/index-by :id [{:id 1} {:id 2}])
; => {1 {:id 1}, 2 {:id 2}}
it's in bb.edn
:deps {dev.weavejester/medley {:mvn/version "1.7.0"}
...
I re-checked and it works for me, now, too! wtf!
Maybe the folder that I open nvim from is important?
because that's the only thing that changed AFAIK
thank you so much!
hahaha 😄
Which quirks have you stumbled particularly upon?
Like wondering why it doesn't work when I'm actually connected to my normal JVM repl 🙂
hahaha
for most docs 😛
Does
<localleader>gd Go to the definition of the word under the cursor.
Support for this may vary between languages.
work for you? I get an error about an unsupported target.; def (word): m/index-by
; zipfile:///home/aasa/.m2/repository/dev/weavejester/medley/1.7.0/medley-1.7.0.jar::medley/core.cljc [293 1]
Yeah ok, it works for functions defined within the same buffer, but not for functions from a different buffer unless I've eval'ed that buffer. It also does not work for e.g. function parameters used in the function body, which I thought a fair assumption, but an assumption, none the less 🙂
Thanks for checking/elaborating 🙂
Thanks BORKDUDE, I rewrote some more bash scripts into glorious bb today and could not have been happier with the experience.
Hello! Can someone help me translate this curl request to its equivalent with babashka/http-client please?
curl -X POST -d @/path/to/file.json \
-H "Content-Type: application/json" \
--url my-url \
--header 'authorization: Bearer REDACTED-JWT-TOKEN'
So far I have this:
(http/post "my-url"
{:headers {"Content-Type" "application/json"
"Authorization" "Bearer REDACTED-JWT-TOKEN"}
:data (slurp "/path/to/file.json")})
But I'm getting errors from the server, while the curl variant works and I'm not sure what's the issue. is it the file? I'm not sure what babashka expects
PS: (shower thought) are you aware of any tools that convert curl commands to clj-http/babashka http-client inputs and vice versa? :thinking_face:The error isn't informative, it's a generic flask message about an invalid request. I'm not at my computer right now but I'll check tomorrow Damn, could be data vs body. Thanks for the hint
It should be body
indeed - still doesn't work but doesn't seem to be babashka-related (emacs hangs)
Thanks, I was starting to lose my mind 😄
I don't know if this would help, but the use of the Client within the bb implementation helped me get over insecure server issue.
can I access *input*
from inside a task?