Thanks for this example. I am able to get your code working, however, it doesn't work when I also pull in my svg library. As soon as I require svg-clj (where the real use of spec occurs), uberscript will pull in clojure spec's code.
If I modify my ns
(ns svg-clj.main
(:require [clojure.string :as st]
#_[clojure.spec.alpha :as s] ;; eliminate spec requirement here
[clojure.pprint :as pp]
[clojure.data.xml :as xml]
#?(:clj
[hiccup.core :refer [html]])
#?(:cljs
[cljs.reader :refer [read-string]])))
Then your approach works. I was thinking of spartan as a complete 'drop in' replacement, but I may have to use a reader conditional in my library to get it to work with an uberscriptThese are good suggestions. The uberscript approach was the first one I tried and succeeded with. I still plan to try uberjars as well. It's the next on the list. I'm still very much in the 'exploratory' phase of scripting :)
😄
when I click the link below I get a 404. Just a heads up… bb --nrepl-server 1667 Started nREPL server at 127.0.0.1:1667 For more info visit https://github.com/babashka/babashka/blob/master/doc/repl.md#nrepl.
Ah right, that link moved to the http://book.babashka.org. I will change it, thanks
I can ignore/tolerate this but it would be cool if it could be silenced
Is this an nREPL middleware?
@adam.james Thanks for becoming a sponsor on Github. Would you like to have access to the private sponsors channel?
No, vanilla cursive. I’d guess it’s Cursive assuming a CLJ or CLJS env. prob best if we wait for comment from Colin
I’m not blocked and have pods working already so I’m good. I just ignore it
if it becomes too painful, I’ll switch to Calva
I might try creating an nrepl middleware that throws away that specific exception. that would make life a little nicer
Yeah, the thing is with babashka nREPL is that you (at the moment) can't have middleware, since the nREPL server is pretty much a monolithic thing that supports only the basic nREPL features + the pprint middleware
We could support defining middleware in a babashka script possibly, but that's not there at the moment
Ok. That's definitely my knowledge limit. Let's see what Colin says in (our downunder) morning
Sure, that sounds nice
@heow Thanks for sponsoring! Would you like to have access to the private sponsors channel?
does anybody store config info in an environment var, like a hash?
export FOO_OPTS='{:name "Alice" :score 10}'
i have at least one project that does that
i've noticed that clojure.instant is not included. is it an oversite or there is a reason for it?
great, I was wondering if there is a good reason I don't see it more often
How are you using clojure.instant
? bb generally advices to use java.time
some old code that i cut and pated, i guess i can port it to java.time
Ugh, I’ve been meaning to look at this, sorry. Cursive should probably either interrogate the REPL at startup to get an idea of the env available, or allow the user to configure it and assume they know what they’re doing.
Cursive doesn’t use middleware, so it’s not that. I suspect the code it sends over for completion uses features that bb doesn’t offer.
@cfleming Can Cursive connect to an already started nREPL that hasn't been started by Cursive itself? I would expect the same problem to manifest there
Yes, it can.
pst.clj example helped a lot, that zone stuff in java.time is tricky 🙂
you don't have to use the Zoned stuff if you use the Local stuff right?
btw this lib also works with babashka: https://github.com/henryw374/cljc.java-time
cljc.java-time can vouch for it!
I thought this might be the case. I’ll ignore the exceptions for now. It’s worth it because using a REPL for bb is much faster than testing using bb cli
fwiw: I am starting the nrepl server in a terminal window and connecting to that. It was trivial to get started, this is a really good DX
@borkdude following up from an earlier thread, I can confirm that bb works with aws-vault i.e. aws-vault exec cloudwatch-readonly -- bb --nrepl-server 1667
where cloudwatch-readonly is one of my iam roles
probably not a big surprise but still good to know as vault is a best practice for AWS access on dev machines