Fork me on GitHub
#malli
<
2019-12-13
>
Johan04:12:17

Can a defined transformer access the schema ? So given [:map [:key {:option :cool} keyword?]] Can a transformer access the [:key {:option :cool} keyword?]] data ?

ikitommi06:12:49

@johan178 yes, the current transformer is of type schema opts => value => value, so:

[:map {:decode/string (fn [schema opts] 
                        (let [cool (:option (m/properties schema))]
                          (fn [value] …)))}]

ikitommi06:12:51

the syntax will change before hitting first public to:

[:map {:decode/string {:compile (fn [schema opts] 
                                  (let [cool (:option (m/properties schema))]
                                    (fn [value] …)))}}]

rschmukler16:12:00

@ikitommi Thanks for the quick PR review! Would you be open to me adding .nrepl-port and .dir-locals.el to gitignore? Alternatively if you want me to commit a .`dir-locals.el` it would make it so that new people contributing would automatically adhere to your style preferences

ikitommi16:12:43

@rschmukler sure, go ahead, either way

eskos17:12:49

.dir-locals.el is only relevant to cider users, so I wouldn't commit them. In general tooling/IDE config files shouldn't live in source repos 😛

rschmukler17:12:33

.dir-locals.el is relevant to all emacs users

rschmukler17:12:57

But I'm happy to not commit it - just could save PR time of people having to adjust their formatting to the project style

ikitommi18:12:08

agree on Esko for now, so let’s ignore the files.

ikitommi18:12:00

Congratz on Aave!! I’ll add it to README as soon as the PRs are merged (just did the interceptor :compile, will merge it after yours @rschmukler).

rschmukler18:12:29

Woo! Thanks! Love the momentum we've got going on!

rschmukler18:12:26

@ikitommi What're your thoughts for potentially adding support for a dynamic variable for either full on malli options, or perhaps something like *registry-extensions* which is usually nil but is automatically merged into default-registry when set. I sometimes find myself having to thread malli options through things, or wrapping malli functions with my own namespace with a custom registry, etc. Since it's mostly for compile-time code anyway, the performance implications shouldn't matter much. Part of me feels like it might be too "magical" but the other part makes me feel like it could improve ergonomics

ikitommi18:12:25

need to think about that.

ikitommi18:12:37

@rschmukler do you have plan to fix the 142? (the is the x bug IMO + the formatting)

rschmukler18:12:08

I think I already did no?

rschmukler18:12:20

I force pushed updates an hour or two ago

rschmukler18:12:12

Let me know if it needs anything. The x bug wasn’t caught by tests because map-of tests were disabled so I also fixed those

ikitommi18:12:48

oh, the review panel just doesn’t show the updated. my bad. will merge.

rschmukler18:12:08

Yep, will take a look now

rschmukler18:12:08

Looks good! Sorry I missed some indents

ikitommi19:12:18

np, off to weekend. cheers.