Fork me on GitHub

Is there any example that uses malli to validate html forms on the frontend side?

Alexis Schad15:05:05

Hi there, is there a minimal sample project using Malli instrumentation (during dev) in a shadow-cljs webapp? Or is there a recommended configuration for in cljs? I'm struggling a bit to setup it well. -> thread for more info

Alexis Schad15:05:19

With a basic configuration I got:

Alexis Schad15:05:53

with thrower i got:


the implementation of that is under active development - if you can use the latest git commit you'll have better errors


this thread has some background, I suggest adding this metadata to your entry ns:

Alexis Schad15:05:30

> you'll have better errors The error seems pretty good rn, it's just a problem of formatting them inside the console/devtools I'm looking for your link to see if it can improve something

Alexis Schad15:05:57

With the master version of pretty/reporter, there's a reader conditional for cljs and it now prints well, thanks! I'll see if I have hot reload issue like your link


nice! yea it's tricky because instrument outputs code where it is called that overwrites the fn - so if you're iterating on the implementation of the the fn in a separate namespace they can get out of sync

Alexis Schad15:05:46

I was using dev/start! but I had to use instrument! instead. I think I don't need the {:dev/always true} metadata, it seems to just work fine without it (I call instrument! every time the app is hot reloaded).


You'll run into staleness issues described in the ticket without reloading the ns where instrument is called


if you macroexpand the intstrument call it can help understand why that happens

Alexis Schad16:05:58

I tried to update both the function and the spec and it seems to work well


nice! well alright then lol

Alexis Schad20:05:21

I didn't even thank you… so thanks!


for sure! no prob - thanks for trying it out! the leverage from malli is pretty remarkable, just helping to add to that power 🙂

💪 1
Alexis Schad00:05:46

I think I've just had some issues that has been solved with {:dev/always true} Reloading the webapp was doing nothing, I had to restart my shadow-cljs watch. And with the workaround above it seems to work.