This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-06
Channels
- # aws-lambda (6)
- # babashka (1)
- # beginners (204)
- # calva (10)
- # chlorine-clover (17)
- # cider (57)
- # cljs-dev (3)
- # cljsrn (3)
- # clojure (148)
- # clojure-bangladesh (1)
- # clojure-berlin (3)
- # clojure-europe (30)
- # clojure-france (1)
- # clojure-italy (4)
- # clojure-nl (5)
- # clojure-spec (4)
- # clojure-uk (14)
- # clojurescript (15)
- # code-reviews (8)
- # conjure (27)
- # data-science (9)
- # datomic (38)
- # duct (6)
- # figwheel-main (11)
- # fulcro (78)
- # helix (11)
- # jobs (1)
- # malli (18)
- # meander (22)
- # mount (4)
- # nrepl (3)
- # off-topic (93)
- # pathom (2)
- # pedestal (4)
- # re-frame (5)
- # reagent (6)
- # reitit (1)
- # ring-swagger (1)
- # sci (1)
- # shadow-cljs (19)
- # spacemacs (1)
- # sql (1)
- # tools-deps (76)
- # unrepl (1)
- # vim (5)
- # xtdb (8)
Q: I’m starting with Malli in my re-frame client/forms. just checking to see if there’s any gotchas/advice from the team here?
It depends how you use Malli .. validation and coercion?
just validation for now. keeping it simple to start. schemas hardcoded in client code. later I intend to send schemas over the wire from the server
I’m using it as a validator for https://github.com/luciodale/fork in this iteration. thus no coercion since the form inputs will constrain the values
only notice is the bundle size, few hours away from making sci optional. Before that, the bundle is 200+kb. After, it's 1-12kb gzipped.
oh, and you should create validators ahead of time, running m/validate
can be orders of magnitude slower than just calling the returned function from m/validator
.
same applies to m/explain
vs m/explainer
and to m/decode
& m/decoder
(and encoders, generators etc)
fork-malli-example would be great gist/blog. Tried the first version of it, but was stumbling with nested data and for that case, did my own formik-kinda-thing for that project.
Hey, is it possible to generate only alpha-numeric values with the :string
type? Currently it will go wild and generate whatever it wants (which makes sense)
@kevin.van.rooijen you can use :gen/gen
to override the generator, there is one for alphanumeric. Or use :gen/elements
and list all valid in there.
I think :string
could have format option too, like in JSON Schema. But doesn't have that yet. One format could be :alphanumeric
, validator and generator would follow that...