Skip to content

Commit 787cd08

Browse files
committed
add (*) hot reload
1 parent 7ff64fd commit 787cd08

File tree

9 files changed

+75
-1
lines changed

9 files changed

+75
-1
lines changed

processor/src/main/kotlin/kotli/template/multiplatform/compose/MultiplatformComposeTemplateProcessor.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ import kotli.template.multiplatform.compose.platform.client.jvm.JvmPlatformProce
3737
import kotli.template.multiplatform.compose.platform.server.ServerPlatformProvider
3838
import kotli.template.multiplatform.compose.platform.shared.SharedPlatformProvider
3939
import kotli.template.multiplatform.compose.showcases.ShowcasesProvider
40+
import kotli.template.multiplatform.compose.testing.development.DevelopmentProvider
41+
import kotli.template.multiplatform.compose.testing.development.hotreload.HotReloadProcessor
4042
import kotli.template.multiplatform.compose.testing.logging.LoggingProvider
4143
import kotli.template.multiplatform.compose.userflow.auth.AuthProvider
4244
import kotli.template.multiplatform.compose.userflow.common.component.ComponentProvider
@@ -60,6 +62,7 @@ object MultiplatformComposeTemplateProcessor : BaseTemplateProcessor() {
6062
Feature(IOSPlatformProcessor.ID),
6163
Feature(AndroidPlatformProcessor.ID),
6264
Feature(JvmPlatformProcessor.ID),
65+
Feature(HotReloadProcessor.ID),
6366
Feature(ReadmeProcessor.getId())
6467
)
6568
)
@@ -104,6 +107,7 @@ object MultiplatformComposeTemplateProcessor : BaseTemplateProcessor() {
104107

105108
// testing
106109
LoggingProvider,
110+
DevelopmentProvider,
107111

108112
// guides
109113
DocumentationProvider,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package kotli.template.multiplatform.compose.testing.development
2+
3+
import kotli.engine.BaseFeatureProvider
4+
import kotli.engine.FeatureProcessor
5+
import kotli.engine.FeatureType
6+
import kotli.engine.model.FeatureTypes
7+
import kotli.template.multiplatform.compose.testing.development.hotreload.HotReloadProcessor
8+
9+
object DevelopmentProvider : BaseFeatureProvider() {
10+
11+
override fun getId(): String = "testing.development"
12+
override fun isMultiple(): Boolean = true
13+
override fun getType(): FeatureType = FeatureTypes.Testing
14+
override fun createProcessors(): List<FeatureProcessor> = listOf(
15+
HotReloadProcessor
16+
)
17+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package kotli.template.multiplatform.compose.testing.development.hotreload
2+
3+
import kotli.engine.BaseFeatureProcessor
4+
import kotli.engine.FeatureProcessor
5+
import kotli.engine.FeatureTag
6+
import kotli.engine.TemplateState
7+
import kotli.engine.model.FeatureTags
8+
import kotli.template.multiplatform.compose.Tags
9+
import kotli.template.multiplatform.compose.platform.client.jvm.JvmPlatformProcessor
10+
import kotlin.reflect.KClass
11+
import kotlin.time.Duration.Companion.minutes
12+
13+
object HotReloadProcessor : BaseFeatureProcessor() {
14+
15+
const val ID = "testing.development.hotreload"
16+
17+
override fun getId(): String = ID
18+
override fun getTags(): List<FeatureTag> = listOf(FeatureTags.Desktop)
19+
override fun getWebUrl(state: TemplateState): String = "https://github.com/JetBrains/compose-hot-reload"
20+
override fun getIntegrationUrl(state: TemplateState): String = "https://github.com/JetBrains/compose-hot-reload?tab=readme-ov-file#getting-started"
21+
override fun getIntegrationEstimate(state: TemplateState): Long = 30.minutes.inWholeMilliseconds
22+
23+
override fun dependencies(): List<KClass<out FeatureProcessor>> = listOf(
24+
JvmPlatformProcessor::class
25+
)
26+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make changes to your UI code in a Compose Multiplatform application and see the results in real time. No restarts required. Compose Hot Reload runs your application on the JetBrains Runtime and intelligently reloads your code whenever it is changed.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Compose Hot Reload
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Overview
2+
3+
The plugin is pre-configured in the `app` module.
4+
5+
To start your app in **Hot Reload** mode, simply run:
6+
7+
```
8+
./gradlew :app:runHot
9+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Development

template/RELEASE_NOTES.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Changed
2+
3+
- Updated **Compose Multiplatform** to version **1.8.0**, along with all required dependencies.
4+
- Renamed all UI-related classes in the `shared:presentation` module to be **Ds**-prefixed. They serve as the design
5+
system for the app and should be named accordingly (previously they used the **App** prefix).
6+
7+
## Added
8+
9+
- The wizard now includes a new **Dev Tool** called **Hot Reload**. Although it functions similarly to adding the
10+
`Desktop` target to the app, it is highlighted separately to ensure visibility for users unfamiliar with this feature.
11+
12+
## Removed
13+
14+
- The placeholder component has been removed from the wizard, as it is now part of the design system by default and is
15+
always provided (being a simple Modifier extension).

template/gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
agp = "8.4.2"
2+
agp = "8.10.0"
33
android-compileSdk = "35"
44
android-jvmTarget = "11"
55
android-minSdk = "24"

0 commit comments

Comments
 (0)