Skip to content

Add Compose HotSwan for Compose hot reload - #294

Closed
joreilly wants to merge 1 commit into
mainfrom
add-hotswan
Closed

joreilly wants to merge 1 commit into
mainfrom
add-hotswan

Conversation

@joreilly

Copy link
Copy Markdown
Owner

Summary

Adds the Compose HotSwan compiler plugin (2.0.0, latest stable on Maven Central).

Per HotSwan's KMP guide, the plugin goes on exactly two modules — the Android application module and the module declaring binaries.framework:

  • :androidApp — the Android application module
  • :composeApp — declares the iOS framework (and holds all the shared Compose UI)
  • root build.gradle.kts — registered apply false

:composeApp is also the desktop app, so its jvmMain picks up interpreter-runtime-core, which the docs require on the desktop classpath.

Heads-up: this is a paid, proprietary product

The Maven artifacts are published under the "Compose HotSwan License (Commercial)", not an OSS license. Hot reload needs both the matching JetBrains IDE plugin and a valid subscription billed through JetBrains Marketplace; the version must match the Gradle plugin's. Since this is a public sample repo, anyone building it now resolves a proprietary compile-time artifact. The build itself works fine unlicensed — hot reload is just inactive — so CI and contributors are not blocked.

Test plan

  • assembleDebug, :composeApp:jvmTest, compileKotlinIosSimulatorArm64, compileKotlinWasmJs, :agents:build, :mcp-server:build all pass
  • Verified the build succeeds with no license or IDE plugin present locally
  • CI green
  • Install the IDE plugin (Settings → Plugins → Marketplace → "Compose HotSwan") and point Settings → Tools → Compose HotSwan at :androidApp — cannot be automated

Known limitation it flagged

The plugin warns at compile time that iOS hot reload will silently no-op for two entry points, because its warm restart calls the entry as a zero-argument Obj-C class method:

  • CountryListViewController(onCountryClicked:) — note this parameter is currently unused in the body
  • CountryInfoDetailedViewController(country:)

AgentViewController() already has the required shape. Changing the other two touches the Swift call sites, so it is left out of this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ReoMX8TjLpTkCocLiLVTuL

Wires the HotSwan compiler plugin into the two modules its KMP guide calls
for: :androidApp as the Android application module, and :composeApp as the
module declaring the iOS binaries.framework. :composeApp doubles as the
desktop app, so it also picks up interpreter-runtime-core, which desktop
hot reload needs on the classpath.

Using HotSwan needs the matching IDE plugin and a paid subscription; the
Gradle side builds fine without either, with hot reload simply inactive.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ReoMX8TjLpTkCocLiLVTuL
@joreilly joreilly closed this Sep 13, 2026
@joreilly
joreilly deleted the add-hotswan branch September 13, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant