protorepl

bcbradley 2016-12-20T16:16:20.000333Z

I'm going through this tutorial https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-02.md and figured that it would be neat if instead of using boot's nrepl I used protorepl's remote repl. But when I use the command palette in atom to start up a proto-repl nrepl and connect to the host, it doesn't work. First off protorepl says "no user namespace defined" and that isn't right. Second, it doesn't recognize (js/alert "hello"). This will work though:

C:\Users\brian\Documents\modern-cljs>boot repl -c
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_73-b02
        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 <http://clojuredocs.org|clojuredocs.org>: [clojuredocs or cdoc]
              (user/clojuredocs name-here)
              (user/clojuredocs "ns-here" "name-here")
boot.user=&gt; (start-repl)
&lt;&lt; started Weasel server on ws://127.0.0.1:53407 &gt;&gt;
&lt;&lt; waiting for client to connect ... ←[1mConnection is ws://localhost:53407
←[m←[1mWriting boot_cljs_repl.cljs...
←[m connected! &gt;&gt;
To quit, type: :cljs/quit
nil
cljs.user=&gt; (js/alert "Hello")
nil

bcbradley 2016-12-20T16:18:22.000335Z

for comparison in proto-repl:

No user namespace defined. Defaulting to clojure.tools.namespace.repl/refresh.
:reloading ()
Refresh complete
(js/alert "wat")
CompilerException java.lang.RuntimeException: No such namespace: js, compiling:(C:\Users\brian\AppData\Local\Temp\boot.user832682267927315131.clj:1:5)

bcbradley 2016-12-20T16:18:49.000336Z

my build.boot:

(set-env!
 :source-paths #{"src/cljs"}
 :resource-paths #{"html"}

 :dependencies '[[proto-repl "0.3.1"]
                 [org.clojure/clojure "1.7.0"]
                 [org.clojure/clojurescript "1.7.170"]
                 [adzerk/boot-cljs "1.7.170-3"]
                 [pandeiro/boot-http "0.7.0"]
                 [adzerk/boot-reload "0.4.9"]
                 [adzerk/boot-cljs-repl "0.3.0"]
                 [com.cemerick/piggieback "0.2.1"]
                 [weasel "0.7.0"]
                 [org.clojure/tools.nrepl "0.2.12"]])

(require '[adzerk.boot-cljs :refer [cljs]]
         '[pandeiro.boot-http :refer [serve]]
         '[adzerk.boot-reload :refer [reload]]
         '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]])

bcbradley 2016-12-20T16:49:18.000337Z

Update: Right now I think the problem might be that in the nREPL I executed (start-repl) but in the proto-repl i did not.

jasongilman 2016-12-20T19:38:46.000338Z

@bcbradley: once you run (start-repl) does that work? Proto REPL ClojureScript support is a bit minimal right now just due to the variety of ways in which you connect to the ClojureScript env and the fact I haven't prioritized it for what I work on.

gdeer81 2016-12-20T19:47:23.000339Z

@jasongilman <off-topic> I did a Clojure/Datomic demo at work using protorepl and it was a lovely experience </off-topic>

👍 1
bcbradley 2016-12-20T20:38:21.000340Z

@jasongilman It seems that doesn't fix it unfortunately.