feat: Add stable class definitions for Meshtastic models#4500
Conversation
… libraries Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Jetpack Compose compiler stability configuration to treat additional Meshtastic models and external library types as “stable,” aiming to improve recomposition performance and support the project’s migration from Google Protobuf to Wire/Okio.
Changes:
- Adds stability entries for additional Meshtastic database/model classes and a wildcard for
org.meshtastic.core.model. - Updates protobuf-related stability configuration for Wire (
com.squareup.wire.Message) andokio.ByteString. - Expands stability coverage to Kotlin immutable collections,
java.time, and Google Maps model types.
| org.meshtastic.core.database.model.Message | ||
| org.meshtastic.core.database.entity.Reaction | ||
| org.meshtastic.core.database.entity.ReactionEntity | ||
| org.meshtastic.core.model.** |
There was a problem hiding this comment.
org.meshtastic.core.model.** is being marked as stable, but this package contains clearly mutable types (e.g., DataPacket and NodeInfo have many var properties). Treating mutable types as stable can cause Compose to skip recomposition incorrectly and lead to stale UI. Consider removing this wildcard and only listing specific immutable types (or annotating truly immutable models with @Immutable/@stable instead).
| org.meshtastic.core.model.** |
| java.time.* | ||
|
|
||
| // External Libraries | ||
| com.google.android.gms.maps.model.** |
There was a problem hiding this comment.
com.google.android.gms.maps.model.** is a very broad stability override. The Maps model package includes mutable builder/option types (e.g., *Options) alongside immutable value types (LatLng, CameraPosition). Marking the whole package stable risks incorrect recomposition if any mutable map model types are used. Prefer listing only the specific immutable classes you pass through Compose state/params.
| com.google.android.gms.maps.model.** | |
| com.google.android.gms.maps.model.LatLng | |
| com.google.android.gms.maps.model.CameraPosition | |
| com.google.android.gms.maps.model.LatLngBounds |
This pull request updates the
compose_compiler_config.conffile to improve stability handling for external models and libraries used in the project. The main changes focus on expanding the list of recognized stable classes, especially to accommodate migration from Google Protobuf to Wire, and to add support for additional models and libraries.Expanded stable class configuration:
Node,Message,Reaction, andReactionEntity, as well as all classes underorg.meshtastic.core.model.org.meshtastic.proto, replacingcom.google.protobuf.ByteStringwithcom.squareup.wire.Messageandokio.ByteString.Broader library support:
kotlinx.collections.immutable.*) and Java time classes (java.time.*) as stable.com.google.android.gms.maps.model.**).