This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-28
Channels
- # announcements (2)
- # beginners (19)
- # calva (8)
- # cider (5)
- # cljsrn (13)
- # clojure (35)
- # clojure-conj (3)
- # clojure-spain (1)
- # clojure-uk (2)
- # clojurescript (4)
- # clojutre (4)
- # cursive (13)
- # data-science (2)
- # datascript (1)
- # datomic (5)
- # duct (4)
- # fulcro (76)
- # funcool (5)
- # jobs (5)
- # off-topic (10)
- # remote-jobs (7)
- # rewrite-clj (8)
- # spacemacs (3)
- # sql (2)
- # xtdb (25)
What is the minimal setup to get a clojurescript REPL working with Cursive? I’ve tried the following:
- Minimal deps: {:deps {org.clojure/clojurescript {:mvn/version "1.10.520"}}}
- Start a standard nREPL through the launch configuration.
- Run the following:
(require '[cljs.repl.browser :as b]
'[cljs.repl :as r])
(r/repl (b/repl-env))
This will work, except that the REPL keeps prompting me for standard input with a modal…@dmarjenburgh so. cljs repl
When you fire up a raw cljs repl, that’s exactly what you’re doing: Starting a process that continually prompts for user input.
But the fix right now is to use a piggieback repl: https://github.com/nrepl/piggieback
here is a full example which you can just copy-paste as is. in 1 shell run a clojure socket repl which will be handled by a clojurescript repl server:
clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.1"} org.clojure/clojurescript {:mvn/version "1.10.520"}}}' -J-Dclojure.server.repl="{:port 5555 :accept cljs.server.browser/repl}"
this also drops you into a regular clojure repl which is connected to your terminal's standard i/o.
from an other shell, run a tubular socket repl client like this:
clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.1"} tubular {:mvn/version "1.3.0"}}}' -m tubular.core -p 5555
this will try to connect to the socket repl server. that incoming connection to the 1st process will trigger it start a new cljs repl environment by opening a browser tab, which tab then connects back to that 1st process websockets. that 1st process then forwards the repl chatter back and forth to the tubular socket repl client in the 2nd process, which displays in on the 2nd terminal's standard i/o