REPL setup help

136 views
Skip to first unread message

Rob Nikander

unread,
Jul 30, 2017, 9:02:18 PM7/30/17
to ClojureScript
Hi,

I'm new to ClojureScript. I followed the quick start instructions [1] and set up a REPL. It works, but now I'd like to integrate a REPL with my web app and IDE. Any pointers?

I have a Java servlet container, also running Clojure code. I'm using IntelliJ with Cursive plugin, and have REPL windows in the IDE working for the JVM/server-side of things. I can reload Clojure code in the running server. 

Now, that servlet code responds with an HTML page which contains my ClojureScript code. That runs, but I don't know how to connect that browser environment to a REPL window in IntelliJ, or even a REPL in my terminal.  The quick start terminal REPL only connects to a magic server listening on localhost:9000. 

Anyway... any pointers? 

thanks,
Rob


Ikuru Kanuma

unread,
Jul 31, 2017, 10:58:01 AM7/31/17
to ClojureScript
Hi Rob,

Perhaps following this README will help?
It should work as long as you have a working repl + can add this as a dependency.
Figwheel will give you hot code reloading + a cljs repl + lot of other goodies and is really popular.

https://github.com/bhauman/lein-figwheel/tree/master/sidecar

Ikuru

Colin Fleming

unread,
Jul 31, 2017, 6:16:30 PM7/31/17
to clojur...@googlegroups.com
In fact, Figwheel has a page dedicated to Cursive: https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL. I agree that if you're doing browser development, you almost certainly want to be using figwheel.

--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscribe@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.

Rob Nikander

unread,
Jul 31, 2017, 7:23:45 PM7/31/17
to ClojureScript
Okay, thanks, I will try figwheel. I'm using Maven not Leiningen so I'll need to find time later to translate those instructions. On my test project here I could use Leiningen, but on another, Maven is entrenched.


On Monday, July 31, 2017 at 6:16:30 PM UTC-4, Colin Fleming wrote:
In fact, Figwheel has a page dedicated to Cursive: https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL. I agree that if you're doing browser development, you almost certainly want to be using figwheel.
On 1 August 2017 at 02:58, Ikuru Kanuma <kanu...@gmail.com> wrote:
Hi Rob,

Perhaps following this README will help?
It should work as long as you have a working repl + can add this as a dependency.
Figwheel will give you hot code reloading + a cljs repl + lot of other goodies and is really popular.

https://github.com/bhauman/lein-figwheel/tree/master/sidecar

Ikuru

--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.

Colin Fleming

unread,
Jul 31, 2017, 10:42:11 PM7/31/17
to clojur...@googlegroups.com
Hi Rob,

So using Maven, those instructions should work pretty much as-is, since the clojure.main style REPL it uses just uses the classpath from IntelliJ, it doesn't use lein for anything fancy. The only part which I don't know about is compiling ClojureScript from Maven - I actually didn't even know that was possible. But the rest of it should work as described in that doc, you'll just have to translate things like :source-paths to the Maven equivalent which should be straightforward.

Cheers,
Colin

To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscribe@googlegroups.com.

Rob Nikander

unread,
Aug 3, 2017, 8:25:20 AM8/3/17
to ClojureScript
I got this working, but I'm seeing very strange behavior that makes it unusable. IntelliJ can hang and overuse CPU on certain expressions. It will happen, for example, if I type the following in the IntelliJ Cursive REPL connected to Figwheel/ClojureScript...

cljs.user=> (deftype Foo [a])   
cljs.user=> (def foo (-> Foo 123))  ; so far everything is normal
cljs.user=> (.-a foo)   ; oh it does not like this.

It's hard to finish tying that last line. It's as if it's trying to parse it before I'm done (maybe for auto completion?) and choking. Once I type "(.-a" the CPU starts to go and IntelliJ responds to keypresses only after huge delays.

Rob

Colin Fleming

unread,
Aug 3, 2017, 4:12:00 PM8/3/17
to clojur...@googlegroups.com
Hi Rob,

I'll follow up with you about this to your message on the Cursive list, since it's getting pretty Cursive specific. 

Cheers,
Colin

To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages