reveal

Docs: https://vlaaad.github.io/reveal/ Source: https://github.com/vlaaad/reveal
imre 2021-03-10T14:58:15.043200Z

Given: 1. a remote process without reveal on the classpath (but with the ability to also provide a prepl) 2. an editor that talks to the process in 1. via nrepl Is there a way to launch a reveal window that could receive tap> output from a tap> command sent from 2 to 1?

imre 2021-03-11T14:10:54.047900Z

Finally. I got it working. I had two errors: 1. I originally put to -J-D... arg at the end as opposed to before -M 2. as the target jvm runs inside a docker container, I had to add :address "0.0.0.0" to the prepl config map

1πŸ‘
imre 2021-03-11T14:11:25.048200Z

I also forgot to properly expose the port through docker

vlaaad 2021-03-11T14:11:59.048400Z

If you run docker locally, I think you might even be able to run Reveal inside docker

vlaaad 2021-03-11T14:12:44.048600Z

I don't have any links at hand, but I saw some posts about running desktop ui from within docker..

imre 2021-03-11T14:15:26.048800Z

well, it isn't on the classpath for that process and the jvm there doesn't have fx

imre 2021-03-11T14:15:55.049Z

but working this out basically enables me to use reveal with whatever jvm I have to use in a project

imre 2021-03-11T14:16:12.049200Z

as I can always run it on my dev box where it's available

imre 2021-03-11T14:16:34.049400Z

huge kudos to you for making this available

vlaaad 2021-03-11T14:20:46.049600Z

my pleasure!

vlaaad 2021-03-10T15:42:59.043300Z

Hi! I made a blog post about this setup: https://vlaaad.github.io/reveal-repls-and-networking

vlaaad 2021-03-10T15:43:23.043600Z

ah, sorry, there is nrepl, not a repl…

imre 2021-03-10T15:46:42.043900Z

yeah πŸ™‚

imre 2021-03-10T15:46:59.044100Z

I wish editors would just migrate to prepl already

vlaaad 2021-03-10T15:47:42.044300Z

But I guess, if you connect reveal to a prepl server in a remote VM 1, and then you connect your editor to a nrepl server in remote VM 1, and invoke tap> using nrepl connection, it will be forwarded to reveal since tap is a global queue per VM

imre 2021-03-10T15:51:23.044500Z

I tried that, it didn't seem to work, I probably messed something up

imre 2021-03-10T15:51:46.044700Z

Does the reveal window register itself as a tap when it shows up?

imre 2021-03-10T15:52:08.044900Z

(when started with remote-prepl)

imre 2021-03-10T17:40:43.045100Z

it doesn't seem like it does

vlaaad 2021-03-10T20:39:26.045300Z

I just tried it and it worked...

vlaaad 2021-03-10T20:40:03.045500Z

here is my setup: 1. remote process with prepl server:

clj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"}}}' -J-Dclojure.server.prepl='{:port 7777 :accept <http://clojure.co|clojure.co>
re.server/io-prepl}'

vlaaad 2021-03-10T20:41:38.045900Z

2. reveal connected to remote process:

clj -Sdeps '{:deps {vlaaad/reveal {:mvn/version "1.3.196"}}}' -X vlaaad.reveal/remote-prepl :port 7777

vlaaad 2021-03-10T20:42:29.046100Z

3. using different connection to tap values:

clj -Sdeps '{:deps {vlaaad/remote-repl {:mvn/version "1.1"}}}' -X vlaaad.remote-repl/repl :port 7777
(tap&gt; 1)
{:tag :ret, :val "true", :ns "user", :ms 1, :form "(tap&gt; 1)"}
{:tag :tap, :val "1"}

vlaaad 2021-03-10T20:43:03.046300Z

and when I invoked (tap&gt; 1) , it also appeared in reveal window

vlaaad 2021-03-10T20:43:17.046500Z

does it help?

vlaaad 2021-03-10T20:50:18.046700Z

I think it makes sense, I added it to my todo list, thanks!

vlaaad 2021-03-10T20:50:37.046900Z

oh, I forgot to actually use nrepl, but it works with nrepl too

vlaaad 2021-03-10T20:51:26.047100Z

here is a complete example: 1. nrepl server + prepl server in a single remote process:

$ clj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"}}}' -J-Dclojure.server.prepl='{:port 7777 :accept <http://clojure.co|clojure.co>
re.server/io-prepl}' -M -m nrepl.cmdline
nREPL server started on port 63380 on host 127.0.0.1 - <nrepl://127.0.0.1:63380>
2. reveal connected to prepl server:
$ clj -Sdeps '{:deps {vlaaad/reveal {:mvn/version "1.3.196"}}}' -X vlaaad.reveal/remote-prepl :port 7777
3. editor connected to nrepl server 4. evaluate (tap&gt; 1) 5. tap is shown in the Reveal window

imre 2021-03-10T21:11:47.047500Z

Thank you for that, I'll compare it with what I tried. Probably some typo then on my side.

1πŸ‘