Fork me on GitHub
#malli
<
2020-06-20
>
dcj19:06:16

A month or so ago I used Malli for a project, and with recent changes to Malli, my code broke:

(def predicate-registry
  (-> m/predicate-registry
      (-register-var #'zoned-date-time?)
      (-register-var #'local-date?)))


(def registry
  (merge predicate-registry m/class-registry m/comparator-registry m/base-registry))
So now the -registry is -schemas, but then my -register-var calls fail. I'll keep working on this, but any ideas?

dcj20:06:54

OK, this worked:

(def registry
  (merge (m/predicate-schemas)
         (m/class-schemas)
         (m/comparator-schemas)
         (m/base-schemas)
         {:zoned-date-time (m/fn-schema :zoned-date-time #'zoned-date-time?)
          :local-date      (m/fn-schema :local-date      #'local-date?)}))
And then I changed my schema references from zoned-date-time? to :zoned-date-time, etc, and also changed the associated transformer encoder/decoder names

ikitommi20:06:37

@dcj we are doing final code polishing to get the non-pre-aloha out. The breaking changes are listed in https://github.com/metosin/malli/blob/master/CHANGELOG.md#unreleased. Also, if you are using custom schemas, you should read https://github.com/metosin/malli/blob/master/README.md#schema-registry. Lot of options, and supports properly dce on cljs now

👍 9