lein-figwheel

ag 2016-08-25T18:34:48.000166Z

eh… sorry for maybe somewhat noob question. I am running figweel through sidecar feeding this config into it:

(def figwheel-config
  {:figwheel-options {:server-port 3333
                      :css-dirs ["resources/public"]
                      :ring-handler ‘my-app.server/app}
   :build-ids ["dev" "devcards"]
   :all-builds
   [{:id "dev"
     :figwheel true
     :source-paths ["src"]
     :compiler {:main “my-app.app"
                :asset-path "/js/out"
                :output-to "resources/public/js/main.js"
                :output-dir "resources/public/js/out"
                :parallel-build true
                :source-map-timestamp true
                :verbose true}}

    {:id "devcards"
     :figwheel {:devcards true}
     :source-paths ["src"]
     :compiler {:main           “my-app.devcards"
                :asset-path     "js/devcards_out"
                :output-to      "resources/public/js/devcards.js"
                :output-dir     "resources/public/js/devcards_out"
                :parallel-build true
                :source-map-timestamp true
                :verbose        true}}]})
something doesn’t feel right about this, and indeed sometimes it doesn’t work as intended. Can I have devcards as part of my “main” build profile?

bhauman 2016-08-25T20:08:11.000168Z

this is how its done, what isn't working?

ag 2016-08-25T21:15:18.000169Z

when you have multiple build targets, sometimes cljs repl doesn’t seem to respond.

ag 2016-08-25T21:15:44.000170Z

in the main app. but if you navigate to /devcards/ route - it works

bhauman 2016-08-25T22:19:00.000172Z

A REPL is attached to a single build only. It tells you which build when it launches.

bhauman 2016-08-25T22:19:10.000173Z

@ag: ^

ag 2016-08-25T22:20:12.000174Z

ok… something prob. wrong with my setup here, I’ll investigate. Thanks!

shaun-mahood 2016-08-25T22:24:09.000175Z

@ag: Might be a dumb question, but does it only happen when you've just started figwheel?

ag 2016-08-25T22:44:42.000176Z

it’s strange, cljs repl won’t respond on the main “dev” profile, unless I remove “devcards” profile from build-ids

ag 2016-08-25T22:44:52.000177Z

but it works in devcards

ag 2016-08-25T22:45:31.000178Z

https://clojurians.slack.com/archives/lein-figwheel/p1472163540000172 why can’t I have it in both builds?

bhauman 2016-08-25T22:48:52.000180Z

when you run cljs-repl you just need to pass it the build id that you want the repl to start in

bhauman 2016-08-25T22:48:56.000181Z

@ag

bhauman 2016-08-25T22:49:06.000182Z

(cljs-repl :dev)

bhauman 2016-08-25T22:49:16.000183Z

or (cljs-repl :devcards)

ag 2016-08-25T22:49:34.000184Z

oh… ok… got it now

ag 2016-08-25T22:52:09.000185Z

it still not working it gets stuck at "Prompt will show when Figwheel connects to your application"

ag 2016-08-25T22:52:11.000186Z

😞

bhauman 2016-08-25T22:53:58.000187Z

@ag when the repl launches what build is it saying its going to connect to?

bhauman 2016-08-25T22:55:08.000188Z

it should say something like "Launching ClojureScript REPL for build: example"

2016-08-25T22:56:08.000189Z

@bhauman: just upgraded to 0.5.6, now I hit another issue, figwheel is newly reporting "All ClojureScript build config :output-dir parameters should be unique” where :output-dir is clearly unique for all my build ids

bhauman 2016-08-25T22:57:20.000190Z

@darwin: is there any way that the profile merging could be duplicating builds?

2016-08-25T22:57:44.000191Z

good point, let me investigate it

bhauman 2016-08-25T23:00:27.000192Z

@darwin: lein-pprint can help with this

bhauman 2016-08-25T23:00:40.000193Z

in case you didn't know

2016-08-25T23:02:27.000194Z

yes, something fishy is going on there, that pprint is huge, but it looks like resulting EDN contains all profiles and final merged profile and that could be confusing figwheel (theory)

ag 2016-08-25T23:03:08.000195Z

@bhauman oh I see, it’s always says the same thing:

(ra/cljs-repl :dev)
Launching ClojureScript REPL for build: devcards

bhauman 2016-08-25T23:09:17.000196Z

OK hmmm well that's not working

ag 2016-08-25T23:10:03.000197Z

do I have to have ids in strings or they have to be keywords?

bhauman 2016-08-25T23:10:29.000198Z

oh yeah a string might do it

bhauman 2016-08-25T23:10:41.000199Z

this functionality isn't used that often

ag 2016-08-25T23:11:04.000200Z

gimme a sec, I restarted the repl, gonna try (ra/cljs-repl “dev”)

bhauman 2016-08-25T23:11:22.000201Z

@darwin: gotcha

2016-08-25T23:11:30.000202Z

ok, found the issue, it is not really figwheel’s fault, but the error message is confusing

ag 2016-08-25T23:11:43.000203Z

Yay! it worked!

2016-08-25T23:11:47.000204Z

I’m using this technique to enable/disable checkouts: https://github.com/binaryage/dirac/blob/master/project.clj#L347

ag 2016-08-25T23:11:51.000206Z

@bhauman you’re awesome!

2016-08-25T23:12:00.000208Z

and that leads to empty :compiler {} maps

2016-08-25T23:12:23.000210Z

so all degenerated build-ids have nil :output-dir

bhauman 2016-08-25T23:12:54.000211Z

which is technically the same output dir

bhauman 2016-08-25T23:13:01.000212Z

"out"

2016-08-25T23:13:10.000213Z

yep

bhauman 2016-08-25T23:13:28.000214Z

this is also required by cljsbuild

bhauman 2016-08-25T23:14:01.000215Z

ah but that is a different profile

2016-08-25T23:15:26.000216Z

I used this technique to avoid combinatorial explosion in my profiles, there does not seem to be a good way how to disable checkouts directory (for example for release testing)

2016-08-25T23:15:30.000217Z

will find a way around it

bhauman 2016-08-25T23:15:43.000218Z

man that sucks

bhauman 2016-08-25T23:16:07.000219Z

I should have enforced this from day one...

bhauman 2016-08-25T23:16:21.000220Z

@ag Thanks! Sorry for the trouble.

bhauman 2016-08-25T23:16:51.000221Z

I didn't have a good validation framework to do it with.

ag 2016-08-25T23:18:29.000222Z

You kidding me? Figwheel is awesome! One of the reasons why I quit my boring angularjsque work is due to figwheel. I bet my career on it and I am extremely happy!

3
bhauman 2016-08-25T23:18:50.000224Z

oh yeah that's what I like to hear

ag 2016-08-25T23:22:06.000226Z

I did not know CLJS. Trying figwheel was like a revelation. Now I know - Clojurescript is better than javascript to build javascript apps

bhauman 2016-08-25T23:24:19.000228Z

You are one of the few. Thanks!