Skip to content

chore(api): stop tracking compiler-generated lambda holders and an internal-only expect fun - #54

Merged
aoreshkov merged 1 commit into
mainfrom
chore/api-dump-tidying
Oct 8, 2026
Merged

aoreshkov merged 1 commit into
mainfrom
chore/api-dump-tidying

Conversation

@aoreshkov

Copy link
Copy Markdown
Owner

Two API dump tidy-ups. The dumps only lose lines, and no real public API changes.

Changes

  • ComposableSingletons holders: added to apiValidation.ignoredClasses in the root build.gradle.kts. That covers 9 classes in 5 modules: core:navigation, core:ui, desktopApp, feature:posting:impl and feature:settings:impl.
    • What they are: the Compose compiler moves capture-free composable lambdas into these holder classes. Their getters are internal (module-mangled names). The compiler-generated class has no Kotlin metadata, so the JVM dump reads it as public. The klib dumps already leave it out.
    • Why they caused noise: a getter key changes when the call that owns the lambda changes. Adding readOnly to an OutlinedTextField in fix(posting): lock the narrative field while a save is in flight #51 did that, and apiCheck failed with no real API change.
    • Why an explicit list: binary-compatibility-validator 0.18.2 (the latest) matches exact names only. The Kotlin Gradle plugin's built-in abiValidation supports globs but is still @ExperimentalAbiValidation.
    • Adding new ones: the rule is now in CLAUDE.md and CONTRIBUTING.md. If a new holder shows up in a dump diff, add it to the list instead of committing it.
    • Why this is safe: a holder would be real ABI only if a public inline fun took a composable lambda. None does.
  • getPlatformLogWriters: the expect and its Android, iOS and JVM actuals are now internal. Its only caller is LoggingModule in the same module.

Verification

🤖 Generated with Claude Code

…ternal-only expect fun

The JVM API dumps tracked nine ComposableSingletons$<File>Kt classes
across five modules. The Compose compiler hoists capture-free composable
lambdas into these holders. Their getters are internal (module-mangled
names), but the IR-generated class has no Kotlin metadata, so the JVM
dump read it as public. The klib dumps already omitted it. A getter key
re-hashes when the call that owns the lambda changes (adding readOnly to
an OutlinedTextField did it), which failed apiCheck with no real API
change. The holders are now listed in apiValidation.ignoredClasses.
BCV 0.18.2 matches only exact names, and KGP's glob-capable
abiValidation is still experimental, so each holder is listed and the
rule for adding new ones is in CLAUDE.md and CONTRIBUTING.md. Excluding
them is safe while no public inline function takes a composable lambda.

getPlatformLogWriters and its actuals are now internal. Its only caller
is LoggingModule in the same module.

The dumps change only by removal: the nine holders, plus
getPlatformLogWriters from jvm/common.api and common.klib.api.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Code Coverage

Overall Project 98.36% 🍏
File Coverage
PlatformLogWriter.jvm.kt 100% 🍏
PlatformLogWriter.android.kt 0% 🍏

@aoreshkov
aoreshkov merged commit f01df87 into main Oct 8, 2026
14 checks passed
@aoreshkov
aoreshkov deleted the chore/api-dump-tidying branch October 8, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant