valentinilk / compose-shimmer

A simple shimmer library for Jetpack Compose.
https://valentinilk.github.io/compose-shimmer/
Apache License 2.0
670 stars 37 forks source link

Use `Modifier.Node` API instead of `composed` #30

Closed lwasyl closed 3 months ago

lwasyl commented 7 months ago

According to the documentation, Modifier.composed is discouraged due to performance concerns. The recommended API is now Modifier.Node and friends: https://developer.android.com/develop/ui/compose/custom-modifiers#implement-custom, or alternatively (but not without downsides) a @Composable Modifier.modifierFactory(): Modifier factory function.

Have you looked into whether it's possible to migrate to either of the two approaches?

valentinilk commented 3 months ago

This change is finally included in 1.3.1. Unfortunately I still had to use a @Composable factory, but at least the composed modifier is gone. I tried to get rid of the factory as well, but it would have required too many changes.