I'm testing the Compose stability plugin <https://...
# compose
t
I'm testing the Compose stability plugin https://github.com/skydoves/compose-stability-analyzer and noticed that it mark typealias as interface type, actual implementation could be mutable.
typealias SettingsButtons = @Composable (playerUiState: PlayerUiState) -> Unit
Is this a plugin / compose stability export issue or does using typealias really causes this and they should be avoided ?
s
I am pretty sure that plugin just copies the logic instead of using the compiler output (for a good reason fwiw) Also also, I don't see how we reasonably could affect lambda comparison with stability, it is compared with reference checks regardless
t
I'm sorry but you lost me at the second part. The plugin currently will say can't skip if one arg is a type alias because of "interface type, actual implementation could be mutable. but using the direct lambda definition is says all ok. Just trying to figure out if there's something to handle client side or they are both the same in the end and it's just the plugin / detection that does not match them correctly.
s
Yeah, it is wrong because strong skipping is a thing (and for some reason it is not a default in that IDE plugin)
At this point every restartable function is skippable, we just compare values by reference if they are unstable
Fwiw it is worth checking if typealias actually is stable in this case, might be a compiler bug too
t
Strong skipping is enabled in the plugin and I know about it and did some dumps checks a couple of times when trying to optimize tricky parts.
The plugin still says the same, the code is from Google Horologist https://github.com/google/horologist/blob/main/media/ui-material3/src/main/java/co[…]id/horologist/media/ui/material3/screens/player/PlayerScreen.kt, I'll try to find time to do the actual outputs from compiler and see what it says for this.
s
yeah, then in this case I am not sure why it says the function is not skippable, strong skipping always produces skippable functions
again, the only difference is the fact that parameters will be compared by reference instead of .equals, which is effectively the same for lambdas
t
Thanks will look at the compiler dumps and report to skydove.
stable mediaDisplay: Function3<@[ParameterName(name = 'playerUiState')] PlayerUiState, Composer, Int, Unit>? = @static <expression>
so yes it's a plugin issue.