jetc.dev Newsletter Issue #297

Published: 2025-01-13

This week, we look at memory leaks, image-loading libraries, and screenshot testing. Plus, we see a full-fledged SVG renderer for Compose Multiplatform.

One Off the Stack, One Off the Slack

You’ve got questions. That’s understandable!

Alas, the archive of Kotinlang Slack seems to be far behind in its updates. 😞

Why Does My Placeholder Fail to Compile?

Sometimes, it is a bit of a guessing game as to whether a particular slot parameter is taking raw content (e.g., a String) or a composable rendering of the content. With several overloads of foundation composables, determining which overload is the one you are aiming for can be annoying. See one concrete case of this in this week’s highlighted Stack Overflow question.

Composable Commentary

Posts, videos, and other new information related to Jetpack Compose!

Jetpack Compose Memory Leaks: A Reference-Graph Deep Dive

Mohan Sankaran writes: “Leaks happen when composition-scoped references escape into longer-lived holders.” Mohan then demonstrates several scenarios where this can happen, including viewmodels, callbacks, GlobalScope, and more.

Medium: Announcing Landscapist Core: A New Image Loading Library for Android & Compose Multiplatform

Jaewoong Eum (Mastodon, Bluesky) created a new image-loading library for Kotlin Multiplatform (Landscapist Core) and a Compose Multiplatform wrapper (Landscapist Image). This post explains the rationale behind creating another image-loading library and Landscapist Core’s architecture.

Medium: Building AsyncPic: A Premium Image Loading Library for Jetpack Compose

Paras Patil has also been building an image-loading library, AsyncPic, for Compose for Android. This post outlines what gaps AsyncPic was designed to fill, such as a built-in shimmer loading effect.

Medium: Mastering Pagers in Android Jetpack Compose

Oğuzhan Aslan brings us a deep dive into using HorizontalPager() and VerticalPager(), including exploring many of the options with PagerState, controlling the page size and snap position, spacing and padding, and more.

Medium: The Easiest Way to Add Haptic Feedback in Compose Multiplatform

Suhyeon (Leah) Kim writes about Jindong, a Compose Multiplatform library for implementing haptics using a Compose-style declarative API.

Medium: Visual Testing: Compose Screenshots and Konsist

Lukasz Cisek demonstrates the use of Google’s Compose Screenshot Testing plugin, then using Konsist to help enforce the declaration of screenshot tests, so they are not accidentally missed.

Resource Roundup

100% pure code!

GitHub: xuwakao / Vekt

GitHub user xuwakao created an SVG parser and renderer for Compose Multiplatform, supporting all targets. Rather than convert SVG subsets into ImageVector objects, this library directly renders the SVGs, and so is not limited by ImageVector’s capabilities.

GitHub: terrakok / navigation3-browser

GitHub user terrakok brings us a small library to tie Nav3’s back-navigation support with browser history on Compose Multiplatform Web targets.

GitHub: unchil / ComposeDataGrid

UnChil Yeo created a data grid for Compose Multiplatform, supporting all targets. It has a vast array of features for managing rows and columns, including filtering, sorting, and reordering of columns.

GitHub: timoseyfarth / compose-shimmer-skeleton

Timo Seyfarth built a shimmer modifier implementation for Compose Multiplatform, supporting all non-Web targets.

Notable Releases

Compose Unstyled is up to 1.49.5, adding onTextLayout to the Text() composable, fixing an iOS Dialog() bug, and beginning to rename all components to have an Unstyled prefix on the composable name.