Repository navigation
ADFA-7068 | Speed up Compose Preview and fix lost edits, ClassNotFoundException and comment parsing - #161
Merged
Conversation
…dException and comment parsing Keep one compiler daemon for the plugin instead of one per preview screen, and warm it when a Compose file is shown. Call D8 through the API that exists so dexing stays in the daemon. Clear the class output folder before each compile. Save the open file before opening the preview (adds filesystem.write). Dex the project's compiled classes in the plugin and key the preview cache on them, because Quick Build rewrites the build's dex output without them. Show why a build was refused, point at an unbuilt project on unresolved references, and ignore comments when looking for @Preview.
hal-eisen-adfa
left a comment
Contributor
There was a problem hiding this comment.
Review comments from reading the code. None has been reproduced on a device yet.
davidschachterADFA
added a commit
that referenced
this pull request
Nov 24, 2026
…and a rebuilt plugin-api.jar Brings in main at 16ece3e: ADFA-7213 (#169), ADFA-7214 (#170), CLAUDE.md versioning (#171), ADFA-7231 (#172), ADFA-6767 (#154), ADFA-7068 (#161), ADFA-7147 (#167), ADFA-7186 (#168), and the libs update from CodeOnTheGo@21b649d364f6. One conflict, libs/plugin-api.jar, the only file both sides changed. main's jar is built from CodeOnTheGo 21b649d36 (ADFA-3570, #2242: ProjectLifecycleListener and FileSaveListener); this branch's was built from sqlite-debugger/ADFA-7139 at 8e7473b76 (DebuggerEndpointService). Resolved by rebuilding the jar with :plugin-api:createPluginApiJar, as scripts/update-libs.sh does, from CodeOnTheGo 47512a2b6, the head of sqlite-debugger/ADFA-7139 (#2261), which contains 21b649d36. plugin-api is unchanged between 21b649d36 and stage at 759474fb7. Checked with javap -p over every class: against main's jar the new one only adds (DebuggerEndpoint, DebuggerEndpointService, the DEBUGGER_ENDPOINTS permission); against this branch's old jar it only adds (the two ADFA-3570 listeners and their add/remove methods), except that getEndpoints() now declares throws InterruptedException (CodeOnTheGo 4f1230a3e, after 8e7473b76). Kotlin compiles the call the same either way, and AutomaticServers.readEndpoints already catches it as a failed read. libs/gradle-plugin.jar is main's; this branch never changed it. This PR's own diff is unchanged apart from the jar. AI-Agent-MCP already bumps its version (2.0.0, versionCode 3), as #171's rule asks. Tests: AI-Agent-MCP testDebugUnitTest 350, 0 failures (350 at 744da89), assemblePlugin and the addons check, after a clean build. Its 9 Kotlin warnings are in its own code, which this merge does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADFA-7068
Jetpack Compose Preview plugin:
D8Command.parse(String[], Origin). The old reflective call named a method that does not exist, so dexing always fell back to a second JVM.filesystem.writepermission.ClassNotFoundExceptionat render.@Preview.Pixel 9 Pro, median tap to preview loaded after an edit: 6.1 s to 0.6 s (14 lines), 11.4 s to 1.9 s (98 lines), 18.5 s to 4.5 s (1,214 lines).
Limits: the daemon stops after 5 idle minutes, so the next preview is cold again.
@Previewinside a string literal is still matched. The plugin has no unit tests; the parser change was checked with a script outside the repo.