This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-22
Channels
- # announcements (1)
- # babashka (94)
- # beginners (11)
- # biff (9)
- # calva (21)
- # clj-kondo (14)
- # clojure (12)
- # clojure-europe (56)
- # clojure-nl (1)
- # clojure-norway (41)
- # clojure-uk (4)
- # clojurescript (4)
- # core-logic (2)
- # gratitude (12)
- # honeysql (1)
- # hoplon (3)
- # hugsql (7)
- # introduce-yourself (2)
- # jobs-discuss (23)
- # leiningen (3)
- # malli (11)
- # off-topic (1)
- # pedestal (11)
- # reagent (3)
- # squint (8)
- # vim (9)
- # xtdb (3)
Recently, I read through all the guides on the Pedestal website: http://pedestal.io/pedestal/0.7-pre/guides/hello-world.html. I believe they were written by @mtnygard and are maintained by @hlship. I learnt so much about how to write good Clojure code from these guides! — How to think about routing, How to separate concerns, How to write testable code! The guides were an absolute delight to read through. Thank you!
Thank you @jpmonettas for #C03KZ3XT0CF 🙂 I didn’t think that my REPL experience could become sweeter, but boy was I wrong. Flow-Storm has made debugging an order of magnitude easier.
If you haven't yet, try combining it with @U1G869VNV’s Portal... it's a great, great combo!
I’d love to see what Portal adds to Flow-Storm. I find myself only in the Flow-Storm UI. I’d love to see how Portal improves the experience
Well, the data inspection aspect of Portal is nicer than the one currently on Flowstorm. You can make it so that you tap a value on Flowstorm, and it shows up on Portal, for you to navigate it. You can do some other cool stuff on Portal (one thing I found super nice is that you can compose the portal submit function with some arbitrary processing, so for example I made it so that documents I keep on XTDB can be navigated in portal, so clicking anything that looks like a UUID, or corresponds to a key that I know maps to an id, takes me to that object in the DB, but the possibilities are endless, really)
I suspect you could eventually have a Portal instance in a webview inside Flowstorm, with a little hacking.
^ Okay, this is really cool. I’m assuming this is using the datafy/nav protocols for making queries to flesh out the data. I’m using next-jdbc + PG, and I believe next-jdbc already has implementations of datafy/nav on the data it returns. I’ll check if Portal can help me get a “excel” style view of my data.
Yes, basically I do a walk/postwalk on the results, and reify Nav
via meta-data
(defn fetch [coll k v]
(if-let [xx (xt/entity (xt/db node) v)]
(navify xx)
v))
(def navigable-keywords #{:xt/id ,,,})
(defn navify[x]
(walk/postwalk (fn[e]
(if (instance? clojure.lang.IObj e)
(with-meta e {'clojure.core.protocols/nav
(fn[coll k v]
(if (or (contains? navigable-keywords k)
(uuid/uuidable? v))
(fetch coll k v)
(user/navify v)))})
e))
x))
node
there is bound to an initialized instance of XTDB
you can make it neater, of course
and you could extend String
to implement Nav
as well (can't do it via meta-data, unfortunately)