Repository navigation
Migrate the Compose snippets from Coil 2 to Coil 3 - #1216
Merged
Merged
Conversation
Coil 3 is multiplatform, so snippets that load images can also compile for the Compose Multiplatform (wasm) interactive previews. - Switch the coil.compose / coil.request imports in the 8 compose snippet files to coil3. AsyncImage and rememberAsyncImagePainter keep the same API; crossfade() is now an extension that needs its own import. - Replace io.coil-kt:coil-compose with io.coil-kt.coil3:coil-compose and coil-network-okhttp in compose/snippets (Coil 3 needs a network module to load URLs). The tv module still uses Coil 2.
Contributor
⚡ Jetpack Compose Performance ReviewNo Jetpack Compose performance issues were found in the changed code. The changes in |
riggaroo
enabled auto-merge (squash)
October 23, 2026 12:16
Contributor
⚡ Jetpack Compose Performance ReviewNo Jetpack Compose performance issues were found in the changed code. The changes in
No newly introduced or modified code ( |
romanofranz
approved these changes
Oct 26, 2026
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.
Migrates the Compose snippets in
compose/snippetsfrom Coil 2 to Coil 3.Coil 3 is multiplatform, so snippets that load images can also compile for the Compose Multiplatform (wasm) interactive previews (see #1215, which already moves
AnimationQuickGuide.kt).Changes
coil.compose.*becomescoil3.compose.*, andcoil.request.ImageRequestbecomescoil3.request.ImageRequest.AsyncImage,rememberAsyncImagePainterandImageRequest.Builderkeep the same API. The one addition isimport coil3.request.crossfade, becausecrossfade()is now an extension function (SharedElementCommonUseCaseSnippets.kt).AnimationQuickGuide.kt,SharedElementCommonUseCaseSnippets.kt,LoadingImagesSnippets.kt,ComposeWithOtherLibraries.kt,PagerSnippets.kt,LazyListSnippets.kt,NestedScrollingItem.kt,TapAndPress.ktcompose/snippetsreplacesio.coil-kt:coil-compose:2.7.0withio.coil-kt.coil3:coil-compose:3.6.3, pluscoil-network-okhttp. Coil 3 doesn't load network URLs without a network module.tvmodule still uses Coil 2 (3 files), so thecoil-kt-composecatalog entry stays for now.No code inside the snippet regions changes, only imports, so the DAC pages show the same code. The DAC quick guides that list
io.coil-kt:coil-compose:2.6.0as a dependency are updated in a separate CL.Testing
./gradlew :compose:snippets:compileDebugKotlinpasses.NestedScrollingRowsListin a Robolectric/Roborazzi test with real network URLs. Coil 3 fetched the images with OkHttp and drew them in theAsyncImages, the same result as Coil 2 onmain.ImageDecoderon Coil's background threads; it aborts withClass not found: java/nio/ShortBuffer. So the test used Coil'sBitmapFactoryDecoder. Coil 3 defaults toImageDecoderon these API levels, so this is a limitation of the test environment, not something that affects devices. The test wasn't committed.