googlemaps / android-maps-compose

Jetpack Compose composables for the Maps SDK for Android
https://developers.google.com/maps/documentation/android-sdk/maps-compose
Apache License 2.0
1.17k stars 142 forks source link

fix: add stability configuration file to the core maps-compose projec… #517

Closed bubenheimer closed 7 months ago

bubenheimer commented 10 months ago

…t. The currently configured types are all the immutable data types from com.google.android.gms.maps.model that are currently used in android-maps-compose:maps-compose. These types will now be considered @Stable by the compiler. Making immutable data types @Stable can be a more effective measure than relying on strong skipping, as stable types can use structural equality, whereas strong skipping merely relies on referential equality, as of today.

This commit also makes compose compiler report generation available via command-line options (-PcomposeCompilerMetrics=true, -PcomposeCompilerReports=true)

Fixes #152

bubenheimer commented 9 months ago

@kikoso are you open to reviewing this PR?

bubenheimer commented 9 months ago

@wangela can this PR receive a review, please?

kikoso commented 7 months ago

Hi @bubenheimer . Thanks for the PR, and for the patience while getting this reviewed.

This should improve the stability and performance. Is there a reason why you would not include the other types in the model folder?

bubenheimer commented 7 months ago

@kikoso The types in model are not generally immutable, which commonly would make them non-stable for Compose purposes. They would be covered by the upcoming strong skipping changes for handling non-stable types in Compose, which is a little less powerful than what we can achieve with stability configuration files.

I've validated for the types in the stability configuration file that they are immutable. These are all the Maps SDK model types currently in use in the maps-compose library.

I did not look at what's being used in maps-compose-utils, and did not provide a stability configuration file there, as I don't use that lib, not familiar with it. It can be done independently of this PR.

bubenheimer commented 7 months ago

@kikoso Actually, maps-compose uses some mutable types from model as well (e.g. Marker), but they need to be handled via strong skipping changes, not stability configuration file, for the the reason I gave above.

kikoso commented 7 months ago

Thanks @bubenheimer , that makes sense. We will wait until the strong skipping mode exits its experimental phase before adopting it. However, this already represents an improvement in terms of performance.

googlemaps-bot commented 7 months ago

:tada: This PR is included in version 4.3.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: