bhauman / lein-figwheel

Figwheel builds your ClojureScript code and hot loads it into the browser as you are coding!
Eclipse Public License 1.0
2.88k stars 209 forks source link

Looking for a `:build-to-focus` option? #600

Closed au-phiware closed 6 years ago

au-phiware commented 7 years ago

I note this comment:

choosing which build for the repl to focus on is a bit tricky

sidecar/src/figwheel_sidecar/system.clj#L525

May I propose a simple config setting (along side :builds-to-start) that directs figwheel to choose a specified build to focus on during startup?

I have tried all sorts of things to influence the first build that is chosen when the figwheel repl starts. I have resorted to using a sorted map in my project.clj and renaming my build id to :!start, this signifies and ensures that it is the first (as opposed to :app).

Perhaps a new config setting is too verbose, perhaps the order of the build ids in :builds-to-start could be respected. I.e. whilst in choose-repl-build-id the first id is chosen from a filtered :builds-to-start vector (although this seems to be the case already in narrow-builds*).

Leiningen 2.7.1 on Java 1.8.0_131 OpenJDK 64-Bit Server VM
  [lein-figwheel "0.5.13"]
  [figwheel-sidecar "0.5.13"]
bhauman commented 7 years ago

Yes this makes sense. If you use an vector for the builds instead of a map then the first build is known. This should work for maps as well unless you have a lot of builds.

However a :build-to-focus param does make sense.

au-phiware commented 7 years ago

If I use a vector, will leiningen's profiling still work? I had assumed not, but I didn't actually try...

bhauman commented 7 years ago

Good assumption, profiles won't work

On Sep 4, 2017, at 6:54 AM, Corin Lawson notifications@github.com wrote:

If I use a vector, will leiningen's profiling still work? I had assumed not, but I didn't actually try...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

bhauman commented 6 years ago

Actually the order in builds to start should be respected as you suggest, and the first one should be the focus build.

bhauman commented 6 years ago

The first build in :builds-to-start will become the focused build for the REPL