I built an open-source tool to edit Jetpack Compose on-device via AST mutations (No Gradle rebuilds)
Описание и применение
ComposeBridge позволяет редактировать UI Jetpack Compose на устройстве, автоматически мутируя исходный код через AST, с визуальным просмотром изменений и OTA‑сборкой, ускоряя цикл разработки.
Задача
Android developers face a slow iteration loop in Jetpack Compose: Live Edit is volatile and full Gradle rebuilds are time‑consuming.
Результат
ComposeBridge decouples UI tuning from the workstation, enabling permanent, compile‑ready source mutations from a device, with visual diff review and OTA Gradle builds, reducing iteration time from minutes to seconds.
Рабочий процесс
- 1. Connect device to host via encrypted tunnel.
- 2. Adjust UI token or modifier on the device UI.
- 3. ComposeBridge daemon receives delta and uses Tree‑sitter to parse Kotlin source.
- 4. Daemon locates the Composable call site and mutates the source file on disk.
- 5. Modified files are buffered and visual diffs are shown on the device.
- 6. User accepts or rolls back changes via the phone UI.
- 7. When ready, trigger a headless Gradle build remotely; progress streams to the phone.
- 8. Compiled APK is pushed and installed OTA.
Доказательства
ComposeBridge isn’t just an in‑memory preview swapper. It applies permanent, compile‑ready modifications:
When you adjust a UI token or modifier on your physical device, the operational delta is sent back to your host machine over an encrypted tunnel.
A headless background daemon uses Tree‑sitter to parse the Kotlin source tree, locate the exact Composable call site, and safely mutate the source file directly on disk.
When you’re ready for a full run, trigger a headless Gradle build remotely. The progress is streamed back to your phone, and the compiled APK is pushed and installed over‑the‑air.
- Дата записи: 2026-10-26T06:11:21.061Z