This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-04
Channels
- # announcements (7)
- # babashka (26)
- # babashka-sci-dev (19)
- # beginners (66)
- # calva (4)
- # clj-kondo (55)
- # cljs-dev (173)
- # cljsrn (17)
- # clojure (86)
- # clojure-art (3)
- # clojure-australia (1)
- # clojure-europe (24)
- # clojure-india (1)
- # clojure-nl (3)
- # clojure-uk (6)
- # clojured (5)
- # clojurescript (39)
- # cursive (8)
- # data-oriented-programming (20)
- # datomic (9)
- # emacs (10)
- # events (1)
- # figwheel-main (16)
- # fulcro (33)
- # gratitude (1)
- # helix (2)
- # hugsql (2)
- # jobs (2)
- # kaocha (4)
- # leiningen (5)
- # lsp (110)
- # malli (1)
- # missionary (17)
- # observability (3)
- # re-frame (10)
- # reagent (1)
- # reitit (7)
- # rewrite-clj (3)
- # shadow-cljs (63)
- # sql (19)
- # tools-build (74)
- # tools-deps (32)
- # transit (1)
- # xtdb (5)
Not a question for babashka in perticular, but I know I might find the answer here: I have an input stream, that yields me a json string per line and I would like to parse and transform it and send it to *out*
, how would you do it?
I am using io/copy
for now, but I don't know how I could have an intermediary step.
(binding [*in* (io/reader json-input-stream)]
(loop []
(when-let [line (read-line)]
(do-something)
(recur))))
Thanks a lot
or with cheshire, you can use parsed-seq
directly to get a lazy seq of top level json elements
Hi all - I’m trying to pull in and use Aero which is listed as a supported project - but I’m doing something wrong - when I’ve pulled in my dependency with (add-deps…) and required the library I’m getting a ‘No reader function for tag env’ which is in my config - any pointers? Thanks!
@rossajmcd where is that data reader normally defined? bb does not process data_readers.cljc
but there is a way to set that manually
Without looking into it - I assumed it comes out of the box with use of the Aero library - I think in previous standard clojure usage that has been the case (though its been a while since I used it)
so for me - the only instances I have seen are in the edn config files I have previously used - no other setup required in my project(s)
in terms of Aero : https://github.com/juxt/aero/blob/743e9bc495425b4a4a7c780f5e4b09f6680b4e7a/src/aero/core.cljc#L48
This works for me:
(require '[babashka.deps :as deps])
(deps/add-deps '{:deps {aero/aero {:mvn/version "1.1.6"}}})
(require '[aero.core :refer (read-config)])
(spit "/tmp/test.edn" "#env PATH")
(read-config "/tmp/test.edn")
oh - sorry to waste your time - definitely on my side - my app is reading the config file for obvious reasons - and was unfortunately also reading it as part of some other functionality - my bad
hello! i would like to move some of my graal projects to babashka since all that hard work has already been done and i can just benefit (thanks @borkdude!). are there any examples or caveats i should be aware of when distributing multi-file bb projects through something like homebrew?
I recommend testing that locally :). I've recently been trying to make a multi-file brew package myself, based on how the clojure CLI does that
I have one shell script to place the bundled files in the install dir: https://github.com/babashka/obb/blob/main/script/brew_install.sh And here's a PR for the brew formula: https://github.com/babashka/homebrew-brew/pull/1/files
And then it's a matter of setting the classpath so bb will find those files correctly, too.
This is a bit complicated though. For neil, a CLI babashka script that I also distribute via brew, I just use add-deps
https://github.com/babashka/neil/blob/65b5508a8496abe4d3a7168205b211760e9f4a8a/neil#L8
but this has the downside that the user must have Java on their system to fetch those deps the first time.
The first approach can also be done using an uberjar which contains all relevant resources and then you install that uberjar in the install dir and set the classpath to that uberjar.