figwheel-main

figwheel-main http://figwheel.org
practicalli-john 2019-08-27T07:20:57.079700Z

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

2019-08-27T07:37:31.080Z

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

danieroux 2019-08-27T07:52:46.082100Z

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.

danieroux 2019-08-27T07:53:17.082700Z

I tried (figwheel.main.watching/remove-watch! [:figwheel.main.api/autobuild build-id]) and my JVM ran out of heapspace, for some reason.

dominicm 2019-08-27T13:04:18.083600Z

I think https://figwheel.org/docs/scripting_api.html#repl-api-usage works from the repl

mauricio.szabo 2019-08-27T13:24:20.083800Z

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.

mauricio.szabo 2019-08-27T13:26:03.084200Z

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

mauricio.szabo 2019-08-27T13:28:24.084400Z

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

danieroux 2019-08-27T13:32:12.085700Z

@dominicm I’ve been down that path, and ultimately, start means to “watch and recompile”, which is what I want to suspend, sometimes.

dominicm 2019-08-27T13:52:41.086Z

What about stop?

danieroux 2019-08-27T14:09:24.086500Z

That does this:

[Figwheel] Stopping the Figwheel server
[Figwheel] Remove all repl listeners
… and then I can eval from the REPL anymore 😕

dominicm 2019-08-27T14:28:11.087300Z

Hmm, yeah. I could have sworn there was a stop-builders function at some point.

2019-08-27T20:11:35.087800Z

@danie when figwheel-main starts, there is this message:

2019-08-27T20:11:46.087900Z

1👍
2019-08-27T20:12:08.088500Z

to stop a build run (stop-builds "dev") -- if your build name is dev, otherwise use whatever your build id is.

2019-08-27T20:12:29.088900Z

to start it back run (start-builds "dev")

2019-08-27T20:17:58.089500Z

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.

2019-08-27T20:18:38.089700Z

the fact that JVM ran out of heapspace, means there is a bug in figwheel.main.watching, and should be investigated.

dominicm 2019-08-27T21:19:52.090200Z

That's the one!