Skip to content

KMPObservableBridge 1.1.0

Latest

Choose a tag to compare

@sonmbol sonmbol released this 28 Jul 07:43
036dce6

KMPObservableBridge 1.1.0

A production-focused release that makes imported Kotlin state feel substantially more native in SwiftUI while keeping Kotlin as the single source of truth.

Highlights

  • Field-level SwiftUI dependencies on iOS 17+ — views reading $viewModel.fieldA are no longer invalidated by changes isolated to fieldB.
  • Correct legacy fallback — iOS 15 and 16 retain global ObservableObject invalidation.
  • Dependency-aware coalescing — same-turn emissions are unioned and flushed once without losing independent field changes.
  • Shared Kotlin collection — multiple SwiftUI wrappers continue to share one collector set per model identity.
  • Lifecycle hardening — deterministic cancellation, stale-generation suppression, safe rebinding, and ownership-aware disposal.
  • Swift-first projection — projected state exposes native Swift values and writable Kotlin exports expose Binding, without .value at call sites.
  • Toolchain coverage — compatible package manifests for Swift 5.9, 6.0, 6.1, and 6.2 with a drift audit.
  • Production examples and previews — DailyPulse now demonstrates ownership, SKIE, NativeCoroutines, callbacks, Combine, bindings, loading/error/empty states, and dark mode without starting Kotlin runtime work in previews.
  • New documentation and visuals — refreshed README, architecture diagram, real simulator screenshot, and optimized demonstration GIF.

Compatibility

Existing 1.1 consumer syntax remains unchanged:

@KMPObservable(
    ArticleViewModel.self,
    fields: \.articleState
)
extension ArticleViewModel: @retroactive KMPStaticallyObservable {}

Explicit fields remain required because Swift macros cannot safely inspect members of imported Kotlin types. Kotlin state remains authoritative; Swift stores only observation metadata.

Validation

  • 41 Swift package tests
  • strict concurrency with warnings treated as errors
  • macro-expansion coverage
  • API compatibility audit against the previous 1.1.0 baseline
  • manifest consistency and exporter-isolation checks
  • lifecycle, cancellation, rebinding, coalescing, and field-dependency tests

Full changes: #13