Skip to content

Releases: slackhq/circuit

0.24.0

16 Sep 20:21
Compare
Choose a tag to compare
  • New: Add code gen support for kotlin-inject + kotlin-inject-anvil. See the code gen docs for usage instructions. We've also added a sample project.
  • New: presenterTestOf() and Presenter.test() functions now return a new CircuitReceiveTurbine interface. This interface slightly but importantly modifies the behavior of awaitItem() by making it only emit changed items rather than every item. If you do want to assert the equivalent state is emitted across recompositions, you can use awaitUnchanged().
  • New: Promote LocalBackStack to public API.
  • Behavior change: Due to the above-documented change to awaitItem(), you may need to update tests that previously assumed duplicate emissions.
  • Update to Kotlin 2.0.20.
  • Change: Switch to stdlib's implementation of Uuid. This release now requires Kotlin 2.0.20 or later.
  • Add sample test to demonstrate rememberAnsweringNavigator result handling.
  • Update to kotlinx.coroutines 1.9.0.
  • Update to compose-bom 2024.09.01.
  • Update to kotlinx.collections.immutable 0.3.8.
  • Update to androidx.activity 1.9.2.
  • Update to androidx.lifecycle 2.8.5.
  • Update to kotlin 2.0.20.
  • Build against KSP 2.0.20-1.0.25.

What's Changed

Full Changelog: 0.23.1...0.24.0

0.23.1

13 Aug 20:18
Compare
Choose a tag to compare
  • New: Promote NoOpRetainedStateRegistry to public API for use in testing and previews.
  • New: Add CircuitPreview helper function for composable previews that contain Circuit content.
  • Enhancement: When running under LocalInspectionMode, Circuit's default onUnavailableContent now shows a simpler non-intrusive placeholder UI instead.
  • Enhancement: Support secondary injected constructors in code gen.
  • Fix: Fix non-dismissable BottomSheetOverlay crash when invoking back-press.
  • Update to Kotlin 2.0.10.
  • Update to androidx.annotation 1.8.2.
  • Build against KSP 2.0.10-1.0.24.

What's Changed

Full Changelog: 0.23.0...0.23.1

0.23.0

31 Jul 00:51
Compare
Choose a tag to compare
  • New: Add macOS, windows, linux, tvOS, and watchOS targets to Circuit's runtime and retained artifacts.
  • New: Add macOS targets to Circuit's UI, backstack, overlay, test, circuitx (except gesture nav), and foundation artifacts.
  • Slightly optimize pausableState #1455.
  • Change: OverlayHost.showFullScreenOverlay now returns the PopResult? that was popped by the screen.
  • Change: Remove backstack dependency from circuit-runtime. It was unnecessary and also accidentally imposed Compose UI on the runtime/presenter artifacts.
  • Change: Make Overlay a fun interface.
  • Breaking Change: Change OverlayEffect to use a new OverlayScope API that implements both CoroutineScope and OverlayHost, making both contexts available in the lambda.
  • Update KSP to 2.0.0-1.0.24.
  • Update androidx.activity to 1.9.1.
  • Update androidx.lifecycle to 2.8.4.
  • Update androidx.annotation to 1.8.1.
  • Update KotlinPoet 1.18.1.
  • Update Compose Multiplatform to 1.6.11.

Special thanks to @aschulz90 and @chrisbanes for contributing to this release!

What's Changed

Full Changelog: https://github.com/slackhq/circuit/compare/0.22...

Read more

0.22.2

04 Jun 16:37
Compare
Choose a tag to compare
  • Fix: Fix pausableState recomposition loops by avoiding backward snapshot writes.
  • New: Add Circuit.presentWithLifecycle flag to enable/disable automatic pausableState use. This is enabled by default.
  • Update Compose Multiplatform to 1.6.11.
  • Update androidx.lifecycle to 2.8.1.
  • Update androidx.appcompat to 1.7.0.

Special thanks to @chrisbanes, @adamp, and Chuck Jazdzewski for contributing to this release and helping us find a runtime fix for the pausableState issue!

What's Changed

Full Changelog: 0.22.1...0.22.2

0.21.2

04 Jun 16:34
Compare
Choose a tag to compare
  • Fix: Fix pausableState recomposition loops by avoiding backward snapshot writes.
  • New: Add Circuit.presentWithLifecycle flag to enable/disable automatic pausableState use. This is enabled by default.

Full Changelog: 0.21.1...0.21.2

0.22.1

28 May 23:14
Compare
Choose a tag to compare
  • Fix: Fix rememberRetained implicitly requiring LocalContext where it used to no-op

What's Changed

  • Bump rexml from 3.2.6 to 3.2.8 by @dependabot in #1435
  • Update dependency app.cash.molecule:molecule-runtime to v2 by @slack-oss-bot in #1437
  • Short circuit rememberRetained if the LocalRetainedStateRegistry isn't set by @stagg in #1438

Full Changelog: 0.22.0...0.22.1

0.22.0

28 May 16:21
Compare
Choose a tag to compare
  • Update to Kotlin 2.0.0.
  • Update to KSP 2.0.0-1.0.21.
  • Update Compose Multiplatform to 1.6.10.
  • Switch to the compose compiler shipped with Kotlin.

This release is otherwise identical to 0.21.0, just updated to Kotlin 2.0.

What's Changed

Full Changelog: 0.21.0...0.22.0

0.21.1

28 May 23:13
Compare
Choose a tag to compare
  • Fix: Fix rememberRetained implicitly requiring LocalContext where it used to no-op (#1438)

What's Changed

  • Short circuit rememberRetained if the LocalRetainedStateRegistry isn't set by @stagg in #1438

Full Changelog: 0.21.0...0.21.1

0.21.0

28 May 04:11
Compare
Choose a tag to compare
  • New: Add WASM targets.
  • New: Add FakeNavigator functions to check for the lack of pop/resetRoot events.
  • New: Add FakeNavigator constructor param to add additional screens to the backstack.
  • New: Add support for static UIs. In some cases, a UI may not need a presenter to compute or manage its state. Examples of this include UIs that are stateless or can derive their state from a single static input or an input [Screen]'s properties. In these cases, make your screen implement the StaticScreen interface. When a StaticScreen is used, Circuit will internally allow the UI to run on its own and won't connect it to a presenter if no presenter is provided.
  • New: Add RecordLifecycle and LocalRecordLifecycle composition local, allowing UIs and presenters to observe when they are 'active'. Currently, a record is considered 'active' when it is the top record on the back stack.
  • New: Add a rememberRetainedSaveable variant that participates in both RetainedStateRegistry and SaveableStateRegistry restoration, allowing layered state persistence.
    • The logic is the following upon rememberRetainedSaveable entering composition:
      • consume from both RetainedStateRegistry and SaveableStateRegistry, if available
      • if the retained value is available, use that
      • otherwise, if the saveable restored value is available, use that
      • otherwise, re-initialize the value
    • There is also an overload of rememberRetained that explicitly requires a Saver parameter.
  • Behaviour Change: Presenters are now 'paused' when inactive and replay their last emitted CircuitUiState when they are not active. Presenters can opt-out of this behavior by implementing NonPausablePresenter.
  • Behaviour Change: NavigatorImpl.goTo no longer navigates if the Screen is equal to Navigator.peek().
  • Behaviour Change: Presenter.present is now annotated with @ComposableTarget("presenter"). This helps prevent use of Compose UI in the presentation logic as the compiler will emit a warning if you do. Note this does not appear in the IDE, so it's recommended to use allWarningsAsErrors to fail the build on this event.
  • Behaviour Change: Guard against Navigator.goTo() calls to the same current screen.
  • Change: Navigator.goTo now returns a Bool indicating navigation success.
  • Change: Move iOS GestureNavigationDecoration impl to commonMain and rename to CupertinoGestureNavigationDecoration.
  • Change: Target jvmTarget 1.8 in core libraries.
  • Fix: Fix saveable state being restored when using reset root navigation events.
  • Deprecation: FakeNavigator.assertIsEmpty and expectNoEvents (use the specific event type methods instead)
  • Mark Presenter.Factory as @Stable.
  • Mark Ui.Factory as @Stable.
  • Mark CircuitContext as @Stable.
  • Mark EventListener as @Stable.
  • Mark EventListener.Factory as @Stable.
  • [samples] Improve interop sample significantly.
  • Update Kotlin to 1.9.24.
  • Update KSP to 1.9.24-2.0.20.
  • Update compose-compiler to 1.5.14.
  • Update KotlinPoet to 1.17.0.
  • Update androidx.lifecycle to 2.8.0.
  • Update Molecule to 1.4.3.
  • Update androidx.annotation to 1.8.0.
  • Update kotlinx.coroutines to 1.8.1.
  • Update Compose Multiplatform to 1.6.2.
  • Update Compose UI to 1.6.7.
  • Update Compose Runtime to 1.6.7.
  • Update Compose Animation to 1.6.7.
  • Update Compose Material to 1.6.7.
  • Update androidx.core to 1.13.1.
  • Update androidx.activity to 1.9.0.
  • Update dagger to 2.51.1.
  • Update uuid to 0.8.4.

Special thanks to @chrisbanes, @alexvanyo, @eboudrant, @edenman, and @JustinBis for contributing to this release!

What's Changed

Read more

0.20.0

18 Mar 18:44
Compare
Choose a tag to compare
  • New: Enable RememberObserver to work with rememberRetained.
  • New: Add Navigator.popRoot(). extension (#1274)
  • Behavior change: Add a key to CircuitContent to keep Ui and Presenter consistent. We already did this for presenters, this just makes it consistent for both.
  • [circuitx-android] Implement ToastEffect.
  • Fix: Fix rememberImpressionNavigator() not delegating PopResult.
  • Fix: Navigator - Pass PopResult to onRootPop().
  • Fix: Check canRetainCheck when saving RetainedStateRegistry.
  • Enhancement: Improve error messaging when using assisted inject.
  • Force com.google.guava:listenablefuture to 1.0 to avoid conflicts with Guava.
  • Update compose-compiler to 1.5.10.1.
  • Update coroutines to 1.8.0.
  • Update to Compose Multiplatform 1.6.1.
  • Update Android compose dependencies to 1.6.3.
  • Update molecule to 1.4.1.
  • Update dagger to 2.51.
  • Update turbine to 1.1.0.
  • Update uuid to 0.8.3.
  • Update kotlin to 1.9.23.
  • Update KSP to 1.9.23-1.0.19.

Special thanks to @chrisbanes, @aschulz90, and @alexvanyo for contributing to this release!

What's Changed

New Contributors

Full Changelog: 0.19.1...0.20.0