This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-06
Channels
- # aleph (70)
- # announcements (9)
- # babashka (43)
- # babashka-sci-dev (6)
- # beginners (97)
- # cider (2)
- # clj-commons (3)
- # clj-kondo (41)
- # clojure (88)
- # clojure-europe (44)
- # clojure-nl (2)
- # clojure-spec (22)
- # clojurescript (65)
- # community-development (6)
- # conjure (10)
- # cursive (6)
- # datahike (13)
- # datomic (4)
- # eastwood (11)
- # events (1)
- # fulcro (45)
- # graalvm (1)
- # graphql (3)
- # hyperfiddle (3)
- # integrant (7)
- # jobs (1)
- # lambdaisland (1)
- # lsp (58)
- # nbb (4)
- # nrepl (3)
- # pathom (15)
- # shadow-cljs (27)
- # tools-deps (1)
https://github.com/clj-commons/potemkin has been released.
There are no changes to functionality. Everything should work as before.
The major change is improved support for clj-kondo. While not comprehensive, it should cut down on false positives. Note that import-vars
was already handled specially by clj-kondo, so if that’s the only potemkin macro you use, you shouldn’t see any differences.
Minor changes include doc improvements, the minimum Java version is now 8, and the fast-bound-fn
and fast-memoize
fns are deprecated (they’re almost never faster than modern Clojure).


https://github.com/ivarref/clj-paginate, fast pagination of vectors and maps with Clojure for GraphQL, has been released.
This release adds support for multiple sort criteria (ascending or descending), e.g. you may specify sort-attrs
as [[:date :desc] [:id :desc]]
.
It also adds support for the named parameter :inclusive?
that allows a user to refresh a page based only on an old pageInfo/connection.
It introduces the named parameter :sort?
that defaults to true
. clj-paginate will now (by default) sort the data for you.
Power users, people who already cache the (sorted) data to be paginated, can disable that feature.
The first public release of gh-release-artifact
: Upload artifacts to Github releases idempotently
This is small library that I've been using in projects like babashka, clj-kondo, and others, for a few years now, to automatically upload files to Github releases. This library is especially handy when your project is built from different CIs and releases for those files have to be created idempotently (babashka currently uses 4 different CIs to build releases on).
Repo: https://github.com/borkdude/gh-release-artifact
The main API function is here:
https://github.com/borkdude/gh-release-artifact/blob/main/API.md#borkdude.gh-release-artifact/release-artifact
Methodical 0.15.0 is out! https://github.com/camsaul/methodical/releases/tag/0.15.0.1
Methodical is a library that acts like a drop-in replacement for Clojure multimethods, with tons of extra features, support for functionally/non-destructively composing multimethods, better error checking, and debugging tooling.
The last few releases have focused on improving the developer experience with better error checking, documentation generation, and tooling, and 0.15.0 continues this theme.
The marquee feature of 0.15.0 is support for macroexpansion-time defmethod
arglist arity validation. If you have a three-arg multimethod and try to write a defmethod
for it that takes only two args, get an error message right away!
(m/defmulti ^:private mf
{:arglists '([x]), :defmethod-arities #{1}}
keyword)
(m/defmethod mf :x [x] x)
;; => ok
(m/defmethod mf :x ([x] x) ([x y] x y))
;; => error: {:arities {:disallowed #{2}}}
(m/defmethod mf :x [x y] x y)
;; => error: {:required #{1}, :disallowed #{2}}
(Yes, this works with rest-argument &
arities as well!)
0.15.0 also includes improved error messages, a bug fix, and ten new utility functions.That's sick! How does it work? Just checking the :arglists
of the metadata?
I considered doing that at first but decided that was ultimately too fragile, especially if you have "fancy" :arglists
metadata like [x y z?]
(meaning [x y] [x y z]
)
So instead you can attach a set of :defmethod-arities
metadata that is a set of allowed arities; each arity is represented by either an integer or by a [:>= n]
form for an arity with & rest
arguments.
The example above demonstrates using a plain integer arity. Here's an example that includes a 3-or-more-args arity:
;; methods must both a 1-arity and a 3+-arity
(m/defmulti ^:private mf
{:arglists '([x] [x y z & more]), :defmethod-arities #{1 [:>= 3]}}
keyword)
(m/defmethod mf :x ([x] x) ([x y z & more] x))
;; => ok
(m/defmethod mf :x [x y] x)
;; => error: {:arities {:required #{1 [:>= 3]}, :disallowed #{2}}}
it's smart enough to figure out if you cover your bases with other arities that aren't exactly the same as what was asked too:
(m/defmulti ^:private mf
{:arglists '([x y z & more]), :defmethod-arities #{[:>= 3]}}
keyword)
(m/defmethod mf :x
([a b c] x)
([a b c d] x)
([a b c d & more] x))
;; => ok, because everything required by [:>= 3] is covered, and everything present is allowed by [:>= 3]
Oh I see. Okay, that makes sense. Very cool