From 9607e4e7cd02e4242d64d0c4bea542d7e0710bff Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 15 Apr 2025 20:23:27 +0800 Subject: [PATCH] Mark stable classes for Compose ```diff diff --color=auto -r before/shared/shared_release-classes.txt after/shared/shared_release-classes.txt 47c47 < unstable val client: HttpClient --- > stable val client: HttpClient 55c55 < unstable val scope: CoroutineScope --- > stable val scope: CoroutineScope 82c82 < unstable val scope: CoroutineScope --- > stable val scope: CoroutineScope 86,90c86,90 < unstable class TagValues { < unstable val categories: List < unstable val levels: List < unstable val formats: List < = Unstable --- > stable class TagValues { > stable val categories: List > stable val levels: List > stable val formats: List > = 123,126c123,126 < unstable class Conference { < unstable val sessions: List < unstable val speakers: List < = Unstable --- > stable class Conference { > stable val sessions: List > stable val speakers: List > = 132,134c132,134 < unstable class Votes { < unstable val votes: List < = Unstable --- > stable class Votes { > stable val votes: List > = 152c152 < unstable class Session { --- > stable class Session { 156c156 < unstable val speakerIds: List --- > stable val speakerIds: List 158,160c158,160 < unstable val startsAt: LocalDateTime < unstable val endsAt: LocalDateTime < unstable val tags: List? --- > stable val startsAt: LocalDateTime > stable val endsAt: LocalDateTime > stable val tags: List? 162c162 < = Unstable --- > = 198c198 < unstable class NewsItem { --- > stable class NewsItem { 202c202 < unstable val publicationDate: LocalDateTime --- > stable val publicationDate: LocalDateTime 204c204 < = Unstable --- > = Stable 210c210 < unstable class NewsRequest { --- > stable class NewsRequest { 212c212 < unstable val publicationDate: LocalDateTime --- > stable val publicationDate: LocalDateTime 215c215 < = Unstable --- > = Stable 221,223c221,223 < unstable class NewsListResponse { < unstable val items: List < = Unstable --- > stable class NewsListResponse { > stable val items: List > = 244c244 < unstable class SessionCardView { --- > stable class SessionCardView { 249,250c249,250 < unstable val startsAt: LocalDateTime < unstable val endsAt: LocalDateTime --- > stable val startsAt: LocalDateTime > stable val endsAt: LocalDateTime 252c252 < unstable val speakerIds: List --- > stable val speakerIds: List 256c256 < unstable val tags: Set --- > stable val tags: Set 262c262 < = Unstable --- > = 293,296c293,296 < unstable class Day { < unstable val date: LocalDate < unstable val timeSlots: List < = Unstable --- > stable class Day { > stable val date: LocalDate > stable val timeSlots: List > = 298,300c298,300 < unstable class TimeSlot { < unstable val startsAt: LocalDateTime < unstable val endsAt: LocalDateTime --- > stable class TimeSlot { > stable val startsAt: LocalDateTime > stable val endsAt: LocalDateTime 302c302 < unstable val sessions: List --- > stable val sessions: List 304c304 < = Unstable --- > = 427,429c427,429 < unstable class AboutConferenceEvent { < unstable val sessionCard: SessionCardView? < unstable val speakers: List? --- > stable class AboutConferenceEvent { > stable val sessionCard: SessionCardView? > stable val speakers: List? 435c435 < = Unstable --- > = 485,487c485,487 < unstable class DayHeaderItem { < unstable val value: Day < = Unstable --- > stable class DayHeaderItem { > stable val value: Day > = 489,491c489,491 < unstable class TimeSlotTitleItem { < unstable val value: TimeSlot < = Unstable --- > stable class TimeSlotTitleItem { > stable val value: TimeSlot > = 498,499c498,499 < unstable val value: SessionCardView < unstable val tagMatches: List --- > stable val value: SessionCardView > stable val tagMatches: List 504,506c504,506 < unstable class ServiceEventItem { < unstable val value: SessionCardView < = Unstable --- > stable class ServiceEventItem { > stable val value: SessionCardView > = 508,510c508,510 < unstable class ServiceEventGroupItem { < unstable val value: List < = Unstable --- > stable class ServiceEventGroupItem { > stable val value: List > = 512,514c512,514 < unstable class WorkshopItem { < unstable val workshops: List < = Unstable --- > stable class WorkshopItem { > stable val workshops: List > = 528,530c528,530 < unstable class Content { < unstable val days: List < unstable val items: List --- > stable class Content { > stable val days: List > runtime val items: List 534c534 < = Unstable --- > = 617c617 < unstable class DebugLogger { --- > stable class DebugLogger { 619,620c619,620 < unstable val logs: MutableList < = Unstable --- > stable val logs: MutableList > = diff --color=auto -r before/shared/shared_release-composables.txt after/shared/shared_release-composables.txt 87c87 < unstable speakers: List --- > stable speakers: List 247c247 < unstable scheduleItems: List --- > scheduleItems: List 256c256 < unstable filterItems: List? = @static emptyList() --- > filterItems: List? = @static emptyList() 267c267 < unstable session: SessionCardView --- > stable session: SessionCardView 277c277 < unstable tagHighlights: List? = @static emptyList() --- > stable tagHighlights: List? = @static emptyList() diff --color=auto -r before/ui-components/ui-components_release-composables.txt after/ui-components/ui-components_release-composables.txt 83c83 < unstable tags: List --- > stable tags: List 89c89 < unstable items: List --- > stable items: List 218c218 < unstable tags: Set --- > stable tags: Set 256c256 < unstable events: List --- > stable events: List 297c297 < unstable inlineContent: Map? = @static mapOf() --- > stable inlineContent: Map? = @static mapOf() 307c307 < unstable items: List --- > stable items: List 322,323c322,323 < unstable tags: Set < unstable tagHighlights: List --- > stable tags: Set > stable tagHighlights: List 346,347c346,347 < unstable tags: Set < unstable selectedTags: List --- > stable tags: Set > stable selectedTags: List 354c354 < unstable tags: Set --- > stable tags: Set ``` --- compose-stability.conf | 15 +++++++++++++++ shared/build.gradle.kts | 6 +++++- ui-components-gallery/build.gradle.kts | 6 +++++- ui-components/build.gradle.kts | 4 ++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 compose-stability.conf diff --git a/compose-stability.conf b/compose-stability.conf new file mode 100644 index 000000000..16b23fd72 --- /dev/null +++ b/compose-stability.conf @@ -0,0 +1,15 @@ +// Consider kotlin collections stable +kotlin.collections.* + +// Consider kotlinx.datetime models stable +kotlinx.datetime.DayOfWeek +kotlinx.datetime.Instant +kotlinx.datetime.LocalDate +kotlinx.datetime.LocalDateTime +kotlinx.datetime.LocalTime +kotlinx.datetime.TimeZone +kotlin.time.Duration + +kotlinx.coroutines.CoroutineScope + +coil3.compose.AsyncImagePainter.State diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index e2e00e62d..6f27ada58 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -203,9 +203,13 @@ val buildWebApp by tasks.creating(Copy::class) { duplicatesStrategy = DuplicatesStrategy.INCLUDE } -// Hot reload support composeCompiler { + // Hot reload support featureFlags.add(ComposeFeatureFlag.OptimizeNonSkippingGroups) + reportsDestination = layout.buildDirectory.dir("compose_build_reports") + stabilityConfigurationFiles.addAll( + rootProject.layout.projectDirectory.file("compose-stability.conf"), + ) } aboutLibraries { diff --git a/ui-components-gallery/build.gradle.kts b/ui-components-gallery/build.gradle.kts index 5ddec5bf0..e9a187d19 100644 --- a/ui-components-gallery/build.gradle.kts +++ b/ui-components-gallery/build.gradle.kts @@ -82,7 +82,11 @@ dependencies { debugImplementation(compose.uiTooling) } -// Hot reload support composeCompiler { + // Hot reload support featureFlags.add(ComposeFeatureFlag.OptimizeNonSkippingGroups) + reportsDestination = layout.buildDirectory.dir("compose_build_reports") + stabilityConfigurationFiles.addAll( + rootProject.layout.projectDirectory.file("compose-stability.conf"), + ) } diff --git a/ui-components/build.gradle.kts b/ui-components/build.gradle.kts index 6e7cbbcc3..f87cf14a6 100644 --- a/ui-components/build.gradle.kts +++ b/ui-components/build.gradle.kts @@ -90,6 +90,10 @@ android { // Hot reload support composeCompiler { featureFlags.add(ComposeFeatureFlag.OptimizeNonSkippingGroups) + reportsDestination = layout.buildDirectory.dir("compose_build_reports") + stabilityConfigurationFiles.addAll( + rootProject.layout.projectDirectory.file("compose-stability.conf"), + ) } compose.resources {