How to mark external classes (imported from librar...
# compose
m
How to mark external classes (imported from libraries or modules which don't depend on compose) as
Stable/Immutable
? I know that the public properties of that classes won't change
a
Unfortunately you can't yet, but we recognize the need to be able to maintain a side channel list of these that you can provide to compose
we're also looking at inferring these on some level, which should alleviate at least some cases where this is needed today
m
Is something like this possible or it would just be a hideous workaround?
Copy code
@Stable
typealias StableClass = Class
a
I don't think that works? @Leland Richardson [G] would know for sure though
l
it wouldn’t work, no
but we are working on a solution to handle this in a more general way to where you (ideally) don’t have to do this, and if you do, it will be possible in some way (bot probably not through a typealias like you’re proposing here)
❤️ 1
j
@Leland Richardson [G] Obviously this isn’t ideal, but would creating a simple wrapper object in the compose module allow this? Something like
Copy code
@Stable
data class Wrapper(val model: Model)
m
I used that workaround but reading the documentation of
StableMarker
I get confused because it's written that all the public properties of a stable class must be stable