This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-28
Channels
- # announcements (14)
- # autochrome-github (1)
- # babashka (4)
- # beginners (151)
- # biff (1)
- # calva (24)
- # cider (13)
- # clara (13)
- # clj-commons (1)
- # cljs-dev (24)
- # clojure (50)
- # clojure-europe (20)
- # clojure-france (13)
- # clojure-nl (4)
- # clojure-norway (12)
- # clojure-spec (43)
- # clojure-uk (6)
- # clojurescript (30)
- # cursive (2)
- # datahike (9)
- # editors (6)
- # emacs (2)
- # fulcro (29)
- # google-cloud (20)
- # graphql (2)
- # humbleui (2)
- # jobs (2)
- # juxt (4)
- # kaocha (5)
- # lsp (14)
- # malli (5)
- # membrane (10)
- # off-topic (39)
- # pathom (21)
- # polylith (10)
- # rdf (8)
- # reagent (4)
- # remote-jobs (3)
- # reveal (18)
- # shadow-cljs (27)
- # spacemacs (7)
- # tools-deps (30)
I find that sometimes if I tap a very large map, the Reveal window goes completely white and becomes unresponsive (i.e. doesn't show subsequent taps). I use the nrepl middleware as described https://vlaaad.github.io/reveal/#nrepl-based-editors. It seems the only way to fix it once it happens is to restart my JVM. Is this a known issue, and is there some better way to restart Reveal other than rebooting the JVM?
Reveal is optimized for streaming big data structures though, I tried to make that part as fast and nonblocking as possible
Also is it possible that the data structure has self references? E.g. an atom that holds the reference to itself...
The last time it happened to me I tapped an XTDB node. I don't know the internals well enough to say whether it has self references. I also don't think it happens every single time. Is there some Reveal debugging log I can access to get an idea of what's happening?
Is there a way to reboot without rebooting the JVM? It would help me try to find a reproducible demo.
I see that xtdb itself prints xtdb nodes without any internals:
(defmethod print-method XtdbNode [_node ^Writer w] (.write w "#<XtdbNode>"))
maybe you could try the same? e.g.
(r/defstream XtdbNode [node]
(r/raw-string "XtdbNode" {:fill :object}))
Indeed, that is the usual representation when you print, but sometimes tapping it and looking at the keys is helpful for debugging. I also don't think this has been isolated to XTDB for me... it comes up during the course of debugging different once in a while.
I didn't see any exceptions pop up last time it happened, but I'll keep an eye out for that.
Thanks @U47G49KHQ. I'll look at making a list of items in my project that should get different printing to try to avoid this.
@U47G49KHQ I got around to setting up some streaming functions in my project today as you suggested. It's a great solution to the issue I was having and I'm looking forward to exploring other ways to customize and extend Reveal for my workflow as I get more familiar with the tool. Thanks again for the help! Just one more quick question about that. I put the defstream definition in my user namespace so it gets loaded when I start the REPL. Is that a reasonable place to put the customizations? Apologies if I missed it in the docs.