lydavid / MusicSearch

An Android app for browsing songs, artists, and anything related to them
Apache License 2.0
19 stars 0 forks source link

`Instant` are treated as unstable #992

Closed lydavid closed 1 week ago

lydavid commented 1 week ago

https://developer.android.com/develop/ui/compose/performance/stability/fix#modules-solution cause Instant comes from an external library without Compose compiler

When using layout inspector, the ThumbnailImage for each lookup history is set ablaze with blue, continuously recomposing. This was actually because of https://github.com/lydavid/MusicSearch/pull/990/files#diff-1c37605393d9de698bd9c0cb8ce1979525f40ef6f5f03201306c372a00fa1e0a

Ex

unstable class LookupHistoryListItemModel {
  stable val id: String
  stable val title: String
  stable val entity: MusicBrainzEntity
  stable val numberOfVisits: Int
  unstable val lastAccessed: Instant
  stable val imageUrl: String?
  <runtime stability> = Unstable
}
lydavid commented 1 week ago

Whether this is unstable or not does not affect recomposition counts, so we don't have to bother with this