{"id":17767657,"url":"https://github.com/JetBrains/compose-hot-reload","last_synced_at":"2025-05-11T06:31:00.403Z","repository":{"id":258629365,"uuid":"874274681","full_name":"sellmair/compose-hot-reload","owner":"sellmair","description":"Experimental: JetBrains Compose Hot Reload","archived":false,"fork":false,"pushed_at":"2024-11-12T08:12:44.000Z","size":548,"stargazers_count":86,"open_issues_count":8,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-12T09:21:10.704Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sellmair.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-17T14:40:37.000Z","updated_at":"2024-11-12T08:12:48.000Z","dependencies_parsed_at":"2024-10-26T21:16:03.096Z","dependency_job_id":"e26d94c3-2ece-4996-91b4-b49ceec0ed78","html_url":"https://github.com/sellmair/compose-hot-reload","commit_stats":null,"previous_names":["sellmair/compose-hot-reload"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sellmair%2Fcompose-hot-reload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sellmair%2Fcompose-hot-reload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sellmair%2Fcompose-hot-reload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sellmair%2Fcompose-hot-reload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sellmair","download_url":"https://codeload.github.com/sellmair/compose-hot-reload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224970102,"owners_count":17400294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-26T20:50:15.773Z","updated_at":"2025-05-11T06:31:00.397Z","avatar_url":"https://github.com/sellmair.png","language":"Kotlin","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# 🔥 Compose Hot Reload\n\n[![JetBrains team project](https://jb.gg/badges/incubator.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)\n\nIterate on your Compose UIs faster, and let your creativity run free when building multiplatform user interfaces.\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./readme-assets/banner_dark.png\"\u003e\n  \u003cimg alt=\"Text changing depending on mode. Light: 'So light!' Dark: 'So dark!'\" src=\"./readme-assets/banner_light.png\"\u003e\n\u003c/picture\u003e\n\nMake changes to your UI code in a Compose Multiplatform application and see the results in real time. \nNo restarts required.\nCompose Hot Reload runs your application on the JetBrains Runtime \nand intelligently reloads your code whenever it is changed.\n\n## Getting Started\n\n### Requirements\n- A Compose Multiplatform project with a desktop target (see [FAQ](#faq))\n- Kotlin `2.1.20` or higher\n\n### Apply the Gradle plugin to your project\n\nAdd the `org.jetbrains.compose.hot-reload` Gradle plugin to your build script:\n\n```kotlin\nplugins {\n    kotlin(\"multiplatform\") version \"2.1.20\" // \u003c- Use Kotlin 2.1.20 or higher!\n    kotlin(\"plugin.compose\") version \"2.1.20\" // \u003c- Use Compose Compiler Plugin 2.1.20 or higher!\n    id(\"org.jetbrains.compose\")\n    id(\"org.jetbrains.compose.hot-reload\") version \"1.0.0-alpha09\" // \u003c- add this additionally\n}\n```\n\n### Run the application\n#### Multiplatform + IntelliJ\nUsing Kotlin Multiplatform and IntelliJ, launching your app is as simple as pressing 'run' on your main function:\n\u003cimg alt=\"IntelliJ Run Gutter\" src=\"./readme-assets/run-gutter.png\"\u003e\n\n#### Launch from Gradle task\nThe plugin will create the following tasks to launch the application in 'hot reload mode':\n- `:jvmRunHot`: Multiplatform, async alternative (`jvmRunHotAsync`)\n- `:runHot`: Kotlin/JVM, async alternative (`runHotAsync`)\n\nThe tasks 'mainClass' can be configured in the buildscript\n```kotlin\ntasks.withType\u003cComposeHotRun\u003e().configureEach {\n    mainClass.set(\"com.example.MainKt\")\n}\n```\n\nor provided when invoking the task\n```shell\n./gradlew jvmRunHot --mainClass=com.example.MainKt\n```\n\n### Enable 'OptimizeNonSkippingGroups':\nNote: This optimization is not required, but will lead to a better user experience.\nIt is expected that the feature will be enabled by default in future versions of the compiler.\n\nAdd the following to your `build.gradle.kts`:\n\n```kotlin\nimport org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag\n\n// ...\n\ncomposeCompiler {\n    featureFlags.add(ComposeFeatureFlag.OptimizeNonSkippingGroups)\n}\n```\n\n### Set up automatic provisioning of the JetBrains Runtime (JBR) via Gradle\n\n\u003e [!IMPORTANT]  \n\u003e To use the full functionality of Compose Hot Reload, your project **must** run on the JetBrains Runtime (JBR, an OpenJDK fork that supports enhanced class redefinition).\n\nGradle can perform the download and setup for the JBR automatically for you via [Gradle Toolchains](https://github.com/gradle/foojay-toolchains).\n\nAdd the following to your `settings.gradle.kts`:\n```kotlin\nplugins {\n    id(\"org.gradle.toolchains.foojay-resolver-convention\") version \"0.10.0\"\n}\n```\nThe Compose Hot Reload Gradle plugin will then use this resolver to automatically provision a compatible JDK.\n\n\n## FAQ\n\n### My multiplatform project doesn't have a Desktop target. Can I use Compose Hot Reload?\n\nTo use Compose Hot Reload, you'll have to add a module to your project that does configure a desktop target. It's worth noting that you will only be able to hot-reload code that can be run on the desktop JVM target. A possible setup might be the following:\n- A `ui-components` module that specifies platform-agnostic UI components.\n- A `gallery` module with a configured desktop target and Compose Hot Reload.\n\n### I am developing an Android application and am not using Kotlin Multiplatform. Can I use Compose Hot Reload?\n\nCompose Hot Reload is designed to work with Compose Multiplatform. If you'd like to use Compose Hot Reload with an Android-only project, you will have to:\n\n- Switch from the Jetpack Compose plugin to the Compose Multiplatform plugin.\n- Add a separate Gradle module and configure the `desktop` target according to the instructions above.\n\n### My project is a desktop-only app with Compose Multiplatform. Can I use Compose Hot Reload?\n\nYes! However, please note that you can't start the application via the run button in the gutter ([CMP-3123](https://youtrack.jetbrains.com/issue/CMP-3123)). Instead, use the custom Gradle task as described above.\n\n\n## Using 'dev' builds\nThe project publishes dev builds. To obtain the 'dev' Compose Hot Reload artifacts, first add the `firework` Maven repository:\nIn your projects' `settings.gradle.kts`, add the following:\n\n```kotlin\npluginManagement {\n    repositories {\n        maven(\"https://packages.jetbrains.team/maven/p/firework/dev\")\n    }\n}\n\ndependencyResolutionManagement {\n    repositories {\n        maven(\"https://packages.jetbrains.team/maven/p/firework/dev\")\n    }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJetBrains%2Fcompose-hot-reload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJetBrains%2Fcompose-hot-reload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJetBrains%2Fcompose-hot-reload/lists"}