Fork me on GitHub
#figwheel-main
<
2018-08-25
>
kenj22:08:51

@bhauman Regarding using the Cursive REPL, I found this page but it seems like it’s used for figwheel and not figwheel-main. Would the same instructions still apply more or less? https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL

bhauman22:08:07

yes its not for figwheel.main

bhauman22:08:20

are you using lein?

kenj22:08:20

not at the moment, as I was playing around with the new CLI stuff. I could easily switch though

bhauman22:08:36

so I don’t use cursive, but there are two ways to go with a nrepl or a clojure.main REPL

bhauman22:08:00

Actually f I were you I’d head over to #cursive and ask, because these things are in flux at the moment.

bhauman22:08:35

with the nrepl you will need to make sure it starts with piggieback middleware and with clojure.main you just need to make sure your classpath is correct and after that you need to look at the scripting api to launch figwheel from whichever Clojure REPL you choose

kenj22:08:06

are there any docs on starting an nrepl server with the required middleware? In theory Cursive supports just taking a hostname/port and can take it from there

kenj22:08:22

I’m actually have decent luck so far with the clojure.main REPL. seems to be working with just a few issues:

[Figwheel:WARNING] A "resources/public/index.html" exists but the "resources" directory is not on the classpath
    the default server will not be able to find your index.html
and when sending code from the IDE to the REPL:
cljs.user=> (in-ns 'front-end.app)
nil
front-end.app=> (defn a-div []
  [:div "I'm a sub div sort of thing"])
#object[ReferenceError ReferenceError: front_end is not defined]
	 (<NO_SOURCE_FILE>)

kenj22:08:14

the start command fired up figwheel and a browser to connect to it just fine though

bhauman22:08:35

@risinglight I’m thinking you haven’t created a front-end app ns yet?

bhauman22:08:59

you would have to say (ns front-end.app) for that to work

bhauman22:08:24

and the warning is expected if you haven’t added “resources” to your classpath

kenj22:08:58

you are correct about the ns. Creating it did the trick. In the past the IDE has loaded the file to the REPL creating it automatically but that wasn’t the case this time. I think I will have to dig around the Cursive docs to figure out the “resources” on classpath issue

kenj22:08:39

never mind, it was as simple as adding “resources” to :paths in deps.edn 🙂

kenj22:08:27

I shall spend some more time with the docs… thanks again for all the help!

kenj22:08:59

again, this is amazing cool, esp with the ability to send code directly from the IDE to the browser repl