Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 15 Nov 06:14
· 19 commits to main since this release
2374370

Added

  • @Preview for Compose SwiftUI composables, rendered in Xcode's canvas. The Gradle plugin finds top-level,
    parameterless @Preview @Composable functions (any annotation named Preview works) and writes
    ComposeSwiftUIPreviews.swift next to the renderer, with one Swift #Preview per function and a
    ComposeSwiftUIPreviewGallery view that lists them all. The task is generateComposeSwiftUIPreviews.
  • LazyForEach(items, key) { item -> } for long lists: inside a List or a lazy stack, a row is composed only while
    SwiftUI shows it, and disposed when it scrolls away. A 10,000-row list now mounts in 28 ms instead of 909 ms on the
    iOS simulator, and a one-row change takes 0.4 ms instead of 4.5 ms.
  • A scenario benchmark (scripts/run_scenarios.sh): long lists (mount, scrolling, one-row change, every row changed)
    and animations, compared with plain SwiftUI using native @Observable models.
  • The sample app has two previews, a 5,000-row list and opens the preview gallery from its home screen.

Changed

  • Generated containers render their content through ChildrenView, and flushCompose() runs up to four passes so that
    state written by effects is shown in the same SwiftUI update.

Install with the Gradle plugin in your shared KMP module:

plugins {
    id("dev.nucleusframework.compose-swiftui") version "0.3.0"
}

Library: dev.nucleusframework:compose-swiftui:0.3.0 on Maven Central.
Gradle plugin: dev.nucleusframework.compose-swiftui 0.3.0 on the Gradle Plugin Portal.

Full Changelog: v0.2.1...v0.3.0