Made some progress on using Reveal (would have been more straightforward except I was typing vlaad
instead of vlaaad
, amongst other things 🤪). Now it does start, but when I try to connect Chlorine it gives a bunch of errors like
Clojure 1.10.1
Syntax error reading source at (REPL:1:3).
Conditional read not allowed
(:cljs :using-cljs-repl :clj :using-clj-repl :cljr :using-cljr-repl :joker :using-joker-repl :clje :using-clje-repl :bb :using-bb-repl)
Execution error (IllegalArgumentException) at user/eval3943 (REPL:1).
Wrong number of args passed to keyword: :cljs
:using-unknown-repl
=> :using-unknown-repl
Syntax error reading source at (REPL:3:74).
Conditional read not allowed
The alias I'm using looks like
:reveal {:extra-deps {vlaaad/reveal {:mvn/version "0.1.0-ea4"}}
:jvm-opts ["-Dclojure.server.repl={:port,50505,:accept,vlaaad.reveal.prepl/-main}"]}
I'm guessing this is something to do with Chlorine initializing the connection? Maybe https://clojure.atlassian.net/projects/CLJ/issues/CLJ-2453?
Running from the command line directly seems to work fine.@dave.dixon Chlorine expects a standard socket repl -- you're starting a prepl I think?
Reveal is. @vlaaad is looking into starting a standard repl. See https://github.com/vlaaad/reveal/issues/2
Yes, that's probably the problem. When Chlorine connects, the first thing it does is send a form to detect which clojure "flavor" is running
Right. I was going to suggest starting Reveal's regular main and also starting a standard socket REPL -- that's how we work with REBL.
Ahhh.
Reveal needs an API to "submit" form/value data so that you can programmatically add things to its browser.
Given that it has nrepl Middleware that should be in place already -- you can probably see what function needs to be called.
I've been summoned :)
There is no regular main in Reveal, but I'm going to add normal REPL without prepl backend. FYI, there is no static REBL-like submit function, but calling vlaaad.reveal.ui/make will return a function that can be used to submit values. Then making it static is just a matter of def-ing it where you want
Created #reveal channel for Reveal-specific discussions
Hey @vlaaad! I was just about to send you a message! Good to see you here. I think your project and Chlorine have lots of common ground. The only thing is that reveal is just Clojure, right? Any plans to implement a cljs version?
For example, lots of people ask me for a way to navigate the rendered result with the keyboard, or to search parts of the result with a string...
I think one of the biggest strengths of tools like Reveal is being in-process: it can effortlessly keep references to objects, which allows lots of meaningful inspections. Cross-process is bound to be limited by serialization, that's why I don't have plans to explore clojurescript support. With that said, since Reveal can prepls, and can receive prepls as parameters, it can already connect to cljs environments
It's just not documented :)
I apologize if this is a FAQ… is there a known issue related to loading a file using Chlorine, then switching to the REPL in the terminal and attempting to call a fn in a var in the loaded namespace and getting this:
user=> (my-ns/my-fn)
Execution error (IllegalStateException) at unrepl.core/non-eliding-write (REPL:31).
Attempting to call unbound fn: #'unrepl.core/write
?(Atom 1.44.0, Chlorine 0.4.10, MacOS 10.15.1, Clojure 1.10.1.510, JRE 13.0.2)
Wow, I never saw this issue. What are the steps to reproduce?
(I think I saw Sean having this problem, but evaluating inside Chlorine. It'll be wonderful if I can reproduce it 🙂)
Well first I launch my repl from the shell/terminal
then launch atom, connect chlorine
then load the open file
then switch to terminal and attempt to call one of the functions in the file
Ah, I'm "glad" someone else has run into that problem! I was never able to track down how to repro, and it hasn't happened since I last mentioned it in this channel!
happy to screen-share or whatever to help debug
screen recording?
There's no open issue, I'll be glad if you open it with the screen recording!
I'll update to Java 13 and see if I can reproduce here (please, when you open the issue, run java -version
so I can see the exact Java version)
I ran into it on Adopt OpenJDK 11.
(11.0.5)
will do
openjdk version "13.0.2" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.2+8)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.2+8, mixed mode, sharing)
Somehow I can't reproduce on Linux (just installed OpenJDK 13.0.2). I'm hoping is not something specific of some O.S. (I saw some issues on MacOSX before, but they were unrelated to JDK / Clojure REPL)
Most likely PEBKAC and I’m wasting your time 😬
I can’t add a screen recording right now but happy to do so tomorrow if that’d help
@mauricio.szabo How does the "break evaluation" piece work in Chlorine?
When I start an evaluation, UNREPL sends me a code that can be used to stop the evaluation. So, I use another connection to the socket REPL and send this command to stop the evaluation
Over in the #clojure-dev channel, we are talking about prepl not supporting interruptible evals, and @ghadi mentioned that nREPL's way of handling it -- calling Thread/stop -- is "broken" so I wondered about Chlorine/unrepl.
UNREPL runs all code on (future ....)
So it just cancels the future
OK. Cool.
@aviflax can you send me the full contents of the editor when you tried to load-file?
I can point you to the repo, let me just make sure I can reproduce on master (as opposed to the branch I’m working on that’s currently local only)
(I just added my deps.edn aliases to the issue)
oh weird, it seems to work fine on master
so the cause must be discernible in the branch diff
confirmed
I might just push the branch and point you to the diff
here you go: https://github.com/FundingCircle/fc4-framework/compare/validate-model
(I’ve added that to the issue as well)
@aviflax thanks a lot! I can reproduce this issue just fine! I'll see if there's a fix, or if it's some error with UNREPL 🙂
great!
@mauricio.szabo I’ve got another commit on that branch, locally… in which I fixed the new code, which means the tests are no longer failing. I thought I’d see if the unrepl problem still occurs, and it does not
I can push that commit if that’d be helpful to you, or hold off, whatever’s more helpful
Yes, I just found the issue too...
For some reason, the output stream of clojure.test
does not redirect to the socket. Just after connecting, Chlorine does the redirection right here: https://github.com/mauricioszabo/repl-tooling/blob/master/src/repl_tooling/repl_client/clojure.cljs#L155-L157
Aha!
well that’s good!
…right?
Yes, that's good. When I re-issue this command, it works So, probably what I'll do is re-bound this variable from time to time... maybe? 😄
😬
gotta run. Thanks for the help — and all your work on the tool! :thanks3:
Thank you too, for reproducing this error! 🙂