This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-25
Channels
- # announcements (9)
- # aws (50)
- # babashka (7)
- # beginners (95)
- # calva (10)
- # chlorine-clover (17)
- # cljdoc (11)
- # cljs-dev (4)
- # cljsrn (6)
- # clojars (25)
- # clojure (74)
- # clojure-belgium (4)
- # clojure-dev (17)
- # clojure-europe (3)
- # clojure-italy (23)
- # clojure-nl (3)
- # clojure-norway (5)
- # clojure-sanfrancisco (30)
- # clojure-spec (46)
- # clojure-uk (27)
- # clojured (3)
- # clojurescript (91)
- # core-async (61)
- # cursive (3)
- # data-science (4)
- # datascript (7)
- # datomic (67)
- # emacs (15)
- # events (1)
- # figwheel-main (13)
- # fulcro (31)
- # graalvm (1)
- # graphql (3)
- # hoplon (2)
- # jobs (3)
- # jobs-rus (1)
- # kaocha (4)
- # lambdaisland (34)
- # luminus (4)
- # off-topic (62)
- # om (4)
- # other-languages (9)
- # re-frame (14)
- # reitit (1)
- # ring-swagger (1)
- # shadow-cljs (51)
- # sql (5)
- # xtdb (8)
Oh, well....... it seems the problem is harder than I thought.
When Chlorine connects to a socket, it sends the UNREPL string to upgrade the REPL. This binds *out*
to unrepl.core/write
When any command (like load-file
) runs, if it uses *test-out*
(because, for some reason, it is different from *out*
and so it is not sent over the socket) Chlorine will try to bind it to *out*
(so we'll see the results in Atom).
Then things get weird: this *out*
does not exist on other REPL connections.... so it raises the error. Even if I try to bind *test-out*
locally, load-file
will make it leak for the outside world (because it uses def
, that changes environments globally, for all threads)
Here's the solution I came up with for using #reveal with #chlorine (hat tip to @seancorfield for getting me unstuck): Add this alias:
:reveal {:extra-deps {vlaaad/reveal {:mvn/version "0.1.0-ea4"}}
:extra-paths ["/Users/dave.dixon/.clojure"]
:jvm-opts ["-Dclojure.server.repl={:port,50505,:accept,my.repl/start}"]}
pointing to your .clojure
folder (or wherever you want to run startup scripts). In that folder add this clj file in the appropriate hierarchy:
(ns my.repl
(:require [vlaaad.reveal.ui :as ui]))
(def reveal (ui/make))
(defn start
[]
(clojure.core.server/repl))
Then modify the wrap_in_rebl_submit
from @seancorfield's init.coffee
as:
wrap_in_rebl_submit = (code) ->
"(let [value " + code + "] " +
" (try" +
" ((requiring-resolve 'cognitect.rebl/submit) '" + code + " value)" +
" (catch Throwable _))" +
" (try" +
" ((requiring-resolve 'my.repl/reveal) value)" +
" (catch Throwable _))" +
" value)"
@mauricio.szabo I added normal repl to Reveal (in addition to prepls) and tried it with Chlorine, you might be interested: https://github.com/vlaaad/reveal/issues/2#issuecomment-591068889
I'm not sure if Chlorine and Reveal can easily compose, Chlorine seems to need structured output provided by unrepl, and Reveal is supposed to be used as a repl directly...
So far I haven't seen any issues...so far.
I’m glad that you gave it a try! By the way, you can try doing this on repl start:
(add-tap (ui/make))
While the JVM remains running, there will be a window with tap>
resultsI'll post them to #reveal as I get some more time with it.
So (ui/make)
returns a function that can be invoked on values @vlaaad? That's an interesting model...
Great, I'll look at is ASAP (as soon as possible 😆)
On a side note, just published 0.4.12, which will (hopefully!) fix the @aviflax's bug, and also probably fix the errors on unrepl.core/write
being unbound 🙂
@mauricio.szabo Is there any way to control how tall (or wide) the console/repl pane is when it opens?
By default it opens half height (or half width) and it would be nice (for me, at least 🙂 ) to be able to specify a smaller height (or width).
(what made me think of that is that the linter UI package lets you set a maximum height as a config option)
There's no such option for now, but I also am thinking on adding it. Will check the Atom API and see how to control it