Fork me on GitHub
#announcements
<
2022-01-13
>
tony.kay00:01:45

Released Fulcro RAD 1.1.2. https://github.com/fulcrologic/fulcro-rad • Adds support for custom form save mutations, and save parameters on forms • Fixes missing support in date/time formatting (on the js side) for literals in the timestamp (via ’) • Adjusts deps to fix tests due to the intentional NPM self-sabotage of colors.js

🎉 6
borkdude15:01:10

clj-kondo 2022.01.13: a linter for Clojure code that sparks joy clj-kondo • Add linter `:conflicting-fn-arity`: warn when an arity occurs more than once in a function that overloads on arity. https://github.com/clj-kondo/clj-kondo/issues/1136 (https://github.com/mknoszlig) • Add linter `:clj-kondo-config` which provides linting for `.clj-kondo/config.edn`. https://github.com/clj-kondo/clj-kondo/issues/1527 • Relax `:reduce-without-init` for functions known to be safe https://github.com/clj-kondo/clj-kondo/issues/1519 • Symbol arg to `fdef` can be arbitrary namespace https://github.com/clj-kondo/clj-kondo/issues/1532 • Improve potemkin generated var-definition analysis https://github.com/clj-kondo/clj-kondo/issues/1521 (https://github.com/ericdallo) • Stabilize cache version independent from kondo version https://github.com/clj-kondo/clj-kondo/issues/1520. This allows you to re-use the cache over multiple kondo versions. • :output {:progress true} should print to stderr https://github.com/clj-kondo/clj-kondo/issues/1523 • Only print informative messages when `--debug` is enabled. https://github.com/clj-kondo/clj-kondo/issues/1514 • Add Sublime Text instructions https://github.com/clj-kondo/clj-kondo/issues/827 (https://github.com/KyleErhabor) • Fix end location in anonyous function body https://github.com/clj-kondo/clj-kondo/issues/1533 • Bump datalog-parser to 0.1.9: allows symbol constants in datalog expression

🎉 22
clj-kondo 10
ericdallo16:01:11

Already bumped clojure-lsp, should be available on next release!

👍 2
kipz18:01:25

Just released 0.0.1 of debian-version-clj - parser for debian-version strings https://github.com/kipz/deb-version-clj because I couldn't find any that worked for the JVM

📦 7
👍 2
🚀 2
borkdude18:01:18

Cool! Are you also aware of version-clj? https://github.com/xsc/version-clj

user=> (require '[version-clj.core])
nil
user=> (version-clj.core/parse "6.0-4.el6.x86_64")
{:version [(6 (0 4) ("el" 6) ("x" 86 "_" 64))], :qualifiers #{}, :snapshot? false, :qualified? false}

kipz18:01:14

Yeah, I saw that. You thinking there may be some way to integrate? The debian version scheme is pretty funky, so nobody would want to use it by default I would have thought - but we could come up with some way to choose the scheme I guess.

borkdude19:01:04

cool make sense!

Alex Miller (Clojure team)21:01:33

Clojure https://clojure.org/releases/devchangelog#v1.11.0-alpha4 is now available • https://clojure.atlassian.net/browse/CLJ-2673 Add abs, and update min and max to use Math impls when possible • https://clojure.atlassian.net/browse/CLJ-2555 Add iteration generator function • https://clojure.atlassian.net/browse/CLJ-2621 Fix unnecessary boxing of unused return in statement context for instance method expr • https://clojure.atlassian.net/browse/CLJ-2663 Fix vector = not terminating when called with infinite sequence • https://clojure.atlassian.net/browse/CLJ-2679 Fix hash collisions in case expressions on symbols • https://clojure.atlassian.net/browse/CLJ-2670 Use Math.exact…​ methods for checked long math ops for performance • https://clojure.atlassian.net/browse/CLJ-2680 Fix type hinting a primitive local with matching type hint to not error • https://clojure.atlassian.net/browse/CLJ-2234 Fix multimethod preferences using only global hierarchy • https://clojure.atlassian.net/browse/CLJ-2556 Fix into completion so halt-when works • https://clojure.atlassian.net/browse/CLJ-2665 Fix require with :as and :as-alias to load • https://clojure.atlassian.net/browse/CLJ-2677 clojure.math - fix method reflection in bodies and inlines, fix docstrings, renamed • https://clojure.atlassian.net/browse/CLJ-1379 clojure.test - fix quoting of :actual form in :pass maps • https://clojure.atlassian.net/browse/CLJ-2493 clojure.java.browse - fix browse-url hanging on call to xdg-open • https://clojure.atlassian.net/browse/CLJ-2611 clojure.xml - Stop processing XXE expansions by default • https://clojure.atlassian.net/browse/CLJ-2684 Update contrib deps to latest (spec.alpha, test.check, test.generative) We rely on the community's help in testing new alphas. If you do test your codebase with 1.11.0-alpha4, and can leave a or ::x: (hopefully with more info in the thread), that would be super useful.

🎉 57
🚀 12
8
clojure-spin 5
catjam 1
1
bmo 1
1
seancorfield23:01:13

So far I've opened issues against three libraries that define their own abs function now that clojure.core/abs exists and causes a warning.

Alex Miller (Clojure team)23:01:17

yeah, that's inevitable (I updated test.check and math.numeric-tower)

seancorfield23:01:20

In case anyone is interested, those three (so far) are: clojure.java-time, medley, and zprint.

Alex Miller (Clojure team)23:01:59

the new abs in core is for real better in multiple ways (perf - reaches jvm hotspot intrinsics, polymorphism over all numeric types, portable when impl'ed in cljs)

2
1
👍 1
seancorfield23:01:21

I updated the example in https://clojuredocs.org/clojure.core/halt-when to note that it works with into in Alpha 4.

Alex Miller (Clojure team)00:01:41

the master api docs have been updated at https://clojure.github.io/clojure/branch-master/index.html if that's useful to anyone, new stuff in alpha4: • https://clojure.github.io/clojure/branch-master/index.html#clojure.math namespace - many new fns • https://clojure.github.io/clojure/branch-master/clojure.core-api.html#clojure.core/abshttps://clojure.github.io/clojure/branch-master/clojure.core-api.html#clojure.core/iteration - more docs to come on this (and core.async variant) • https://clojure.github.io/clojure/branch-master/clojure.java.shell-api.html#clojure.java.shell/launch (added for the browse-url fix) • https://clojure.github.io/clojure/branch-master/clojure.xml-api.html namespace has some new stuff but really it's all there to give you options to fall back to prior behavior for XXE if you really need it (but it's a security issue and you probably don't)

seancorfield00:01:29

Our test suite passes without any issues on Alpha 4. It'll be up on our staging cluster soon for additional testing.

phill00:01:06

The new safeguard related to XML external entities is a breaking change! It will especially affect document-preparation apps dating from before the xlink era. Therefore, in the formal announcement, a nice prominent notice would be thoughtful.

Alex Miller (Clojure team)01:01:01

This is just an alpha, there will be a release notes by the time we get to the RCs with more stuff like this

pez06:01:48

@UKC33JMU3 does this fix your issue with the ClojureScript repl start on Linux?

borkdude08:01:25

Looking forward to some examples of iteration

🚅 3
brendnz09:01:02

@U0ETXRFEW, afraid not; I still have to use the custom connect sequence, but at least that still works.

1
Lukas Domagala11:01:13

all the tracing and introspection in omni-trace still works.

imre14:01:18

Nice one on all the reflection stuff, thank you Alex!

2
seancorfield20:01:32

We have 1.11 Alpha 4 in production for two of our apps and several of our cron job processes.

🎉 1
brendnz09:01:12

@U0ETXRFEW, it appears the best advice for Calva learners on Linux systems is to have the browser already open before using "fire up the ClojureScript Quick Start Browser REPL". My custom connect sequence, I have since learnt, is necessary for me only if my browser is not already open. I tested the "browser-already-open" scenario today after reading Andy Fingerhut's September 2, 2019 (https://clojure.atlassian.net/browse/CLJ-2493) post:

"I found that if you start [a browser], e.g., then start a Clojure REPL and eval a browse-url expression, the REPL prompt comes back quickly, as expected. Similarly if you start a Clojure REPL, then [a browser], then eval the browse-url expression.

The only case in which the eval of a browse-url expression does not quickly come back with a prompt is if [the browser] was not yet started, and eval'ing browse-url caused it to start."
You asked if 1.11.0-alpha4 helped me open the ClojureScript REPL, and my test showed it did not. I now know why you thought it might. It fixes "clojure.java.browse/browse-url hangs calling xdg-open", as @U064X3EF3, @U050ECB92, and @U050WRF8X mention in their video of today at https://www.youtube.com/watch?v=6vmTKoPzJUo&amp;t=5184s . Apparently, it has always worked if the browser is already open! Unless it was opened by a prior jack-in, as a new jack-in closes such an already open browser in my experiment; but not an independently opened browser. It takes 8 seconds on my machine for the browser page to load after the clj prompt appears in output.calvap-repl pane and then another 4 seconds for the cljs prompt to appear. So it takes 12 seconds to be sure the jack-in has not failed. @U04V70XH6 and @U0ETXRFEW , Alex thinks its "a weird little rabbit hole that most people never look at, never worry about, never think about", except us. Rounding to the nearest 10%, I think half the people use Clojure on Apple machines and half use it on Linux machines. I would have thought more Linux users would notice, if it were not for the fact they have their browsers already open nearly all the time. Sean, does 1.11.0-alpha4 fix it for you? Technically it does not fix it for me. Practically it does and I am very happy with the whole exercise. I just have to have my browser already open or use my custom connect sequence. Alex says "We rely on the community's help in testing new alphas. If you do test your codebase with 1.11.0-alpha4, and can leave a [tick]  or [cross] : (hopefully with more info in the thread), that would be super useful".   I am happy with attempted fix and want to leave a tick, but of course I need to leave a cross, as CLJ 2493 does not totally fix it for me, assuming my problem is actually the same problem. My system is Ubuntu 20.4 running in WSL2.

1
pez11:01:01

@UKC33JMU3 iiuc, the check/cross is rather about wether this build breaks something that previously worked or if some particular fix does not do what it states to do. There is probably an issue tracking the problem you hit (manifesting in problems with the ClojureScript Quick Start on Linux). To me it was just the long shot of an optimist that it was fixed with this alpha.

Alex Miller (Clojure team)14:01:29

@UKC33JMU3 do you have a link to your issue?

seancorfield21:01:09

I can confirm that on Windows/WSL2/Ubuntu with google-chrome not open, the following command still hangs and does not show a prompt, even though the browser opens and shows the cljs welcome page:

$ clj -Sforce -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "RELEASE"}}}' -M:1.11 -m cljs.main -r
(the :1.11 alias brings in Clojure 1.11.0 Alpha 4). As @UKC33JMU3 observes, if you open google-chrome first, it works. It also works if you specify {:launch-browser false} in the REPL options, and then start the browser manually at the given URL (http://localhost:9000) per the caveat in the Quick Start. I don't know if there's an issue for this specific case (but having the browser open is likely to be common for Linux users in general I suspect -- but less common for WSL2 users (5% of Clojurians, according to the last State of Clojure survey).

phill22:01:20

Hi all, the new clojure.java.shell/launch function deadlocks if the launched process writes to stderr or stdout beyond the OS' puny buffer. This is described in the Javadoc at https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Process.html, "Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the process may cause the process to block, or even deadlock." A workaround is to use ProcessBuilder, and .redirectError and .redirectOutput to java.lang.ProcessBuilder$Redirect/DISCARD before calling start.

borkdude22:01:09

Or use Inherit, depending on if you actually want to see the output or not.

🙂 1
borkdude22:01:33

I think this might also be a problem in tools.build process.

brendnz22:01:56

Hi @U064X3EF3, it has just been discussions with @U0ETXRFEW and @U04V70XH6. The following thread has a screenshot of what happened on my system. I was going to add screenshots from a discussion with Sean Corfield, but he has written a much better summary as I write this reply. The post at https://clojurians.slack.com/archives/CBE668G4R/p1641774856063000 shows the point at which :launch-browser can be set to false in Calva, and Sean (prior post) and the Quick Start page (below) shows where it can be set to false in the command line. I was going to suggest do you not think the solution is for the ClojureScript Quick Start page (https://clojurescript.org/guides/quick-start) to insert: "starting your browser first or" … where it says:

If you are running Linux and the REPL does not start, try [starting your browser first or] disabling browser auto-launch and opening  manually:
clj -M --main cljs.main --repl-opts "{:launch-browser false}" --compile hello-world.core --repl
  But we can take it from Sean's post that at least 5% of all new Clojurians will be hit by this problem, and I wonder if that would be insufficient. Just as I am about to post this, I see a couple of interesting posts just added by @U0HG4EHMH and @U04V15CAJ so far above my pay-grade I can only guess they contain possible solutions.

brendnz05:01:07

Hi @U0HG4EHMH and @U04V15CAJ, what you say and refer to is interesting and no doubt spot on. Fancy the robustness of the system (Java processes communicating on Linux) being so fragile and dependent on contingent facts such as whether buffers are not cleared quick enough.

Ivar Refsdal10:01:47

Re https://clojure.atlassian.net/browse/CLJ-2555 Add iteration generator function I've given this a spin, and find it to be working fine. Here is a https://gist.github.com/ivarref/41d4914b1ec3936ad83e0ed9a9c8517d demonstrating iteration over a https://relay.dev/graphql/connections.htm. The only thing I did not feel was quite "natural" was the need for mapcat identity. For my typical usage I would iterate over a single list/seq, not over pages and then over the page list. Should there be a iteration-cat version, or perhaps a :vcatf function? CC @U050ECB92 @U04V15CAJ

borkdude10:01:57

I'm not an expert by any means on this topic, but I wonder if @U050ECB92 has seen this article which highlights some potential problems with iteration . Just sharing it in case he hasn't seen it. https://github.com/leonoel/missionary/wiki/Iterative-queries

👍 1
borkdude10:01:07

@UGJE0MM0W Example looks neat! Looks like a great fit for your use case.

❤️ 1
imre10:01:33

Interesting links. What I don't really get in the one @U04V15CAJ linked is this statement: IReduceInit doesn't have these problems, but is not composable either (not in practice, at least). Why would IReduceInit not be composable?

ghadi16:01:39

@UGJE0MM0W we have considered the catting aspect, in fact the core.async version has an arg :vsf (instead of :vf )

ghadi16:01:38

(into [] cat (iteration step :vf ....) is a nice way to do that too. (Beware of side-effects + lazy-seq!)

seancorfield20:02:05

Just FYI, as a follow-up to my January 14th message above, we now have Clojure 1.11.0 Alpha 4 in production for all processes 🎉