Fork me on GitHub
#figwheel-main
<
2020-06-23
>
bhauman00:06:58

you can provide a path to the node command in :node-command and you can provide false to :inspect-node if inspect is mucking things up

Abhinav Sharma09:06:45

@bhauman, I tried these as well, no luck so far. Though, I was able to have a different setup, which is sufficient for my needs as of now. I switched to using Nw.js, combining both Nodejs and Browser envs

Abhinav Sharma09:06:02

I'll probably circle back to the proper setup later on.

athomasoriginal12:06:48

Is there a way to start figwheel REPL as a socket repl? I have not dug into this much yet myself (apologies for not doing the leg work 😞 ). My goal is to connect the figwheel REPL to Chlorine (atom). Chlorine supports nrepl now, but I was curious if there is a straightforward process for getting a socket version of the Figwheel REPL.

bhauman14:06:15

@tkjone I would go with the nrepl piggieback method

bhauman14:06:53

remember that you are starting a clojure repl and then launching a cljs-figwheel repl inside of it

bhauman14:06:04

so its technically possible, it just depends how chlorine handles this repl-within-a-repl setup

athomasoriginal14:06:01

Thanks! Understood :thumbsup:

danieroux15:06:31

@tkjone a snippet of code I am using, if you want to experiment. I am not using Chlorine

(defn start-prepl [repl-env port]
  "This cannot be used by Cursive - yet. When it does, we can let nREPL go"
  (println "Starting a prepl on port" port)
  (server/start-server {:accept  'cljs.core.server/io-prepl
                        :address "127.0.0.1"
                        :port    port
                        :name    "prepl-figwheel"
                        :args    [:repl-env repl-env]}))

(defn start-cljs-repl []
  (let [build-id "common"]
    (do
      (try
        (figwheel.main.api/start {:mode :serve} build-id)
        (start-prepl (figwheel.main.api/repl-env build-id) 9002)
        (figwheel.main.api/cljs-repl build-id)
        (catch RuntimeException _e
          (println "The build is already running, connection to the REPL only")
          (figwheel.main.api/cljs-repl build-id))))))

❤️ 3
cfleming21:06:22

While it’s true that Cursive doesn’t support prepl, Cursive’s socket REPL support is very similar: https://cursive-ide.com/userguide/repl.html#remote-repls

cfleming23:06:55

To use this, just create a normal socket REPL and connect to it.

bhauman17:06:13

latest figwheel-main 0.2.10-SNAPSHOT has a :use-ssl figwheel option that when set to true will attempt to automatically setup a cert for localhost, using the certifiable library

👍 3
bhauman17:06:36

so you get https in one config option

bhauman17:06:07

certifiable needs some help getting it to work on all platforms properly, https://github.com/bhauman/certifiable