Fork me on GitHub
#malli
<
2022-01-22
>
jkrasnay02:01:19

Is there a way to get function instrumentation working in CLJS? There seems to be some stuff in malli.instrument.cljs but my CLJS build complains that that ns is not available.

ikitommi07:01:28

Haven’t used that myself, but the tests pass. Are you depending on the latest version from master? It’s not released yet

jkrasnay15:01:34

Oh, I was on 0.7.5. Thanks!

dvingo20:01:33

@U0DTSCAUU feel free to ping me if you run into any issues!

ikitommi07:01:51

added .pretty/explain

🥳 5
ikitommi11:01:28

from cursive

ikitommi11:01:39

pushed all current stuff for leiningen users as`[metosin/malli "0.8.0-SNAPSHOT"]`

Karol Wójcik13:01:44

@ikitommi FYI: The CLJ Kondo config has unbalanced bracket 🧵

ikitommi14:01:51

Thanks! Merged

jkrasnay15:01:56

I’m having a problem with instrumenting my functions. I define a function in namespace A and register it with Malli as follows:

(m/=> selectable-label [:=> [:cat [:map
                                   [:build map?]
                                   [:selectable-id id/SelectableId]]]
                        locale/LocalizableString])
Then in namespace B I call
(mi/instrument!)
This triggers errors when compiling namespace B that namespaces id and locale are not found. These are aliases from the :require block in namespace A. Is there any way around this?

jkrasnay15:01:33

BTW namespace A is cljc while namespace B is cljs.

jkrasnay15:01:57

It works if I fully qualify id and locale.

jkrasnay16:01:06

I think this may be one of those subtle things about CLJS macros, where we can’t qualify the namespace since the macro is running in CLJ.

Игорь Лисовцов16:01:55

Hi there guys. I'm new to clojure and especially to malli. So, I'm playing around repl and malli, and notices that below example from the documentation doesn't work

(m/decode
  [string? {:decode {:string 'str/upper-case}}]
  "kerran" mt/string-transformer)
; => "KERRAN"
and instead of "KERRAN" it returns "kerran". Func at the place {:string func simply not called. Did I do something wrong?

ikitommi17:01:08

The docs for this part are ahead of the release, plan is to release 0.8.0 n the next few days. If you know how to depend on the latest commit of malli, you can test that too.

Игорь Лисовцов17:01:26

Got it. Thank you a lot!