Fork me on GitHub
#figwheel-main
<
2018-08-16
>
euccastro01:08:48

newbie question: are figwheel-main reload hooks supposed to run on .clj files, .cljs ones, or both?

bhauman01:08:03

only cljs files

euccastro01:08:44

thanks! is there any kind of hook I can use on a file to, e.g., output .css from garden source .clj files, whenever I save these?

euccastro01:08:29

I know the object .css files will get live reloaded if they are in a watched directory, but does figwheel-main provide any way to automate their generation?

bhauman01:08:52

not yet but … you can use hawk https://github.com/wkf/hawk in a script that you can pass to clojure -init script.clj -m figwheel.main -b dev -r

bhauman01:08:23

and now you start to see how powerful these tools are

euccastro01:08:08

sweet, I'll look into that, thanks!

Richard09:08:52

@bhauman thanks a bunch for figwheel-main 0.1.6. Using the scripting API to work with cursive. Just used the documentation at: https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL and adjusted the script according to the scripting api specs at http://figwheel.com

onetom03:08:32

I was just looking into the same issue 2 days ago, but with figwheel.main and deps.edn setup + nREPL. I kinda got it work, but I'm not sure what's the most convenient way to reduce the number of interactions needed to fire this up. Currently I have to 1. start a clojure nREPL from a terminal with a fixed nREPL port 2. create a remote repl run config in intellij by manually specifying localhost and the port number 3. after connecting to the clj nrepl, i have to (fig/start {:mode :serve} "dev") (fig/cljs-repl (or build-id "dev")), but i put this into a (start) and (cljs-repl) function within src/user.clj 4. (figwheel.main/reset) and (figwheel.repl/conns) and similar functions throw a clojure.lang.Var$Unbound cannot be cast to clojure.lang.Associative error

onetom03:08:42

the goal with having an nREPL is that 1. Cursive have a better pretty-printing support when using an nREPL client 2. Other editors can use the same setup, because the remote nREPL mode is the most supported usually

bhauman12:08:41

@U086D6TBN this is unbound var is a bug

bhauman12:08:09

I’m pretty sure

bhauman13:08:58

yep this is a bug when using nREPL with the fig/cljs-repl function

bhauman13:08:30

@U086D6TBN you can fix this by just using (figwheel.main.api/start "dev")

bhauman13:08:27

no actually I’m not certain that will work either

bhauman16:08:01

I’ve figured out how to fix this

onetom17:08:48

i will try as soon as it's published!

onetom17:08:40

btw, sometimes i see the cards in a devcards page rendered twice when i refresh the browser page. my cljs-repl focus also seems to shift away from my non-background build, when i reload the devcards page, but it's restored when i refresh the foreground build. i have the feeling that this behaviour might be related to this bug too

bhauman18:08:23

this is interesting behavior as well