compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

FR: Support Hot Reload for JVM Desktop

Open ScottPierce opened this issue 4 years ago • 4 comments

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.

ScottPierce avatar Dec 15 '21 21:12 ScottPierce

You mean hot reload for preview?

akurasov avatar Dec 16 '21 08:12 akurasov

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.

ScottPierce avatar Dec 16 '21 16:12 ScottPierce

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

alexjpwalker avatar Aug 17 '22 14:08 alexjpwalker

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

3xau1o avatar Mar 08 '24 23:03 3xau1o

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov avatar Jul 14 '24 14:07 okushnikov