Jetpack Compose 1.13 lands with computedStateOf, recomposition tracing, and captured exit animations
Jetpack Compose 1.13 has finally arrived, corresponding to BOM 2026.11.01. It requires Kotlin 2.2 or newer and compileSdk 37.1, and Material 3 has also reached 1.5.0 stable.
This update is quite interesting. Although there are no major overhauls, the new features are all quite practical:
computedStateOf: Many states only need to compute a simple condition, and are not worth maintaining a computed cache for every time.- Recomposition tracing: Perfetto can now trace from a specific State write directly to the Recomposition it causes (Flutter is envious; Draft hasn't landed yet).
LazyLayoutCacheWindow: List preloading and off-screen retention are now uniformly controlled by layout, and can also be configured based on proportions of the visible area.CapturedAnimatedVisibility: Content doesn't have to stay in the Composition when it exits; the last frame can be allowed to continue completing the exit animation.
For example, putting these features into a common music list scenario makes them easy to understand: for instance, when the list is scrolling, the "Back to Top" button appears only after scrolling to the second item, then the user taps to open a song's details, closes the details, and immediately clears the selected song. In this way, state, lists, and exit animations can all occur on this path.
Currently, according to JetBrains' recent first net loss in 20 years of -315 million Czech koruna, and that was for 2025, it's hard to say how dramatic 2026 will be. Some people are quite doubtful about how many resources will be pushed toward KMP. It might as well be given back to Google.
1. computedStateOf does not cache results
Previously, handling conditions like "has the list left the top" typically used derivedStateOf; otherwise, reading scroll positions like firstVisibleItemScrollOffset directly in Composition could invalidate dependent Composables every pixel scrolled.
val listState = rememberLazyListState()
val showBackToTop by remember {
computedStateOf { listState.firstVisibleItemIndex > 0 }
}
For example, after the list has scrolled to item 10 and then scrolls to items 11, 12, firstVisibleItemIndex keeps changing, but showBackToTop remains true. Yet at this point Compose only needs to care about whether the condition's result has changed. It would be unreasonable to re-execute the dependent UI every time the input state changes.
computedStateOf by default decides whether to invalidate the dependent Composition based on whether the result is equal, while derivedStateOf, if using the overload without a policy, will still trigger updates when dependencies change. So to skip updates based on result equality, you need to use the overload with SnapshotMutationPolicy. Thus, the internal differences between the two are significant:
computedStateOf |
derivedStateOf |
|
|---|---|---|
| Computed result | Recomputes every read | Caches result; reuses when dependencies haven't changed |
| Frequent state changes | No result cache maintained; invalidation check is lighter | Must handle cache invalidation, recomputation, and write-back |
| Suitable for | Scroll thresholds, simple boolean conditions, lightweight mappings | Computations that are heavy and whose same result is read repeatedly |
So this isn't simply a matter of swapping a Kotlin Getter. Looking at the ComputedState.kt implementation, reading value executes the computation, and isInvalidFor(previousValue) recomputes the current value and then uses SnapshotMutationPolicy to determine whether the result truly changed.
In other words, although there is no result cache, Compose's state observation and ability to skip meaningless updates are still present.
Of course, the computed Lambda must be read-only and cannot modify State inside it, and it may be called multiple times due to state validity checks. So if it involves complex sorting, filtering, or needs to be read many times within a frame, derivedStateOf's cache is more valuable.
Another quite practical update is Recomposition tracing. Previously, seeing an abnormally high number of recompositions on a page might only tell you "which Composable executed again"; what you'd want to know is which write triggered it.
So this time, with the introduction of androidx.compose.runtime:runtime-tracing:1.13.0, you can use the official record_recomposition_trace.py to capture, and then Perfetto will record State reads/writes, write call stacks, and association arrows pointing from the write to related recompositions. It works as long as the device requires API 29 or above:
For example, if you see frequent writes from scroll state, and then discover that some expensive Composable keeps recomposing, you can continue to check whether it read state too early in the Composition phase that could have been deferred to the Layout or Draw phase.
However, this tracing additionally records strings and call stacks, which has high overhead. It suits diagnosing causes, not measuring real frame time with it enabled.
2. List preloading and destruction
Back to the music list example. When the list scrolls, if every new Item has to wait until it enters the screen to start Composition and Measure, a fast fling can easily pile work into the current frame. So Compose 1.13 stabilizes LazyLayoutCacheWindow, letting lists, grids, and waterfall layouts use the same window-based prefetch scheme.
Currently it works in two directions:
- ahead: Pre-composes and measures Items about to enter the screen
- behind: Temporarily keeps Items that just scrolled out, so they can be reused directly when the user scrolls back
For example:
LazyColumn(
state = listState,
cacheWindow = LazyLayoutCacheWindow(
aheadFraction = 0.5f,
behindFraction = 0.2f
)
) {
items(tracks) { track -> TrackRow(track) }
}
This configuration prefetches half a screen along the scroll direction and retains 20% of a screen in the reverse direction. The default strategy is already CacheWindow, which dynamically computes based on the average size of visible Items and keeps ahead between 10%~50% of the viewport. However, the default behind is 0, and the default strategy does not actively fill the cache in the non-scrolling state.
The explicit
LazyLayoutCacheWindow(...)constructor above does support non-scroll prefetch by default; these two default behaviors are different.
Additionally, the configuration entry moved from State parameters like rememberLazyListState(cacheWindow = ...) to layout parameters like LazyColumn(cacheWindow = ...).
This is actually reasonable: scroll position belongs to State, but deciding how much content to retain off-screen is a Layout task. However, increasing behind or ahead will consume more off-screen content and memory.
Then, if the user opens a song and taps close, and the business logic immediately sets selectedTrack to null, previously AnimatedVisibility still had to keep the exiting content in Composition until the animation finished. If the UI inside continues to depend on the cleared song, it could become blank, flicker, or even crash due to !!.
Now CapturedAnimatedVisibility changes the exit mechanism:
When
visiblebecomesfalse, it immediately removes the child Composition, and uses the last frame captured byGraphicsLayerto continue executing the exit transition. This way, business state can be cleared directly, and the animation no longer needs to keep reading that data.
In Google's exit-phase microbenchmark, CapturedAnimatedVisibility had roughly 7%~8% lower frame time than AnimatedVisibility.
However, what it leaves behind is a static rendered layer, meaning it will no longer respond to gestures during exit. Internal infinite animations, shared elements, etc., will also not continue updating, and child
Modifier.animateEnterExit()will not be supported as before.
3. Graphics API changes
The most straightforward graphics change is Progressive blur. Previously, Modifier.blur(radius) mainly blurred the entire content with the same radius. Now Modifier.blur { ... } can define linear or radial variations through BlurRadiusSpec, or even delegate to a custom AGSL RuntimeShader to generate blur radii.
For example, an album cover can be clear in the upper half and increasingly blurred toward the lower edge, determined during the Draw phase, without turning every change into a Composition task.
Then there's PolygonShape and MorphPolygonShape. Previously, to turn a button from a circle into a star, you would likely depend on graphics-shapes, manually generate a RoundedPolygon, convert it to a Path, and handle component sizing.
Now Foundation has wrapped geometric shapes as normal Shape, usable directly with Modifier.clip. Plus, the Morph progress Lambda is read during the Draw phase, so shape animations don't need to recompose the UI for every progress value:
Two more low-level changes:
VectorPainternow shares rasterized Draw Cache for the same staticImageVectorat the same size and configuration, reducing repeated bitmap allocations.Modifier.borderhad its implementation updated and now also supports usingRuntimeShaderasShaderBrushfor borders of various shapes.
4. Other changes
Layout APIs are also converging in this upgrade. FlexBox and Grid have moved from experimental to stable. The former now supports maxItemsInEachLine to limit the number of items per line. The official recommendation is to prefer FlexBox over FlowRow / FlowColumn for new code, while conversely the Compose versions of ConstraintLayout and MotionLayout are starting to be deprecated:
Then several upgrade points to watch:
| Change | Actual situation |
|---|---|
BasicTextField's value-based API and Material 2 TextField deprecated |
Migrate to TextFieldState; Material 3 1.5's value-based overloads are not yet deprecated, but the official recommendation is to migrate gradually |
LineHeightStyle.Mode.PerLine |
When a paragraph mixes different font sizes, or uses scripts like Myanmar, Khmer, or Thai, each line can determine its own line height, reducing overlap and clipping |
Modifier.onFocusedBoundsChanged |
Deprecated in 1.12, implementation removed in 1.13, continued use has no effect; custom containers should switch to focus node queries, onFocusChanged, and BringIntoViewRequester |
Modifier.clickable |
Will automatically play Android interaction sound effects per system settings; places that manually played click sounds need to be checked for duplication |
Compose UI test TestFailurePolicy |
On assertion failure, screenshots and Semantics tree can be automatically preserved, and custom Handlers can connect to CI diagnostics |
Officially, WebContent and the Compose A2UI Renderer were also introduced:
- The former is currently a separate
androidx.web:web:1.0.0-alpha01, separating web session state from concrete View and Activity. However, the current sample needs to be mounted viaAndroidView; the plannedWebSurfacethat bypasses this interop layer hasn't been released yet. - The latter is a separate
material3-a2ui:1.0.0-alpha02, allowing Agents to describe UIs according to the A2UI protocol and render them through controlled Compose components.
Finally, looking at performance numbers, Google used Pixel 6, Android 17, with locked CPU and GPU frequencies, to run cold start and list scroll tests on Pokedex's Compose and Views implementations:
| Metric | Compose 1.12.1 | Compose 1.13 | Views |
|---|---|---|---|
| TTID first frame display | 145.51 ms | 147.65 ms | 152.87 ms |
| TTFD full display | 201.96 ms | 202.79 ms | 180.32 ms |
| Scroll dropped frame rate | 0% | 0% | 0% |
In other words, in this test suite, 1.13 is essentially flat compared to 1.12.1, TTID first frame is about 3.4% faster than Views, but full display TTFD is still about 12.5% slower than Views. Additionally, the given scroll frame time P50 is Compose 3.51 ms vs Views 3.06 ms.
So Compose 1.13 is mainly a convergence for practicality, and upgrading is worthwhile.
Top 2 from juejin.cn, machine-translated. The original thread is authoritative.
It's all over. Since AI came along, I can't understand any of this stuff anymore.
Nice.