FR: Support Hot Reload for JVM Desktop
I'm not sure if this is a duplicate, but it'd be great if we could get hot reload support for JVM Desktop for Desktop Compose. Hot Reload is an important part of the dev flow.
You mean hot reload for preview?
I mean, I want that too. Almost all my UI is in the common layer though. I filed a request to get previews working on the common layer. Without them, I've actually never used Preview before - https://github.com/JetBrains/compose-jb/issues/1603
This was more around being able to hot reload the code for UI changes so that I don't have to restart the entire app and navigate back to where I was, similar to what Android, and Flutter provide.
We'd also like to see hot reload in action! ie: when the code changes, reload the app automatically while preserving as much of the state as possible, to speed up the development workflow. This is provided in many Web frameworks such as Angular and React.js.
There are relevant pages suggesting that Jetpack Compose for Android already supports this:
- https://betterprogramming.pub/exploring-jetpack-composes-hot-reload-feature-3fdb5fa43ba1
- https://stackoverflow.com/questions/70567310/is-there-hot-reload-in-jetpack-like-flutter
Some jvm based desktop projects feature similar app refresh behaviors:
Libgdx hot swapping
Hot swapping code is a feature that allows one to compile and swap code during runtime debugging
OpenRNDR live reload video demo
By using Kotlin’s ability to run script files we can build a live coding environment.
Setup info https://vaadin.com/docs/latest/configuration/live-reload/hotswap-agent
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.