Fork me on GitHub
#emacs
<
2019-01-25
>
ag04:01:14

can someone share exact instructions how to get cider to work with figwheel-main pls. I’m trying to use piggieback but I don’t think it’s working…

ag04:01:38

so this clj -m figwheel.main -b dev -r works in cmdline… but I want to use cider

ag04:01:36

- so. I have these in my deps.edn

com.bhauman/figwheel-main {:mvn/version "0.2.1-SNAPSHOT"}
           cider/piggieback          {:mvn/version "0.3.10"}
- I have these in my dev.cljs.edn
:target :nodejs
 :repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}
but something seems to be missing ;(

dpsutton04:01:00

got a public repo i can try it with?

ag04:01:31

oh… nevermind… it seems I set cider-default-cljs-repl to be figwheel facepalm

dpsutton04:01:48

lol. make sure that's in dir-locals 🙂

ag04:01:45

yeah.. I just did…

dpsutton04:01:04

sorry for your pain

ag04:01:12

now… what do I need to set so it never prompts for default build e.g. dev?

dpsutton04:01:13

its frustrating when it works but doesn't quite

dpsutton04:01:19

not sure about that one

ag04:01:24

> sorry for your pain tis okay… life of a developer. inflicting pain to our brain and enjoying it is part of our nature I guess

dpsutton04:01:25

cider-figwheel-main-default-options ?

👀 5
dpsutton04:01:36

yes that's it

dpsutton04:01:41

i'm gonna add that to our work profile as well

dpsutton04:01:57

(defun cider-figwheel-main-init-form ()
  "Produce the figwheel-main ClojureScript init form."
  (let ((form "(do (require 'figwheel.main) (figwheel.main/start %s))")
        (options (string-trim
                  (or cider-figwheel-main-default-options
                      (read-from-minibuffer "Select figwheel-main build (e.g. :dev): ")))))
    (format form (cider-normalize-cljs-init-options options))))
you can see it used here

ag04:01:49

so what should it be? (setq cider-figwheel-main-default-options :dev) ?

ag04:01:57

that doesn’t look right

dpsutton04:01:45

i think it's a string

dpsutton04:01:55

but put that in dir locals don't globally set it

ag04:01:03

of course

ag04:01:06

hmm… just “dev” I think worked for me

ag04:01:18

maybe it’s the same…

dpsutton04:01:33

ah. it puts it on actually

dpsutton04:01:47

cider-normalize-cljs-init-options runs over it

dpsutton04:01:51

but yes it works either way

ag04:01:01

Thank you Dan. Whew.

ag04:01:48

sometimes I feel I’m back in javascriptland - things moving a bit too fast. but it’s a good thing… figwheel main and new nrepl and cider all these things are so effing dope

dpsutton04:01:05

i think figwheel main will be the standard for years (hopefully)

dpsutton04:01:17

super standard and boring

dpsutton04:01:32

it's very close to to just compiler options