Upgrade to Kotlin 2.2 | Compose 1.8.3 | Coil 3.2.0 | Ktor 3.2.1#422
Upgrade to Kotlin 2.2 | Compose 1.8.3 | Coil 3.2.0 | Ktor 3.2.1#422
Conversation
- fix immediate may cause additional recompositions
- upgrade to compose 1.8.3 and compose multiplatform 1.8.2 - coil 3.2.0 - ktor 3.2.1 - dependency updates
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades core dependencies to Kotlin 2.2, Compose 1.8.3, Coil 3.2.0, and Ktor 3.2.1, and enhances logging for recomposition debugging while cleaning up deprecated APIs and adding equals/hashCode to model classes.
- Bump versions in Gradle and version catalogs
- Introduce a debug icon and RecompositionPage with logging
- Remove deprecated linkDefinition code and add stability APIs to model types
Reviewed Changes
Copilot reviewed 46 out of 46 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle.kts | Update version-catalog from 0.4.2 to 0.6.0 |
| sample/shared/src/commonMain/kotlin/com/mikepenz/markdown/sample/icon/Debug.kt | Add new Debug ImageVector for recomposition debugging |
| sample/shared/src/commonMain/kotlin/com/mikepenz/markdown/sample/TopAppBar.kt | Integrate debug icon button and move theme switch action |
| sample/shared/src/commonMain/kotlin/com/mikepenz/markdown/sample/RecompositionPage.kt | New screen to visualize recomposition counts |
| sample/shared/src/commonMain/kotlin/com/mikepenz/markdown/sample/App.kt | Hook up showDebug state and navigate between pages |
| multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/utils/MarkdownLogger.kt | Add MarkdownLogger with platform-agnostic API |
| multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/utils/LogCompositions.kt | Provide LogCompositions composable to count recompositions |
| multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/model/*.kt | Implement equals/hashCode on all default model classes |
| multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/compose/elements/*.kt | Remove deprecated LocalMarkdownColors.current.*Text usages |
| gradle/libs.versions.toml | Bump coil to 3.2.0 and ktor to 3.2.1 |
| gradle.properties | Set com.mikepenz.kotlin.version to 2.2 |
Comments suppressed due to low confidence (2)
sample/shared/src/commonMain/kotlin/com/mikepenz/markdown/sample/icon/Debug.kt:9
- [nitpick] Using an uppercase name
Debugfor this icon can be confused with a class name. Consider renaming toDebugIconordebugIconfor clarity.
val Debug: ImageVector
| @@ -0,0 +1,4 @@ | |||
| package com.mikepenz.markdown.utils | |||
|
|
|||
| internal actual fun platformLog(tag: String, message: String) { | |||
There was a problem hiding this comment.
The platformLog stub is empty on WASM JS platforms, so debug messages won't appear there. Consider forwarding logs to console.log or another JS logging API.
| internal actual fun platformLog(tag: String, message: String) { | |
| internal actual fun platformLog(tag: String, message: String) { | |
| js("console.log(`[${tag}] $message`)") |
| LaunchedEffect(Unit) { | ||
| MarkdownLogger.enabled = true |
There was a problem hiding this comment.
LaunchedEffect unconditionally sets MarkdownLogger.enabled = true but never resets it. This global flag persists beyond this screen and may produce unwanted logs elsewhere. Consider disabling it on exit via a DisposableEffect.
| LaunchedEffect(Unit) { | |
| MarkdownLogger.enabled = true | |
| DisposableEffect(Unit) { | |
| MarkdownLogger.enabled = true | |
| onDispose { | |
| MarkdownLogger.enabled = false | |
| } |
| class DefaultMarkdownColors( | ||
| override val text: Color, | ||
| @Deprecated("Set color via `codeText` textStyle via `MarkdownTypography` instead") | ||
| override val codeText: Color, | ||
| @Deprecated("Set color via `inlineCode` textStyle via `MarkdownTypography` instead") | ||
| override val inlineCodeText: Color, | ||
| @Deprecated("Set color via `linkText` textStyle via `MarkdownTypography` instead") | ||
| override val linkText: Color, | ||
| override val codeBackground: Color, | ||
| override val inlineCodeBackground: Color, | ||
| override val dividerColor: Color, | ||
| @Deprecated("Set color via `tableText` textStyle via `MarkdownTypography` instead") | ||
| override val tableText: Color, | ||
| override val tableBackground: Color, | ||
| ) : MarkdownColors No newline at end of file | ||
| ) : MarkdownColors { | ||
| override fun equals(other: Any?): Boolean { | ||
| if (this === other) return true | ||
| if (other == null || this::class != other::class) return false | ||
|
|
||
| other as DefaultMarkdownColors | ||
|
|
||
| if (text != other.text) return false | ||
| if (codeBackground != other.codeBackground) return false | ||
| if (inlineCodeBackground != other.inlineCodeBackground) return false | ||
| if (dividerColor != other.dividerColor) return false | ||
| if (tableBackground != other.tableBackground) return false | ||
|
|
||
| return true | ||
| } | ||
|
|
||
| override fun hashCode(): Int { | ||
| var result = text.hashCode() | ||
| result = 31 * result + codeBackground.hashCode() | ||
| result = 31 * result + inlineCodeBackground.hashCode() | ||
| result = 31 * result + dividerColor.hashCode() | ||
| result = 31 * result + tableBackground.hashCode() | ||
| return result | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
[nitpick] Manual equals/hashCode implementations across all model classes introduce a lot of boilerplate. Consider leveraging Kotlin data class patterns or code generation to reduce maintenance overhead.
- move some of the config classes to be data classes, so equals is auto generated
Description
Type of change
Please delete options that are not relevant.