malli

Quentin Le Guennec 2024-12-11T10:34:36.964549Z

Hi, in CLJS, nothing happens when I run this:

(defn foo
  {:malli/schema [:=> :int :int]}
  [x]
  (inc x))

(foo :a)
Shouldn’t there be an error printed in the js console ? Is there a special setup to enable :malli/schema ? Edit: that’s describe in the docs here https://github.com/metosin/malli/blob/master/docs/function-schemas.md

opqdonut 2024-12-11T10:48:03.253509Z

you're looking for instrumentation

Quentin Le Guennec 2024-12-11T10:55:32.028459Z

It seems like (mi/collect) always return an empty set.

opqdonut 2024-12-11T10:56:06.080149Z

unfortunately I haven't used instrumentation on the cljs side so I can't help you

Quentin Le Guennec 2024-12-11T11:06:33.401639Z

I get this error in clojurescript when I bump the malli version from 0.14.0 to 0.17.0:

[:app] Configuring build.
[:app] Compiling ...
[:app] Build failure:
The required namespace "clojure.math" is not available, it was required by "malli/transform.cljc".
deps:
:deps      org.clojure/clojure               {:mvn/version "1.10.1"}
             org.clojure/clojurescript         {:mvn/version "1.11.4"}

opqdonut 2024-12-11T11:19:29.904839Z

looking at the cljs changelog, clojure.math only gets introduced in 1.11.51

opqdonut 2024-12-11T11:20:18.754609Z

and in clojure 1.11

opqdonut 2024-12-11T11:20:25.194939Z

malli requires clojure 1.11

opqdonut 2024-12-11T11:22:27.966189Z

I'll add a note to the README about cljs 1.11.51

opqdonut 2024-12-11T11:47:10.425449Z

sorry about the confusion 🙂

opqdonut 2024-12-11T11:47:13.755029Z

readme now updated