Skip to content

Evaluation and Migration

sonmbol edited this page Jul 28, 2026 · 1 revision

Evaluation and Migration

Start with one non-critical screen and measure the bridge rather than adopting it across the application immediately.

Evaluation checklist

  1. Select one ViewModel and one exported state stream.
  2. Keep the bridge in a thin live container.
  3. Pass Swift values, bindings, and actions to a pure presentation view.
  4. Verify construction, collection, cancellation, rebinding, and disposal.
  5. Count body evaluations for independent fields.
  6. Profile allocations and delivery throughput on target hardware.

From a Swift adapter

If a Swift ObservableObject currently copies Kotlin state:

final class ProfileAdapter: ObservableObject {
    @Published var state: ProfileState
    let model: ProfileViewModel
}

replace the adapter owner with KMPStateObject, keep the presentation view unchanged, supply $profile.profileState, and forward actions directly to Kotlin. Remove the copied Swift state only after lifecycle and rendering tests pass.

Evidence to collect

  • Kotlin ViewModel construction and disposal counts.
  • Underlying collector counts with multiple wrappers.
  • Body evaluations for unrelated field emissions.
  • Cancellation after navigation and replacement.
  • Weak-reference release across Swift ARC and Kotlin GC.
  • Immediate and coalesced delivery results.

See the repository’s evaluation guide and benchmark methodology.

Clone this wiki locally