malli

https://github.com/metosin/malli :malli:
Lucy Wang 2020-10-11T10:21:44.101300Z

Fixed a bunch of typos https://github.com/metosin/malli/pull/275

ikitommi 2020-10-11T11:00:29.101700Z

merged, thanks!

ikitommi 2020-10-11T12:10:35.104700Z

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?

borkdude 2020-10-11T12:13:29.105400Z

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

borkdude 2020-10-11T12:13:37.105600Z

like clojure.core/eval is another one

borkdude 2020-10-11T12:13:44.105900Z

and maybe the user should specify that

borkdude 2020-10-11T12:14:09.106300Z

breaking would be ok I think

šŸ‘ 1
1
borkdude 2020-10-11T12:14:15.106600Z

since the project is explicitly alpha

ikitommi 2020-10-11T12:14:21.106700Z

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

ikitommi 2020-10-11T12:15:17.107700Z

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

borkdude 2020-10-11T12:15:51.108200Z

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

borkdude 2020-10-11T12:16:07.108500Z

and keep a list of breaking changes in CHANGELOG.md

borkdude 2020-10-11T12:18:03.109900Z

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

ikitommi 2020-10-11T12:19:07.111100Z

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.

ikitommi 2020-10-11T12:19:49.111300Z

https://github.com/metosin/malli/pull/235

ikitommi 2020-10-11T12:21:06.112300Z

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

ikitommi 2020-10-11T12:21:36.112600Z

maybe all roads lead for quick 1.0.0 šŸ™‚

ikitommi 2020-10-11T12:22:29.113Z

thanks for you thoughts on this.

motform 2020-10-11T14:00:34.113900Z

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

steveb8n 2020-10-11T22:13:43.114800Z

@love.lagerkvist Iā€™m doing this for forms currently https://github.com/stevebuik/fork-malli-ideas

steveb8n 2020-10-11T22:14:18.115600Z

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