Fork me on GitHub
#malli
<
2020-10-11
>
ikitommi11:10:29

merged, thanks!

ikitommi12:10:35

would like to make sci explicitly optional. either via a flag (non-breaking) or via explicit option (breaking, but for the better): https://github.com/metosin/malli/issues/276. Two days ago would have just done the latter, but now malli is released and goal has been not to break things. What do you think? save the breaking change for 1.0.0? just do it? something else?

borkdude12:10:29

@ikitommi Maybe sci could be one of many possible evaluators?

steveb8n02:10:27

I think a breaking change for the 1.0 release is ok. We know you plan to accrete only from 1.0

steveb8n02:10:03

optional sci is great for the browser use case. making that the default is a good idea imho

steveb8n02:10:16

I’m gonna use it server side also

ikitommi05:10:15

good reason not yet to read sci-powered schemas from untrusted sources: https://github.com/borkdude/sci/issues/348

ikitommi05:10:47

that's now linked in Malli Readme.

borkdude12:10:37

like clojure.core/eval is another one

borkdude12:10:44

and maybe the user should specify that

borkdude12:10:09

breaking would be ok I think

3
👍 3
borkdude12:10:15

since the project is explicitly alpha

ikitommi12:10:21

yes, the option1 would allow that:

(require '[malli.sci :as ms])
(require '[malli.core :as m])

(def options
  {:evaluator (ms/evaluator)
   :registry (ms/default-registry)})

(def Schema (m/schema [:fn '(fn [x] (string? x))] options))

(m/validate Schema "kikka")
; => true

ikitommi12:10:17

.. would also remove need of :preloads etc, as you actually need to require the code to make it work.

borkdude12:10:51

I think that's reasonable as long as it's documented well

borkdude12:10:07

and keep a list of breaking changes in CHANGELOG.md

borkdude12:10:03

malli.sci would still require sci for you right. so then there's no need for preloads

ikitommi12:10:07

also, currently you can swap the default registry using the JVM/clj-compiler options, but not the default options. if you want to enable sci globally, that should be changed to swap the default options. I did a spike on that, but had too much open issues to think that through. Now, it seems like it would have been a right call.

ikitommi12:10:06

that would be big breaking change, but something that could be documented and migrated easily too.

ikitommi12:10:36

maybe all roads lead for quick 1.0.0 🙂

ikitommi12:10:29

thanks for you thoughts on this.

motform14:10:34

Hi! does anyone have any experience using malli to validate/define the re-frame app-db?

steveb8n22:10:18

works great. have not moved the app-db level validations from spec to Malli yet but I certainly plan to do so