reveal

Docs: https://vlaaad.github.io/reveal/ Source: https://github.com/vlaaad/reveal
kari 2021-01-23T17:08:03.016700Z

Hi! I'm experimenting with Reveal. I'm using Reveal via nREPL (`-m vlaaad.reveal.nrepl/middleware`) and with Cursive, i.e.: โ€ข I start repl using clj (and Reveal window opens) โ€ข I connect Cursive editor to that repl. โ€ข When in the Cursive editor I send some form to repl for evaluation, the result will show both in the Cursive REPL output window and in the Reveal window. I.e.

# Terminal:
clj -M:dev:test:common:backend:reveal:kari -m nrepl.cmdline -m com.gfredericks.debug-repl/wrap-debug-repl -m nrepl.cmdline -m vlaaad.reveal.nrepl/middleware -i -C

# and ~/.clojure/deps.edn:

{
 :aliases {
           :kari  {:extra-paths ["scratch"]
                   :extra-deps {hashp/hashp {:mvn/version "0.2.0"}
                                com.gfredericks/debug-repl {:mvn/version "0.0.11"}
                                djblue/portal {:mvn/version "0.9.0"}}
                  }
           :reveal {:extra-deps {vlaaad/reveal {:mvn/version "1.3.193"}}
                    :ns-default vlaaad.reveal
                    :exec-fn repl}
           }
 }
A couple of questions: 1. Is it possible for Reveal to use the *print-length*, e.g.
(set! *print-length* 10)
  (take 20 (range 100))
=> In Cursive output window I see (0 1 2 3 4 5 6 7 8 9 ...), but in Reveal window all numbers from 0 to 19. 2. If I close the Reveal window in this setup, is it possible to open the Reveal window again so that it connects to this repl without starting the repl again? I have used djblue/portal quite a lot but I'm considering moving to Reveal.

vlaaad 2021-01-23T17:53:02.016900Z

Hi! Re #1: I have respecting *print-length* in my backlog with a low priority.

vlaaad 2021-01-23T17:59:20.017100Z

Re #2: in case of nrepl, Reveal window is per nrepl server, so closing the window will require nrepl server restart to show the window again. I don't know if it's possible to do it in nrepl any other way while running Reveal in the server where Reveal is the most useful. I am using socket REPLs that allow various setups more easily. My current setup in Cursive is: 1. running REPL server that spawns Reveal REPL on every client connection:

clj -A:reveal -X clojure.core.server/start-server :name '"reveal"' :port 5555 :accept vlaaad.reveal/repl :server-daemon false
2. connecting to this REPL server via remote-repl as described here: https://vlaaad.github.io/reveal/#cursive

kari 2021-01-23T18:17:47.017400Z

Ok. Thanks!

dharrigan 2021-01-23T18:57:27.018400Z

I'm trying out reveal with the nrepl middleware. I notice that when I eval a buffer, the entire file is echo'ed to the reveal window. Is it possible to just show the taps only?

dharrigan 2021-01-23T18:57:42.018800Z

(as if it's a huge file, then it fills the window very quickly)

vlaaad 2021-01-23T19:38:32.019Z

@dharrigan if you only want taps, you don't need nrepl middleware, just do (add-tap (vlaaad.reveal/ui))

dharrigan 2021-01-23T20:32:00.019300Z

perfecto, thank you. will try that out ๐Ÿ™‚

Janne Sauvala 2021-01-23T23:09:54.025500Z

Hi ๐Ÿ‘‹:skin-tone-2: Iโ€™m trying to mimic Seanโ€™s Reveal custom view that he showed in his newest RDD-video. I think he does the customisation to the Reveal view here: https://github.com/seancorfield/dot-clojure/blob/4b42fcc0d6ca35ac46762ac94c39f1d49966c8d5/dev.clj#L28. Itโ€™s not working for me out of the box and the reason might be that Iโ€™m using Reveal with Calva (without nrepl-middleware but instead with just tap>). Any tips how to get this working or starting to customise my own default view?

Janne Sauvala 2021-01-23T23:16:48.027200Z

Oh nvm - I got it working. I had to add that function call to inside a tap: (tap> (install-reveal-extras))! :partywombat:

seancorfield 2021-01-23T23:31:39.028Z

@janne.sauvala You're the second person to trip over that -- I'll add a comment to dev.clj that clarifies it needs that call to install it.

seancorfield 2021-01-23T23:36:48.029600Z

Updated: https://github.com/seancorfield/dot-clojure/blob/develop/dev.clj#L28-L41

Janne Sauvala 2021-01-23T23:37:18.030200Z

Great! This view is so good - looks like good old REBL ๐Ÿ™‚

seancorfield 2021-01-23T23:52:24.030600Z

Yup, because I used REBL before Reveal and I miss some of it's stuff ๐Ÿ™‚