boot-clj / boot-figreload

Boot task providing live-reload using Fighweel client
Eclipse Public License 1.0
49 stars 1 forks source link

How to enable reload of css in electron app? (actually problem in css @import) #14

Closed olegakbarov closed 6 years ago

olegakbarov commented 6 years ago

Hi there,

Using boot-figreload for electron-based app and having trouble autoreloading css. Should i somehow specify path to css files?

My build.boot can be found here: https://github.com/cryptounicorns/desktop/blob/master/build.boot

Thanks in advance!

arichiardi commented 6 years ago

In theory as long as they are on the classpath the watch should trigger and the css message sent to figwheel.

olegakbarov commented 6 years ago

Would be greatful for any advice, currently unable to make it work 😭

arichiardi commented 6 years ago

Sure, I am here, I just need some info. I have never worked with electron apps and as you might imagine I have not tested all platforms/tooling combinations.

I good starting point would be a minimal reproducible example.

olegakbarov commented 6 years ago

Yes, sure. Fortunately my project is opensource: https://github.com/cryptounicorns/desktop

Thank you for your time!

arichiardi commented 6 years ago

~I see you are not using boot-figreload there, are you?~

sorry it's down there

arichiardi commented 6 years ago

@olegakbarov There is a resource file main.cljs.edn, it should be in src: https://github.com/cryptounicorns/desktop/blob/master/resources/main.cljs.edn

arichiardi commented 6 years ago

It might end up in the same place, but it is worth trying putting it in src directly like https://github.com/arichiardi/figreload-demo/tree/master/src

Also by minimal repro usually you should use something minimal, without too many deps/interactions. This is because I don't have much time to debug your app directly but I will probably find the time to have a look at something smaller. For instance you could try reproducing the problem in https://github.com/arichiardi/figreload-demo. If it does not work there we can be sure that there is something going on in either boot-figreload or boot-cljs or interaction thereof. If it is working there we are more on going to dig on the electron side of the things. My first hunch being the channel (are other messages sent correctly? If you open the debugger -> Networks or equivalent which messages do you see on the Websocket?).

olegakbarov commented 6 years ago

Thanks, will try this on the weekend!

olegakbarov commented 6 years ago

Okay, spent way too much time but figured out that reload actually happens, but only for index.css. Files required via @import(....) trigger refresh of page, but css is not affected.

Thanks for your advices, anyway!

arichiardi commented 6 years ago

Yep we don't build any help tree for css. Probably not difficult to add.