Skip to content

Upgrade to Kotlin 2.2 | Compose 1.8.3 | Coil 3.2.0 | Ktor 3.2.1#422

Merged
mikepenz merged 9 commits intodevelopfrom
feature/kotlin_2.2
Jul 4, 2025
Merged

Upgrade to Kotlin 2.2 | Compose 1.8.3 | Coil 3.2.0 | Ktor 3.2.1#422
mikepenz merged 9 commits intodevelopfrom
feature/kotlin_2.2

Conversation

@mikepenz
Copy link
Owner

@mikepenz mikepenz commented Jul 4, 2025

Description

  • upgrade to Kotlin 2.2
  • upgrade to compose 1.8.3 and compose multiplatform 1.8.2
  • coil 3.2.0
  • ktor 3.2.1
  • dependency updates

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build configuration change
  • Other (please describe):

@mikepenz mikepenz requested a review from Copilot July 4, 2025 09:10
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 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 Debug for this icon can be confused with a class name. Consider renaming to DebugIcon or debugIcon for clarity.
val Debug: ImageVector

@@ -0,0 +1,4 @@
package com.mikepenz.markdown.utils

internal actual fun platformLog(tag: String, message: String) {
Copy link

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
internal actual fun platformLog(tag: String, message: String) {
internal actual fun platformLog(tag: String, message: String) {
js("console.log(`[${tag}] $message`)")

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

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

This is not allowed

Comment on lines 34 to 35
LaunchedEffect(Unit) {
MarkdownLogger.enabled = true
Copy link

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
LaunchedEffect(Unit) {
MarkdownLogger.enabled = true
DisposableEffect(Unit) {
MarkdownLogger.enabled = true
onDispose {
MarkdownLogger.enabled = false
}

Copilot uses AI. Check for mistakes.
Comment on lines 25 to 56
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
Copy link

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

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

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

Copilot uses AI. Check for mistakes.
mikepenz added 2 commits July 4, 2025 11:22
- move some of the config classes to be data classes, so equals is auto generated
@mikepenz mikepenz merged commit ece47b5 into develop Jul 4, 2025
3 checks passed
@mikepenz mikepenz deleted the feature/kotlin_2.2 branch July 4, 2025 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant