IntelliJ / ClojureScript Integration...

587 views
Skip to first unread message

John Szakmeister

unread,
Aug 4, 2014, 8:59:15 PM8/4/14
to clo...@googlegroups.com
Sorry for pestering the list about this, but despite trying to follow
several different blog posts about this, I seem unable to get a
working ClojureScript REPL that connects to the browser. Ideally, I'd
like to start from a clean project using "lein new om-start
project_name" and get the right bits together to do this. My goal is
to be able to do the Om tutorials and try things out on-the-fly.

Given that, I do have Clojure repl working where I can start the Jetty
server. However, when I try this:

(browser-repl)

As suggested by the om-start README, anything I try to evaluate just
hangs there. FWIW, I see no errors in the JavaScript console.
Looking at the raw HTML, it looks like the connection back to the
server-side for the browser REPL is correct, and the (browser-repl)
command comes back with:

(browser-repl)
WARNING: unsigned-bit-shift-right already refers to:
#'clojure.core/unsigned-bit-shift-right in namespace: cljs.core, being
replaced by: #'cljs.core/unsigned-bit-shift-right
Browser-REPL ready @ http://localhost:60442/9462/repl/start
Type `:cljs/quit` to stop the ClojureScript REPL
=> nil

Any advice folks can give would be appreciated. I'm fairly new to
IntelliJ in general, and to this point have used Vim and a
command-line REPL to do my work. It'd be nice to have IntelliJ
working here. I should add that I'm using the Cursive plugin for
IntelliJ and not La Clojure.

Thanks!

-John

Colin Fleming

unread,
Aug 5, 2014, 3:09:23 AM8/5/14
to clo...@googlegroups.com
Hi John,

I'm the developer of Cursive. I haven't done this myself, but here are details from a Cursive user detailing how he got it working. Others have since tried it and it's worked for them too. I'm planning to add a built-in CLJS REPL but haven't got to it yet.

Here's what Wilker Lúcio wrote:

This is how I got it done (and I'm using it on node-webkit project):

Add this plugin to your project (plugins, not dependencies):

[jarohen/simple-brepl "0.1.0"]

On your main cljs file, add this :require

[weasel.repl :as ws-repl]

Also add this at your init point so it connects with the REPL:

(ws-repl/connect "ws://localhost:9001")

Setup wise that's all you need.

After that, start your REPL (with lein repl), and them run: (simple-brepl)

Wait a bit, it will change your REPL into browser REPL, and it will say that the websocket is listening. After that open you page, and you are done, just evaluate stuff :)

Let me know if this doesn't work for you and I'll see what I can do.

Cheers,
Colin


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Szakmeister

unread,
Aug 5, 2014, 6:44:57 PM8/5/14
to clo...@googlegroups.com
On Tue, Aug 5, 2014 at 3:08 AM, Colin Fleming
<colin.ma...@gmail.com> wrote:
> Hi John,
>
[snip]
> Here's what Wilker Lúcio wrote:
>
>> This is how I got it done (and I'm using it on node-webkit project):
>>
>> Add this plugin to your project (plugins, not dependencies):
>>
>> [jarohen/simple-brepl "0.1.0"]
>>
>> On your main cljs file, add this :require
>>
>> [weasel.repl :as ws-repl]
>>
>> Also add this at your init point so it connects with the REPL:
>>
>> (ws-repl/connect "ws://localhost:9001")
>>
>> Setup wise that's all you need.
>>
>> After that, start your REPL (with lein repl), and them run: (simple-brepl)
>>
>> Wait a bit, it will change your REPL into browser REPL, and it will say
>> that the websocket is listening. After that open you page, and you are done,
>> just evaluate stuff :)
>
>
> Let me know if this doesn't work for you and I'll see what I can do.

Thank you Colin, that was helpful. I think I need to work out a
couple of details for myself, but I was able to get a REPL that works!
Thank you!

-John

henry w

unread,
Aug 8, 2014, 5:57:50 AM8/8/14
to clo...@googlegroups.com, jo...@szakmeister.net
I am wanting to do om tutorial in cursive as well and using om-start.

I will give the proposed solution a go as well. but FYI what i have been doing so far is

1) start 'lein repl :headless' from cmd line,
2) connected to it from cursive as a remote repl.

 a bit clunky but is working just fine.

Reply all
Reply to author
Forward
0 new messages