This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-29
Channels
- # babashka (168)
- # beginners (60)
- # calva (21)
- # cider (44)
- # clj-kondo (27)
- # cljs-dev (4)
- # cljsrn (2)
- # clojure (157)
- # clojure-australia (27)
- # clojure-bay-area (7)
- # clojure-czech (1)
- # clojure-europe (94)
- # clojure-nl (2)
- # clojure-spec (3)
- # clojure-sweden (11)
- # clojure-uk (35)
- # clojurescript (19)
- # cursive (12)
- # events (1)
- # figwheel-main (1)
- # fulcro (28)
- # honeysql (7)
- # jackdaw (9)
- # kaocha (4)
- # keechma (1)
- # malli (7)
- # midje (1)
- # missionary (1)
- # music (1)
- # off-topic (45)
- # pathom (18)
- # polylith (6)
- # practicalli (4)
- # random (1)
- # reagent (3)
- # reitit (3)
- # shadow-cljs (74)
- # sql (9)
So given a project using Rum, which is managing both backend (clj) and frontend code (cljs) i'm not sure how to manage my cider repls in order to setup the project. Which should be able to eval forms in either context (clj vs cljs). I'm trying to think this through right now, but chime in if you have thoughts. Here is the deps file for the figwheel hello world rum template
{:deps {org.clojure/clojure {:mvn/version "1.10.0"}
org.clojure/clojurescript {:mvn/version "1.10.773"}
rum {:mvn/version "0.12.3"}}
:paths ["src" "resources"]
:aliases {:fig {:extra-deps
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
com.bhauman/figwheel-main {:mvn/version "0.2.11"}}
:extra-paths ["target" "test"]}
:build {:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]}
:min {:main-opts ["-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]}
:test {:main-opts ["-m" "figwheel.main" "-co" "test.cljs.edn" "-m" "drewverlee.test-runner"]}}}
• We have clojure for the backend and sever code.
• clojurescript for the cljs compiler, sense were not doing self hosted
Now the docs imply you should run clojure -A:fig:build
from the command line. That going to bring in our extra deps, mainly figwheel-main, and the second command is going to run a command in the figwheel.main ns triggering the dev build with a repl. I'm 90% postive the later is the fighweel repl responsible for hot reloading our code, NOT an nrepl i can connect my emacs editor buffer to and eval forms. This seems to align with the fact that cider tells me no repls are available to connect to.
Now, if i check the cider docs concerning figwheel, they imply the happy path is just running 'cider-jack-in-clj/cljs' but that's where i start getting confused, because this project is both. Well, we do have a cider-jack-inclj&cljs, but that doesn't seem to "just work". As far as i can tell, the rum setup breaks the nice separation of concerns that cider expects for easy setup. Though i'm sure someone that understands the internals undrstands what should be done here.
My hunch is that ill need run cider-jack-in-clj, then start the fighwheel server repl AND start an nrepl server for CLJS. Normally, i would start my CLJS repl via cider-jack-in-cljs. But then what tells the figwheel server to talk to the nrepl server?
The docs here are a good place to start
https://figwheel.org/docs/editor-integration.html
It even has a nice diagram that explains the flow, but how do we actually achieve that in this context?