Fork me on GitHub
#cursive
<
2016-12-12
>
misha16:12:10

greetings! cursive can launch figwheel repl, but can it connect to a running one?

misha16:12:44

re-natal (react native) starts figwheel, and I am looking for (easy opieop) ways to see/use that running repl from cursive

shaun-mahood16:12:58

@misha: I'm pretty sure it can, let me test on my machine and I'll let you know how.

cfleming16:12:26

@misha If it starts an nREPL server, then yes, it can - use the Remote REPL run config option.

misha16:12:29

@cfleming is there an easy tell? like does FW print something specific out, or has something in a project file, etc.? Going through all the FW docs now

shaun-mahood16:12:02

@misha: There's an nrepl port that you can add to the figwheel config in your project.clj

misha16:12:29

The lein figwheel is capable of launching an nREPL server that your tooling can connect to by using the :nrepl-port configuration parameter. This is not the strategy recommended below.

I am now recommending that you forgo using lein figwheel and instead run lein repl and then launch figwheel from the Clojure nREPL session. This will allow you to reuse all of your project.clj's nrepl configuration.

shaun-mahood16:12:17

Yeah, it's not as nice for tooling but work pretty well if you want it working quickly - particularly if you aren't able to use the instructions on that page

misha16:12:59

if I don't have any prior nrepl configuration - is doing it "hard way" worth it?

misha16:12:47

okok, for now I'd settle for reading from/sending to repl w/o leaving cursive.

shaun-mahood16:12:51

I'm just testing it - I spent a lot of time a year or so ago using figwheel and cursive the old way and I remember it working just fine, but I should probably check what it does now before recommending it 🙂

shaun-mahood16:12:28

Ok yeah it still works fine - 1 minute and I'll send you the super easy version

shaun-mahood16:12:37

In your project.clj, add :nrepl-portto your root figwheel map (not under a build) In cursive, add a new Clojure REPL -> Remote config, point it to your nrepl host and port as configured in figwheel Start Figwheel Start your remote config Profit!

misha16:12:45

is it Christmas already? 🙂

misha16:12:44

:profiles {:dev
                   {:cljsbuild
                    {:builds
                     {:ios
                     {:source-paths ["src" "env/dev"]
                      :figwheel     true
                      :compiler     {:preloads      [devtools.preload]
                                     :source-map    true
                                     :output-to     "target/ios/not-used.js"
                                     :main          "env.ios.main"
                                     :output-dir    "target/ios"
                                     :infer-externs true
                                     :optimizations :none}}}}}

misha16:12:32

@shaun-mahood this is the truncate version of project.clj, and there is no mention of FW other than this true val.

shaun-mahood16:12:16

@misha: We should take this to #lein-figwheel - can you post the entire project.clj there?

misha16:12:47

@shaun-mahood cursive remote repl settings does not give me current project as an option for context module. how critical is that?

shaun-mahood16:12:17

@misha: I have no idea 🙂 What options is it giving you, just blank?

misha16:12:42

some of mine locally built .jars

misha16:12:05

ok, ios-level settings did not work. root-level settings did launch nrepl, and I connected to it. but it does not see anything in ns I switch to: CompilerException java.lang.RuntimeException: Unable to resolve symbol: thanks, @shaun-mahood the search continues

shaun-mahood17:12:30

@misha: Can you do basic clojure operations?

misha17:12:13

yes, (+ 1 1) works, (in-ns 'my.project.ns) seems to work too, but it after that it fails to evaluate anything within it.

misha17:12:55

I suspect the issue is - whole project is a cljs one, and there is no "server side" code to form any meaningful context off

shaun-mahood17:12:21

@misha: I've done the same thing with CLJS only projects before with no problem - maybe it's re-natal specific, you could ask someone in #cljsrn and maybe they can help you more. I'm out of knowledge 🙂

misha17:12:43

@shaun-mahood I messed up module names in project.clj: repl setup screen does give me current project as a context, however that does not make repl able to eval anything within my namespaces... thanks again

misha18:12:37

@shaun-mahood in case you are interested, I just stopped launching FW repl from .sh script, and instead launch it from cursive, instead of trying to connect cursive to running FW

shaun-mahood18:12:09

@misha: Good plan, glad it all works for you now

clark21:12:18

hey folks, outside of the hack that generates a project.clj for every run of boot, does anyone know where I could look to see if boot support is in the works?

timgilbert21:12:42

...no news about official support in it, though

clark22:12:18

@timgilbert nice, thank you

clark22:12:34

I am helping to get a new team up to speed on cursive, and would like to go to boot instead of lein

clark22:12:43

this being one of the questions (blockers?) on that front

shaun-mahood22:12:48

@clark: Colin (Cursive developer) is very active in here, I'm sure he'll answer when he's able to

clark22:12:10

@shaun-mahood very cool, thank you!