2
votes

I am currently working on a sample app on Cordova with Clojurescript. I am using shadow-cljs to build the project but somehow I could not find a way to make the code reload to work.

Instead, I have to use the browser build when developing since it allows for a shorter feedback loop with the code reload. And then after that, I deploy the app to a device/emulator using the cordova command line.

Is there a way in shadow-cljs to make the code reload to work while using the device/emulator directly when developing ?

1

1 Answers

3
votes

I created a simple example using shadow-cljs with Cordova. I only tested the windows runtime but I'd assume that the others work as well.

It is all regular shadow-cljs the only special tweak in the config file is the :use-document-host false since by default it will try to use document.location and figure out where to connect from there. On Windows at least that is some ms-appx:// URL which cannot be used to connect the shadow-cljs websocket. So we disable the default which will make it use localhost instead. This works fine for Windows but other platforms might require tweaking the :devtools-url config option in case the generated "app" does not run on the same machine (eg. mobile device or emulator).