Skip to content

feat: Add stable class definitions for Meshtastic models#4500

Merged
jamesarich merged 1 commit into
mainfrom
feat/compose-wire-stable-classes
Feb 7, 2026
Merged

feat: Add stable class definitions for Meshtastic models#4500
jamesarich merged 1 commit into
mainfrom
feat/compose-wire-stable-classes

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

This pull request updates the compose_compiler_config.conf file 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:

  • Added Meshtastic model classes, including Node, Message, Reaction, and ReactionEntity, as well as all classes under org.meshtastic.core.model.
  • Added support for Wire/Protocol Buffers migration by recognizing all classes under org.meshtastic.proto, replacing com.google.protobuf.ByteString with com.squareup.wire.Message and okio.ByteString.

Broader library support:

  • Included Kotlin immutable collections (kotlinx.collections.immutable.*) and Java time classes (java.time.*) as stable.
  • Added external library support for Google Maps model classes (com.google.android.gms.maps.model.**).

… libraries

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 7, 2026 19:18
@github-actions github-actions Bot added the enhancement New feature or request label Feb 7, 2026
@jamesarich jamesarich added this pull request to the merge queue Feb 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and okio.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.**

Copilot AI Feb 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
org.meshtastic.core.model.**

Copilot uses AI. Check for mistakes.
java.time.*

// External Libraries
com.google.android.gms.maps.model.**

Copilot AI Feb 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Merged via the queue into main with commit 8c9743c Feb 7, 2026
13 checks passed
@jamesarich jamesarich deleted the feat/compose-wire-stable-classes branch February 7, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants