Repository navigation
v0.21.0 #55
Origogi
announced in
Announcements
v0.21.0
#55
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Name a file in commonMain and its previews come up in the browser and redraw on save, the same way Android ones do — Kotlin Multiplatform and Compose Multiplatform modules work end to end. Prevue also gets going on a Mac without Android Studio, finding an installed JDK by itself and saying what is missing (Java or the Android SDK) before anything is approved, and saving stays under a second even when you pause between edits.
Kotlin Multiplatform
Prevue now draws commonMain previews of Kotlin Multiplatform and Compose Multiplatform modules. Like Android Studio, it draws them from the module's Android compilation, and iOS · web targets alongside are fine. It takes AGP 9's
com.android.kotlin.multiplatform.library(variantandroidMain) and the olderkotlin.multiplatform+com.android.librarypair. If you warmed up an app module with an earlier version, warm it up once more to pick all of this up.PartyAnimationPreviewfrom the commonMain of the KotlinConf app (Apache 2.0), opened in Prevue's interactive mode.includeBuild("components"), as in Thunderbird'scomponents/ui/bolt).expect·actual. Saving or opening a file withexpect·actualdeclarations says it needs a Gradle build. It used to try compiling and fail with "'expect' and 'actual' declarations can be used only in multiplatform projects" plus advice to warm up the module. Now the picture stays as it was, marked stale with "needs a Gradle build", and redraws on its own when the build outputs change. Opening such a file changed since the last Gradle build, or bringing back an empty tab by saving one, draws from the Gradle build with the same mark instead of failing.Res). Fonts, images and strings fromcomposeResourcesused to fail with "Missing resource … .cvr" or fall back to the default font. Prevue now takes the app's merged assets from the dump and draws them as the app does. A KMP module'ssrc/androidMain/resand manifest are also watched for resource changes.@Preview(org.jetbrains.compose.ui.tooling.preview.Preview) reads like the androidx one. Multipreview annotations built from it now expand, constants in its arguments (widthDp = WIDE) are read from the compiled class, and an aliased import still counts. Its@PreviewParameterproviders already worked.feature:pearl · commonMain · debug). In the open-files rail, a shared source set's file icon carries the Kotlin Multiplatform mark and a KMP module's androidMain an Android robot, in the official one-color logo (black, white in dark mode); Android-only files keep the plain file icon, and the icons are 18px. A shared source set's tab tooltip adds "Shared code · rendered with the Android build", and the first time you open such a file in a checkout, a note at the bottom says "commonMain renders with the app's Android build too. expect calls run the Android actual." until you close it (it steps aside while you look at other files).prevue statusgainskmp, andsourceSetfor the shown file and for each tab of a KMP module.Setup without Android Studio
PREVUE_JDK: a Mac with JDK 25 from Homebrew still stopped at "Java is missing", and with neither,healthreported only the server as missing andstartthen failed with "FileNotFoundError: [Errno 2] No such file or directory". Now, with noPREVUE_JDK, it looks at Android Studio (/Applicationsand~/Applications), thenJAVA_HOME,Library/Java/JavaVirtualMachines, Homebrew'sopenjdk*and SDKMAN, reading each JDK's version itself, and takes 25 first, then 21–24, then 26 or later. When none is 21 or later,healthlistsjdkundermissingfirst, before any download or Gradle run is approved, saying where it looked (jdkSearched) and to runbrew install openjdk@25(no sudo), andstartstops with the same message before it opens the preparation screen or touches a running server; call again after installing and it is found with nothing to set. A Java older than 21 counts as missing too, so aPREVUE_JDKpointing at JDK 17 no longer passeshealthonly for the server to fail after setup and warmup; the response names the version it found injdkVersion. Previews were byte-identical on Android Studio's JBR 25, Temurin 21 and Temurin 25; 25 or later starts about a second faster. Thanks to @Dwite for the fix (#29).healthsays so before anything is approved. The preview server draws against the SDK'sandroid.jar, found throughANDROID_HOME, thenANDROID_SDK_ROOT, then~/Library/Android/sdk. With none there, setup and warmup went ahead and the server then failed to start, leaving only "android.jar를 찾지 못했다" in its log. Nowhealthlistssdkundermissingright afterjdk, with the folder it checked and how to install the SDK, andstartstops with the same message before it opens the preparation screen. An SDK folder with no platform downloaded counts as missing, and an emptyANDROID_HOMEis skipped the same way by both.Performance
PageTitle.kt, a commonMain file). Now it keeps that environment between saves, as the Kotlin daemon does. On an Apple M4 Max, six to ten saves 30 seconds apart took a median of 0.64–0.79 s across four runs, against 0.63–1.19 s across five runs without it; a jar that Gradle rewrites in the meantime is still read fresh.Fixes
settings.gradle(or a settings plugin) moves a module withprojectDir—:widgetsliving incore/design/widgets— saving a file failed to compile with "Unresolved reference" because it borrowed the app's classpath, andwait·focus·scroll·touchanswered "No daemon" (#30). The dump now records each module's directory from settings, so warm up once more to pick it up. Thanks to @sergei-lapin for the report and the fix (#31).ui-toolingdoesn't pair with Prevue, the preview fails and names what's missing. If a project'sandroidx.compose.ui:ui-toolinglacked the tree accessor Prevue reads, the picture still came out but pointing at it found nothing, with only the warning "Compose 노드 없음 — 렌더는 성공했지만 Preview가 그린 노드가 없다", which blamed the preview. Now that render fails with "Couldn't read the Compose tree from ComposeViewAdapter — this project's androidx.compose.ui:ui-tooling doesn't pair with Prevue's renderer (ComposeViewAdapter.getViewInfos$ui_tooling is missing)". On the renderer side, the internals Prevue uses to load, preload and swap your classes are now opened when the server starts, and when any is missing it stops there listing all of them ("The renderer doesn't pair with this Prevue — couldn't open renderer internals: …"), instead of failing partway through a later render or save.startgives the reason. On the first start after installing or updating, the JVM writes its startup cache to the log after the server exits, so the error read "The daemon didn't start — Removed temporary AOT configuration file …". Now it quotes the server's own failure line.Thanks
@Dwite (#29) · @sergei-lapin (#30, #31)
This discussion was created from the release v0.21.0.
All reactions