3

I'm trying to setup CIDER for a macchiato-project for the back- and frontend. lein new macchiato dumac +browser gives me quite an intricate project.clj with various profiles, among which I find :browser-dev and :dev (for the server side).

Now, whenever I do cider-jack-in-ClojureScript CIDER defaults to a :dev-profile, but seemingly not the one defined in the profiles.clj since the Node-script is not launched (line 47). I can happily code away on the server side though once I dispatch the node command manually.

Still I have no idea as to how I may start a REPL for the browser from within Emacs (I can do so by manually typing lein build-browser at the terminal but I cannot connect to that nREPL even if I replace the cider-nrepl dependencies). Here's a line from the CIDER Docs on how to use legacy figwheel (as the macchiato tmaplate does)… it may indicate the problem:

make sure :cljsbuild and :figwheel settings are in the root of your Leiningen project definition.

Macchiato's template project.clj obviously doesn't conform to this requirement as these settings are nested within the profiles. Does that mean that the template is incompatible with CIDER? Would transitioning to fighwheel-main help? (I have no clue on how to do this with such an intricate project.clj.)

Has anyone gotten Macchiato to work with CIDER on the server and browser?

I'm kinda overwhelmed right now and would be most grateful for any clues as to what I may try next

Thanks!

Oliver

Phylax
  • 189
  • 10

1 Answers1

0

I'm unfortunately late to this question, but this is actually quite easy using shadow-cljs, and does what you want: allows live REPL access to the server and/or browser JS runtimes.

Include macchiato/core in :dependencies, and have a build target for the server, and a build target for the browser. Launch e.g. shadow-cljs watch server browser, then use cider-connect / cider-connect-cljs once you have a node or browser process connected to the runtime.

directed laugh
  • 573
  • 4
  • 8