adzerk-oss/boot-cljs-repl

.cljs.edn makes cljs-repl not connecting anymore

Closed this issue · 2 comments

Here is a couple of repos demonstrating the issue:

The first one is a very minimal repo defining a dev task which implements a kind of immediate feedback principle.

https://github.com/magomimmo/modern-cljs/tree/se-tutorial-03

You can call it with following boot command:

boot dev

Than, after visiting the localhost:3000 URL, if you run the nrepl-client everuthing works as exptexted

boot repl -c
REPL-y 0.3.7, nREPL 0.2.11
Clojure 1.7.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_66-b17
        Exit: Control+D or (exit) or (quit)
    Commands: (user/help)
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)
    Examples from clojuredocs.org: [clojuredocs or cdoc]
              (user/clojuredocs name-here)
              (user/clojuredocs "ns-here" "name-here")
boot.user=> (start-repl)
<< started Weasel server on ws://127.0.0.1:53410 >>
<< waiting for client to connect ... Connection is ws://localhost:53410
Writing boot_cljs_repl.cljs...
 connected! >>
To quit, type: :cljs/quit
nil
cljs.user=>

The second repo is the same as the first one with just one exception.

https://github.com/magomimmo/modern-cljs/tree/edn

I changed the name of the generated JS file from main.js to js/main.js. Obviously I changed the src of the script tag as well and added the main.cljs.edn file in the js directory.

boot dev still works as expected, but when I try to connect the nrepl-client, the connection never happens:

boot repl -c
REPL-y 0.3.7, nREPL 0.2.11
Clojure 1.7.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_66-b17
        Exit: Control+D or (exit) or (quit)
    Commands: (user/help)
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)
    Examples from clojuredocs.org: [clojuredocs or cdoc]
              (user/clojuredocs name-here)
              (user/clojuredocs "ns-here" "name-here")
boot.user=> (start-repl)
<< started Weasel server on ws://127.0.0.1:53453 >>
<< waiting for client to connect ... Connection is ws://localhost:53453
Writing boot_cljs_repl.cljs...

Please use the above repos to test yourself.

Cheers

The cljs-repl task needs to be before the cljs task in the task pipeline. Moving the task fixes the problem. Also be aware that the (start-repl) invocation blocks until a browser window is opened if none has been opened yet with automatic reloading enabled. If there is no reloading you need to refresh the page.

I will update the README to better reflect the requirements.