Fork me on GitHub
#clojure-europe
<
2021-10-18
>
dharrigan06:10:02

Good Morning!

reefersleep06:10:07

Godmorgen 🙂

borkdude10:10:25

Morning! Launch an #nbb REPL from a Node.js program:

import { loadString } from 'nbb'
await loadString(`
(require '[nbb.repl :refer [repl]])
(repl)
`)
console.log('The end!')
$ node repl.mjs
user=> (+ 1 2 3)
6
user=> The end!
😎

💪 4
🎉 4
lread12:10:04

Good morning, humans!

RAMart12:10:44

Out of curiosity: How do you update library versions in Clojure and ClojureScript projects, when you have... let's say... 30 or more dependencies? :thinking_face: We really find it tricky to work out the next set of compatible stable versions of the used libraries – including the Clojure and (even more challenging) ClojureScript version. Any reports from the field?

mccraigmccraig12:10:27

no good solution. we've got lots of deps... we'll do an across-the-board update once in a while in the run up to a release, and fiddle with :exclusions and versions until we get something that works

mccraigmccraig12:10:37

occasionally it's been quite painful

mccraigmccraig12:10:25

we're still using lein and we use :pedantic? :abort which at least forces all conflict resolutions to be explicit

RAMart12:10:20

Thanks for the :pedantic? reminder!

borkdude12:10:11

Perhaps https://github.com/borkdude/api-diff will help somewhat

🙇 1
gratitude 1
borkdude12:10:04

although in the CLJ(S) world I don't expect many breakages

javahippie12:10:11

We don’t often see version conflicts, but when we do, it’s always because of Jackson :face_with_monocle:

gklijs13:10:01

Yes, even with just my tiny projects Jackson is often a problem. Kind of default to exclude it from all, and set the versions to latest.

seancorfield17:10:23

@U1Z4D5SSV We generally update our Clojure dependencies any time any of them change but we're much more careful about updating our Java dependencies. Clojure libraries are usually pretty good about not breaking stuff but Java libraries can be horrible. We have one app stuck on Jackson 2.8.11 because 2.9 introduced a breaking change (impacting merge handling with null values) that breaks that app -- but everything else has been able to move to a more recent version of Jackson.

seancorfield17:10:46

Caveat: we're already using 1.11 Alpha builds of Clojure in production so we're used to being on the bleeding edge.

RAMart17:10:09

Thanks for sharing your insight!

dominicm17:10:37

I've been thinking of writing a tool which warns you when you depend on a library that's older than the version your dependencies depend on. e.g. if you've upgraded a transitive manually at some point.

dominicm17:10:03

Between the stability of clojure & the new tdeps algorithm, there's not much to catch people out anymore.

RAMart17:10:58

> I've been thinking of writing a tool which warns you when you depend on a library that's older than the version your dependencies depend on. I'm looking for a tool where I can paste my project.clj in and get an updated, shiny new bullet-proof project.clj out. 😁

borkdude17:10:17

@U1Z4D5SSV Isn't that tool called antq?

borkdude17:10:06

also there has been lein ancient for a long time but I'm not sure if that also rewrites your project.clj file

RAMart17:10:31

Thanks, @U04V15CAJ! I'll have a look at antq to see if it could ease my pain.

seancorfield17:10:25

We use antq at work -- it's great! We run it in "reporting" mode rather than "updating" mode since we know we have a few libs that are not safe to auto-update. It checks dependencies in GH Actions scripts, pom.xml, deps.edn, and a bunch of other stuff.

raymcdermott12:10:15

hello mr orning

borkdude16:10:44

@raymcdermott Talking about core.specs, I just used a core.spec of defn with grasp which can be used to find matching expressions in sources. I wondered which libs are using the trailing metadata map in defn and found only one: https://github.com/borkdude/sci/issues/567#issuecomment-945947813

raymcdermott17:10:47

So it’s an idea whose day is yet to come. Still, works for me