Suave live reload
Spike – something to get you started if you want to pick this issue to work at.
Whenever the user changes a .fs file, the server should recompile and reload. It needs to be in a separate process to make it work consistently with different DLL versions.
I have a prototype of this working. I created an application called Suave.ActiveServer that can be run from the command line to continuously build and serve an application under development. My implementation can be found here: [https://github.com/JohnDoeKyrgyz/suave/commit/10a728251349ca2684fdc1c7a140d235fed8a945]
This is just a prototype so far. I would be interested in some code review / feedback / suggestions to improve this before it becomes a pull request.
@JohnDoeKyrgyz Nice :) Give me a couple of evenings and I'll do a review of it!
We already have suave live reloading working with a FAKE build around it. See fsreveal
I have seen it, a lot of this is fetched from there. But it depends on FAKE and it only works with fsx files not DLLs.
Just for reference, since usually live-reloading is only done in development, I handle it like this: https://github.com/Banashek/Universal-FSharp-Samples/blob/master/UniversalLiveReloading/src/App.fs . And use a port-incrementing approach to avoid socketexceptions only when the DEVELOPMENT=true environment variable is set.
This is with dotnet core, so I can run dotnet watch run and it will auto restart the suave application, though on another port since the old port is not freed early enough to rebind to.