Skip to content

Releases: slackhq/circuit

0.26.1

13 Feb 20:19
Compare
Choose a tag to compare
  • Fix crash on right side back gesture.
  • Update CupertinoGestureNavigationDecoration to be a AnimatedNavDecorator.
  • Fix value restoration after removeState call in RetainedStateHolder.
  • Update Android compose artifacts to 1.7.8.
  • [docs] Add tutorial for how to use Circuit shared elements.
  • [docs] Added basic reference guide on deep-linking using circuit for Android platform.

Special thanks to @vulpeszerda for contributing to this release!

What's Changed

Full Changelog: 0.26.0...0.26.1

0.26.0

07 Feb 04:21
Compare
Choose a tag to compare

Happy new year!

Shared Elements API!

After a lot of iteration and work, this release adds support for Compose's new shared elements APIs.

These are still experimental and subject to change, both in Circuit and the underlying Compose APIs.

See this PR for full details as well as sample integrations: #1550. Please share feedback in this discussion. More formal docs to come as well, we'll publish updates there!

For now, the easiest way to support shared element transitions is to wrap your content with a SharedElementTransitionLayout.

CircuitCompositionLocals(circuit) {
  SharedElementTransitionLayout {
    NavigableCircuitContent(
      navigator = navigator,
      backStack = backStack,
    )
  }
}

SharedElementTransitionLayout creates and provides a SharedElementTransitionScope to content within it, and in turn exposes a SharedTransitionScope for use with standard compose shared elements/bounds animations. This is supported in NavigableCircuitContent and overlays.

There is also a PreviewSharedElementTransitionLayout for help with Compose previews.

Behaviour Changes: rememberRetained

Previously, rememberRetained could sometimes restore values when a composable was re-added, depending on whether its parent RetainedStateRegistry had been saved (#1783).
Now, rememberRetained aligns with remember and rememberSaveable: if a composable is removed and later re-added, its value will not be restored unless it is explicitly saved and then restored via the registry.

Update rememberRetained to allow CanRetainChecker to be updated in place.

Behaviour Change: RetainedStateRegistry

  • saveAll now returns the saved values.
  • RetainedStateRegistry.Entry.unregister now returns whether the unsaved valueProvider was actually removed.
  • saveAll and saveValue now skip storing child values when CanRetainChecker returns false.

New: RetainedStateHolder

Similar to SaveableStateHolder, RetainedStateHolder provides a mechanism to maintain separate RetainedStateRegistry entries for specific keys. This allows saving the state defined with rememberRetained for a subtree before it is disposed, so that the subtree can later be recomposed with its state restored.

val retainedStateHolder = rememberRetainedStateHolder()
var currentTab by remember { mutableStateOf(TabA) }

retainedStateHolder.RetainedStateProvider(key = currentTab.name) {
  // rememberRetained values in tab content are preserved across tab switches
  when (currentTab) {
    TabA -> {
      TabAContent()
    }
    TabB -> {
      TabBContent()
    }
    TabC -> {
      TabCContent()
    }
  }
}

Implementation Changes: NavigableCircuitContent

  • The approach of managing a separate RetainedStateRegistry for each record has been changed to use RetainedStateHolder instead.
  • Change SaveableStateHolder to release saved states of removed records.

Misc

  • Fixe an issue causing codegen to fail for class @Inject annotations.
  • Compile against Android SDK 35.
  • Update Compose Android BOM to 2025.01.01.
  • Update to androidx.annotation 1.9.1.
  • Update to androidx.activity 1.10.0.
  • Update to Compose Android 1.7.7.
  • Update to Compose Multiplatform 1.7.3.
  • Update to Kotlin 1.9.10.
  • [code gen] Update to KSP 1.9.10-1.0.29.
  • [code gen] Update to Dagger 2.55.
  • [code gen] Update to KotlinPoet 2.0.0.
  • [code gen] Build against Anvil-KSP 0.4.1. Should still be compatible with square/anvil as well.
  • [code gen] Build against kotlin-inject-anvil 0.1.2. Should still be compatible with square/anvil as well.
  • [samples] Update mosaic + modernize mosaic counter sample to fully use effects.
  • [docs] Fix variable casing in Navigation documentation example.

Special thanks to @vulpeszerda, @rharter, @alexvanyo, and @easyhooon for contributing to this release!

What's Changed

Read more

0.25.0

23 Oct 22:07
Compare
Choose a tag to compare
  • New: Pass tonalElevation to BottomSheetOverlay so that is reflected in ModalBottomSheet.
  • Enhancement: Add -dontwarn on Anvil classes from codegen annotations.
  • Enhancement: Misc small doc fixes and updates.
  • Enhancement: Add note about only creating a presenter for supported screen types in tutorial.
  • Update kotlinInject.anvil to 0.0.5.
  • Update androidx.activity to 1.9.3.
  • Update androidx.lifecycle to 2.8.6.
  • Update Kotlin to 2.0.21.
  • Build against KSP to 2.0.21-1.0.25.
  • Update Turbine to 1.2.0.
  • Update Compose Android to 1.7.4.
  • Update Compose Multiplatform to 1.7.0.

Special thanks to @eboudrant, @bidrohi, @hossain-khan, and @dturner for contributing to this release!

What's Changed

New Contributors

Full Changelog: 0.24.0...0.25.0

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