There is a new article about shadow-cljs that looks interesting https://code.thheller.com/blog/shadow-cljs/2019/08/25/hot-reload-in-clojurescript.html
Thanks for always being so helpful @jr0cket 😊 ! Let me give some time to this setup sometime this week and circle back to you on the progress, the article does clear out a few doubts I had about the reloadable code, which is ideally what we want in the electron-cljs
workflow as well
How can I pause figwheel from watching? I would like to use the repl-env for a bit of RDD, and then switch back to figwheel auto-watching and compiling. Right now I stop my editor from automatically saving, which I don’t like.
I tried (figwheel.main.watching/remove-watch! [:figwheel.main.api/autobuild build-id])
and my JVM ran out of heapspace, for some reason.
I think https://figwheel.org/docs/scripting_api.html#repl-api-usage works from the repl
Ok, what I did was to create a JS project that would only load the Electron env, and activate node integration: https://github.com/mauricioszabo/repl-tooling/blob/master/integration.js Then I've configured a browser target: https://github.com/mauricioszabo/repl-tooling/blob/master/shadow-cljs.edn.
When I need to require things, I've used (js/require "my-dependency")
for example. There's a configuration for shadow-cljs to resolve these things to you so you can use the namespace format too
For example, you can configure a :browser target and add the configuration :js-options {:js-provider :require}
inside the browser target, so it'll emit require(...)
commands on the JS side
@dominicm I’ve been down that path, and ultimately, start
means to “watch and recompile”, which is what I want to suspend, sometimes.
What about stop?
That does this:
[Figwheel] Stopping the Figwheel server
[Figwheel] Remove all repl listeners
… and then I can eval from the REPL anymore 😕Hmm, yeah. I could have sworn there was a stop-builders function at some point.
@danie when figwheel-main starts, there is this message:
to stop a build run (stop-builds "dev")
-- if your build name is dev, otherwise use whatever your build id is.
to start it back run (start-builds "dev")
@danie take a look at this: https://github.com/bhauman/figwheel-main/blob/master/src/figwheel/main.cljc#L135
you've got the key name wrong, it should be :figwheel.main/autobuild
, instead of the :figwheel.main.api/autobuild
and instead of build-id
it should be sth like "dev". You can investigate by checkout out figwheel.main.watching/*watcher*
to see the correct id.
the fact that JVM ran out of heapspace, means there is a bug in figwheel.main.watching
, and should be investigated.
That's the one!