figwheel-main

figwheel-main http://figwheel.org
bhauman 2020-06-23T00:25:23.380900Z

and also https://figwheel.org/config-options#inspect-node

bhauman 2020-06-23T00:26:58.382500Z

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

2020-06-23T09:40:45.384800Z

@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

2020-06-23T09:41:02.385400Z

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

athomasoriginal 2020-06-23T12:52:48.388800Z

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.

bhauman 2020-06-23T14:45:15.390600Z

@tkjone I would go with the nrepl piggieback method

bhauman 2020-06-23T14:45:53.391400Z

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

bhauman 2020-06-23T14:47:04.392700Z

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

athomasoriginal 2020-06-23T14:57:01.393200Z

Thanks! Understood :thumbsup:

danieroux 2020-06-23T15:28:31.393600Z

@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))))))

1❤️
bhauman 2020-06-24T14:21:59.400100Z

@tkjone ^

1👍
bhauman 2020-06-23T17:49:13.395600Z

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

1👍
bhauman 2020-06-23T17:49:36.396Z

so you get https in one config option

bhauman 2020-06-23T17:53:07.396800Z

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

cfleming 2020-06-23T21:40:22.397500Z

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

cfleming 2020-06-23T23:52:55.397800Z

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