malli

https://github.com/metosin/malli :malli:
pithyless 2021-04-28T11:39:52.034800Z

I’m reworking some error handling - especially dev vs prod. What’s the story with virhe? Is there a version of that coming soon? Or perhaps even some reflections and retrospectives that we could apply to our own work?

ikitommi 2021-04-28T16:57:39.040Z

@pithyless there is a unpublished copy of reitit-error-pretty-printer in malli. should extract the common parts of malli + reitit and push out to virhe. to be honest, might be better if virhe was a community owned clj-commons library, not ours. there would be a lot to do with colors, themes, cljs-support etc, which needs work, which needs time, which we don’t have that much extra. happy to contribute code, ideas and requirements to that. For now: just copy the existing reitit thing if you want the looks.

ikitommi 2021-04-28T16:58:31.041Z

I’ll write the ideas and lessons learned to virhe README, soon. Might have time to push out first version before summer vacations.

🙏 1
ikitommi 2021-04-28T17:01:24.043800Z

🥳 pushed just out [metosin/malli "0.5.0"] - small fixes & improvements and the ability to describe Malli Schema Syntaxes with Malli. Small breaking changes for library extenders, more info in the CHANGELOG: https://github.com/metosin/malli/blob/master/CHANGELOG.md#050-2021-04-28

1
🤘 2
🎉 1
pithyless 2021-04-28T17:16:36.044200Z

are you referring to this? https://github.com/metosin/reitit/blob/master/modules/reitit-dev/src/reitit/dev/pretty.cljc It'd be great to read about the ideas and lessons learned on the virhe README if you find some free time to catch your breath. Either way, thanks for all the ceaseless work and FOSS publishing! 🙂

👍 1
eoliphant 2021-04-28T21:29:49.047600Z

Hi, dunno if I’m doing something wrong, but I’m having issues with local/custom registries and qualified keyword entries. Validation works fine, but getting properties, the original form back, etc don’t seem to work

(def registry*
  (merge
    (m/default-schemas)
    {:testfoo [:string {:a :b}]
     :test/bar [:string {:c :d}]
     ::testbaz [:string {:a :b}]}))
(m/properties :testfoo {:registry registry*})
; => {:a :b}
(m/properties ::testbaz {:registry registry*})
; => nil