This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Hi! I just ran into this error message:
Clerk can only sync values which can be round-tripped in EDN.
Has anyone written a function to strip values that can’t be round-tripped? Does Clerk provide something?Right now I do this:
^{::clerk/sync true}
(defonce last-tapped (atom nil))
(comment
(tap> (rand))
@last-tapped
)
(defn store-tapped [val]
(reset! last-tapped (with-out-str (pprint val))))
(add-tap #'store-tapped)
{:nextjournal.clerk/visibility {:code :show :result :show}}
@last-tapped
But it’s not ideal because I can’t use Clerk’s object browser on the tapped values (incoming http requests in my case).You could look at clerks built-in tap inspector for reference. Also curious what made you write your own.
> not a direct answer but maybe you can avoid using a sync atom for this use case?
Originally, I had trouble getting the web browser showing Clerk to update immediately. Though I can’t reproduce the issue now. I’ve also upgraded from {:mvn/version "0.13.842"}
to {:mvn/version "0.14.919"}
since. Deleted ::clerk/watch true
now, thanks!
Not sure how to use the tap viewer. I found https://github.com/nextjournal/clerk/tree/90ec95dadc48a6d53e1156fc7e4fb2b6959f1c9b/src/nextjournal/clerk/tap.clj, but I’m not sure what to do. Are there docs for it somewhere? I can’t find it mentioned in the book.
> Not sure how to use the tap viewer. I found https://github.com/nextjournal/clerk/tree/90ec95dadc48a6d53e1156fc7e4fb2b6959f1c9b/src/nextjournal/clerk/tap.clj, but I’m not sure what to do. Are there docs for it somewhere? I can’t find it mentioned in the book. Found it:
(nextjournal.clerk/show! 'nextjournal.clerk.tap)
https://github.com/nextjournal/clerk/blob/90ec95dadc48a6d53e1156fc7e4fb2b6959f1c9b/book.clj#L914-L926. Looks like this hasn’t been pushed to book.clerk.vision yet.A thought about the tap viewer:
When tap>
-ing request maps, I find myself expanding the view and asking for 8 more…
values every time. If I had buttons for “always expand tap object browser” and “increase object browser budget”, I’d click them.
Right now, my http tap> worflow is something like:
1. refresh web browser previewing the html I’m making
2. press >
button to expand view in clerk
3. click 8 more…
4. clerk tap> object browser collapses
5. i press >
again
6. … then I can see the full value.
I’d prefer less steps!
and for your other points: not remembering the expansion state is a bug, issue welcome
you could also turn off elisions for maps, either globally or for the tap inspector ns only. Let me know if you need help here and I can come up with a snippet later
there’s also the auto-expand-results? option but I’m not sure right now if it can be set for the tap inspector already. Also something we’d want to fix if not.
> you could also turn off elisions for maps, either globally or for the tap inspector ns only. Let me know if you need help here and I can come up with a snippet later
Is that with ::clerk/budget nil
? I’ve set it to nil
, but I still get some …
s, see attached image.
If I’m doing it wrong, I’d love a snippet!
> and for your other points: not remembering the expansion state is a bug, issue welcome I’ll make an issue 👍 Issue: https://github.com/nextjournal/clerk/issues/543