figwheel 2018-06-16

@chadhs you start this from Cider by doing cider-jack-in-clojurescript

Everything fires up except the ring server; must be missing something small

if you have a cider connection then you have a ring server right?

oh RING server

been travelling all day

OK you are using the separate server setup

@bhauman finally getting back to this. iโ€™m surprised these arenโ€™t more common questions, but maybe most people running CIDER and figwheel just figure this bit out?

hoping to get something like this to work

;;cljs
  ;; (setq cider-cljs-lein-repl
  ;; 	"(do (require 'figwheel-sidecar.repl-api)
  ;;            (figwheel-sidecar.repl-api/start-figwheel!)
  ;;            (figwheel-sidecar.repl-api/cljs-repl))")
  (setq cider-cljs-lein-repl
        "(user/cider-figwheel)")

@chadhs yep, that should do it

and in dev/user.clj

(defn cider-figwheel
  "launch custom figwheel repl setup for cider"
  []
  (do (start-server)
      (fig-start)
      (cljs-repl)))

๐Ÿ‘ 1

@bhauman now I feel less dumb ๐Ÿ˜€ going to try your user fun idea ๐Ÿ’ก

๐Ÿ‘ 1

@bhauman if you scroll down just a bit, i do have the block required to properly kick off figwheel with cider-jack-in-clojurescript, and it works great for typical figwheel dev. https://github.com/chadhs/dotfiles/blob/master/editors/emacs-config.org#clojure-support

but i still canโ€™t get your example or my project to kick off the ring-server automatically via cider despite having https://github.com/chadhs/ccclock/blob/e6affbf62adc4e0f4f0b0ddded56e33e04451c9c/project.clj#L31

it does work with lein figwheel

@chadhs yep as you discovered this only works from lein ๐Ÿ˜ž

what happened is the landscape changed, is used to only make sense to provide these hooks to lein because if you were starting figwheel from a script why not just call your server init function as well

but now with the way that CIDER works with clojurescript it would be a good thing to support this from figwheel/start as well

I would suggest form now just starting your server from the script that launches your figwheel

In fact I really think the best pattern is to have a function in user called (defn figwheel and set your cider cljs-repl to that, and then for each project you can do arbitrary initialization

Oh gosh no worries I appreciate the help

I may test your example first again and then compare to my reframe setup