Skip to content

Also make markdown components stable#424

Merged
mikepenz merged 1 commit intodevelopfrom
feature/fix_more_stability
Jul 4, 2025
Merged

Also make markdown components stable#424
mikepenz merged 1 commit intodevelopfrom
feature/fix_more_stability

Conversation

@mikepenz
Copy link
Owner

@mikepenz mikepenz commented Jul 4, 2025

Description

  • fix stability for markdown components

Fixes # (issue)

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 10:42
@mikepenz mikepenz added the fix label Jul 4, 2025
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 marks markdown rendering components as immutable to improve Compose stability and tooling optimizations.

  • Added and imported @Immutable for Compose runtime annotations
  • Replaced @Stable on the MarkdownComponents interface with @Immutable
  • Converted DefaultMarkdownComponents to a @Immutable data class
Comments suppressed due to low confidence (2)

multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/compose/components/MarkdownComponents.kt:95

  • [nitpick] Annotating the interface MarkdownComponents as @Immutable may be misleading since interfaces alone don't guarantee immutability of all implementations. It’s usually better to keep the interface @Stable and only mark concrete implementations with @Immutable.
@Immutable

multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/compose/components/MarkdownComponents.kt:121

  • [nitpick] Converting DefaultMarkdownComponents into a data class generates copy and componentN functions that may not be necessary here. If you don't need value semantics or copies, a regular class annotated with @Immutable could reduce generated bytecode.
private data class DefaultMarkdownComponents(

@mikepenz mikepenz merged commit e47b1fc into develop Jul 4, 2025
3 checks passed
@mikepenz mikepenz deleted the feature/fix_more_stability branch July 4, 2025 10:51
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