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?this is how its done, what isn't working?
when you have multiple build targets, sometimes cljs repl doesn’t seem to respond.
in the main app. but if you navigate to /devcards/ route - it works
A REPL is attached to a single build only. It tells you which build when it launches.
@ag: ^
ok… something prob. wrong with my setup here, I’ll investigate. Thanks!
@ag: Might be a dumb question, but does it only happen when you've just started figwheel?
it’s strange, cljs repl won’t respond on the main “dev” profile, unless I remove “devcards” profile from build-ids
but it works in devcards
https://clojurians.slack.com/archives/lein-figwheel/p1472163540000172 why can’t I have it in both builds?
when you run cljs-repl you just need to pass it the build id that you want the repl to start in
(cljs-repl :dev)
or (cljs-repl :devcards)
oh… ok… got it now
it still not working it gets stuck at "Prompt will show when Figwheel connects to your application"
😞
@ag when the repl launches what build is it saying its going to connect to?
it should say something like "Launching ClojureScript REPL for build: example"
@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
@darwin: is there any way that the profile merging could be duplicating builds?
good point, let me investigate it
@darwin: lein-pprint can help with this
in case you didn't know
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)
@bhauman oh I see, it’s always says the same thing:
(ra/cljs-repl :dev)
Launching ClojureScript REPL for build: devcards
OK hmmm well that's not working
do I have to have ids in strings or they have to be keywords?
oh yeah a string might do it
this functionality isn't used that often
gimme a sec, I restarted the repl, gonna try (ra/cljs-repl “dev”)
@darwin: gotcha
ok, found the issue, it is not really figwheel’s fault, but the error message is confusing
Yay! it worked!
I’m using this technique to enable/disable checkouts: https://github.com/binaryage/dirac/blob/master/project.clj#L347
@bhauman you’re awesome!
and that leads to empty :compiler {}
maps
so all degenerated build-ids have nil :output-dir
which is technically the same output dir
"out"
yep
this is also required by cljsbuild
ah but that is a different profile
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)
will find a way around it
man that sucks
I should have enforced this from day one...
@ag Thanks! Sorry for the trouble.
I didn't have a good validation framework to do it with.
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!
oh yeah that's what I like to hear
I did not know CLJS. Trying figwheel was like a revelation. Now I know - Clojurescript is better than javascript to build javascript apps
You are one of the few. Thanks!