Fork me on GitHub
#reveal
<
2021-03-10
>
imre14:03:15

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?

vlaaad15:03:23

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

imre15:03:42

yeah 🙂

imre15:03:59

I wish editors would just migrate to prepl already

vlaaad15:03:42

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

imre15:03:23

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

imre15:03:46

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

imre15:03:08

(when started with remote-prepl)

imre17:03:43

it doesn't seem like it does

vlaaad20:03:26

I just tried it and it worked...

vlaaad20:03:03

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 
re.server/io-prepl}'

vlaaad20:03:38

2. reveal connected to remote process:

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

vlaaad20:03:29

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> 1)
{:tag :ret, :val "true", :ns "user", :ms 1, :form "(tap> 1)"}
{:tag :tap, :val "1"}

vlaaad20:03:03

and when I invoked (tap> 1) , it also appeared in reveal window

vlaaad20:03:17

does it help?

vlaaad20:03:37

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

vlaaad20:03:26

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 
re.server/io-prepl}' -M -m nrepl.cmdline
nREPL server started on port 63380 on host 127.0.0.1 - 
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> 1) 5. tap is shown in the Reveal window

imre21:03:47

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

👍 3
imre14:03:54

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

👍 3
imre14:03:25

I also forgot to properly expose the port through docker

vlaaad14:03:59

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

vlaaad14:03:44

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

imre14:03:26

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

imre14:03:55

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

imre14:03:12

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

imre14:03:34

huge kudos to you for making this available

vlaaad14:03:46

my pleasure!