Skip to content

fix: Remove id property from core models and generate identifiers on-the-fly#134

Merged
arturgesiarz merged 4 commits intomainfrom
131-remove-id-property
Feb 9, 2026
Merged

fix: Remove id property from core models and generate identifiers on-the-fly#134
arturgesiarz merged 4 commits intomainfrom
131-remove-id-property

Conversation

@arturgesiarz
Copy link
Member

No description provided.

@arturgesiarz
Copy link
Member Author

arturgesiarz commented Feb 4, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors the core map models to remove stored id properties and instead generate identifiers on-the-fly based on object properties. The change moves from instance-based identity (using UUID) to value-based identity (using content hashing).

Changes:

  • Removed id properties from Marker, Circle, Polygon, Polyline, and Cluster data classes
  • Added getId() extension functions that compute IDs using contentDeepHashCode of object properties
  • Introduced ClusterJS DTO for JVM platform to preserve JavaScript-generated cluster IDs
  • Added @JsonIgnoreUnknownKeys to Marker for backward compatibility with JSON deserialization

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
kmp-maps/core/src/commonMain/kotlin/com/swmansion/kmpmaps/core/MapTypes.kt Core refactoring: removed id properties from data classes and added getId() functions for Marker, Circle, Polygon, Polyline; removed Cluster id
kmp-maps/core/src/jvmMain/kotlin/com/swmansion/kmpmaps/core/MapEventHandlers.kt Updated event handlers to use getId() calls; introduced ClusterJS DTO to handle JavaScript-generated cluster IDs
kmp-maps/core/src/jvmMain/kotlin/com/swmansion/kmpmaps/core/Extensions.kt Updated JSON serialization to use getId() for markers, circles, polygons, and polylines
kmp-maps/core/src/iosMain/kotlin/com/swmansion/kmpmaps/core/Utils.kt Updated cluster ID generation to use getId() for markers
kmp-maps/core/src/iosMain/kotlin/com/swmansion/kmpmaps/core/MapDelegate.kt Updated marker lookup and image caching to use getId()
kmp-maps/core/src/iosMain/kotlin/com/swmansion/kmpmaps/core/Map.kt Updated marker rendering and caching to use getId() with Compose key()
kmp-maps/core/src/androidMain/kotlin/com/swmansion/kmpmaps/core/Map.kt Updated Compose key() to use getId() for markers
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/MarkerClusterManagerDelegate.kt Updated marker cache lookups to use getId()
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/MapDelegate.kt Updated marker lookup to use getId()
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/Map.kt Updated marker rendering and caching to use getId()
kmp-maps/google-maps/src/iosMain/kotlin/com/swmansion/kmpmaps/googlemaps/Extensions.kt Updated marker cache lookup to use getId()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@patrickmichalik patrickmichalik left a comment

Choose a reason for hiding this comment

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

Let’s use @suppress for the @RestrictTo-annotated functions so that Dokka skips them.

@arturgesiarz arturgesiarz merged commit 071e062 into main Feb 9, 2026
1 of 2 checks passed
@arturgesiarz arturgesiarz deleted the 131-remove-id-property branch February 9, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove id property from core models and generate identifiers on-the-fly

3 participants