figwheel

general discussion about figwheel, specific discussions in #figwheel-main and #lein-figwheel
bhauman 2018-06-16T03:16:40.000094Z

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

chadhs 2018-06-16T03:35:19.000085Z

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

bhauman 2018-06-16T03:38:05.000026Z

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

bhauman 2018-06-16T03:39:21.000048Z

oh RING server

bhauman 2018-06-16T03:39:24.000019Z

sorry

bhauman 2018-06-16T03:39:34.000036Z

been travelling all day

bhauman 2018-06-16T03:41:13.000033Z

OK you are using the separate server setup

chadhs 2018-06-16T13:08:18.000004Z

@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

chadhs 2018-06-16T13:10:51.000086Z

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

chadhs 2018-06-16T13:11:13.000015Z

it does work with lein figwheel

bhauman 2018-06-16T20:02:36.000104Z

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

bhauman 2018-06-16T20:05:22.000063Z

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

bhauman 2018-06-16T20:06:32.000034Z

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

bhauman 2018-06-16T20:08:10.000032Z

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

bhauman 2018-06-16T20:09:40.000025Z

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

chadhs 2018-06-18T12:14:08.000247Z

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

๐Ÿ‘ 1
chadhs 2018-06-22T20:19:57.000569Z

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

chadhs 2018-06-22T20:49:15.000075Z

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

bhauman 2018-06-22T20:51:39.000089Z

@chadhs yep, that should do it

chadhs 2018-06-22T20:52:15.000137Z

and in dev/user.clj

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

๐Ÿ‘ 1
chadhs 2018-06-22T20:52:25.000086Z

coolio thnx

chadhs 2018-06-16T04:00:09.000118Z

Oh gosh no worries I appreciate the help

chadhs 2018-06-16T04:00:42.000025Z

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

chadhs 2018-06-16T04:01:10.000059Z

If curious Iโ€™m tinkering here https://github.com/chadhs/ccclock/pull/13/files