Slackhq Circuit Versions Save

⚡️ A Compose-driven architecture for Kotlin and Android applications.

0.20.0

1 month ago
  • 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: https://github.com/slackhq/circuit/compare/0.19.1...0.20.0

0.19.1

3 months ago

This is a small bug fix release focused SaveableBackStack consistency and FakeNavigator API improvements.

  • Fix FakeNavigator.awaitNextScreen() not suspending.
  • Fix FakeNavigator.resetRoot() not returning the actual popped screens.
  • Make Navigator.peekBackStack() and Navigator.resetRoot() return ImmutableList.
  • Make BackStack.popUntil() return the ImmutableList of the popped records.
  • Support FakeNavigator.peekBackStack() return the ImmutableList of the popped records.
  • Strongly pop events and resetRoot events in FakeNavigator. This should offer much more information about the events.
  • Use a real BackStack instance in FakeNavigator + allow for specifying a user-provided instance.
  • Require an initial root screen to construct FakeNavigator unless using a custom BackStack.
    • Note this slightly changes semantics, as now the root screen will not be recorded as the first goTo event.
  • Require an initial root screen (or list of screens) for rememberSaveableBackStack().
  • Expose a top-level non-composable Navigator() factory function.

What's Changed

Full Changelog: https://github.com/slackhq/circuit/compare/0.19.0...0.19.1

0.19.0

3 months ago

What's Changed

This release introduces support for inter-screen navigation results. This is useful for scenarios where you want to pass data back to the previous screen after a navigation event, such as when a user selects an item from a list and you want to pass the selected item back to the previous screen.

var photoUrl by remember { mutableStateOf<String?>(null) }
val takePhotoNavigator = rememberAnsweringNavigator<TakePhotoScreen.Result>(navigator) { result ->
  photoUrl = result.url
}

// Elsewhere
takePhotoNavigator.goTo(TakePhotoScreen)

// In TakePhotoScreen.kt
data object TakePhotoScreen : Screen {
  @Parcelize
  data class Result(val url: String) : PopResult
}

class TakePhotoPresenter {
  @Composable fun present(): State {
    // ...
    navigator.pop(result = TakePhotoScreen.Result(newFilters))
  }
}

See the new section in the navigation docs for more details, as well as updates to the Overlays docs that help explain when to use an Overlay vs navigating to a Screen with a result.

Support for multiple back stacks

This release introduces support for saving/restoring navigation state on root resets (aka multi back stack). This is useful for scenarios where you want to reset the back stack to a new root but still want to retain the previous back stack's state, such as an app UI that has a persistent bottom navigation bar with different back stacks for each tab.

This works by adding two new optional saveState and restoreState parameters to Navigator.resetRoot().

navigator.resetRoot(HomeNavTab1, saveState = true, restoreState = true)
// User navigates to a details screen
navigator.push(EntityDetails(id = foo))
// Later, user clicks on a bottom navigation item
navigator.resetRoot(HomeNavTab2, saveState = true, restoreState = true)
// Later, user switches back to the first navigation item
navigator.resetRoot(HomeNavTab1, saveState = true, restoreState = true)
// The existing back stack is restored, and EntityDetails(id = foo) will be top of
// the back stack

There are times when saving and restoring the back stack may not be appropriate, so use this feature only when it makes sense. A common example where it probably does not make sense is launching screens which define a UX flow which has a defined completion, such as onboarding.

New Tutorial!

On top of Circuit's existing docs, we've added a new tutorial to help you get started with Circuit. It's a step-by-step guide that walks you through building a simple inbox app using Circuit, intended to serve as a sort of small code lab that one could do in 1-2 hours. Check it out here.

Overlay Improvements

  • New: Promote AlertDialogOverlay, BasicAlertDialogOverlay, and BasicDialogOverlay to circuitx-overlay.
  • New: Add OverlayEffect to circuit-overlay. This offers a simple composable effect to show an overlay and await a result.
    OverlayEffect(state) { host ->
      val result = host.show(AlertDialogOverlay(...))
      // Do something with the result
    }
    
  • Add OverlayState and LocalOverlayState to circuit-overlay. This allows you to check the current overlay state (UNAVAILABLE, HIDDEN, or SHOWING).
  • Mark OverlayHost as @ReadOnlyOverlayApi to indicate that it's not intended for direct implementation by consumers.
  • Mark Overlay as @Stable.

Misc

  • Make NavEvent.screen public.
  • Change Navigator.popUntil to be exclusive.
  • Add Navigator.peek() to peek the top screen of the back stack.
  • Add Navigator.peekBackStack() to peek the top screen of the back stack.
  • Align spelling of back stack parameters across all APIs to backStack.
  • Refreshed iOS Counter sample using SPM and SKIE.
  • Convert STAR sample to KMP. Starting with Android and Desktop.
  • Fix baseline profiles packaging. Due to a bug in the baseline profile plugin, we were not packaging the baseline profiles in the artifacts. This is now fixed.
  • Mark BackStack.Record as @Stable.
  • Fix an infinite loop in the onRootPop of the Android rememberCircuitNavigator.
  • Update the default decoration to better match the android 34 transitions.
  • Update androidx.lifecycle to 2.7.0.
  • Update to compose multiplatform to 1.5.12.
  • Update to compose to 1.6.1.
  • Update to compose-bom to 2024.02.00.
  • Update compose-compiler to 1.5.9.
  • Update AtomicFu to 0.23.2.
  • Update Anvil to 2.4.9.
  • Update KotlinPoet to 1.16.0.
  • Compile against KSP 1.9.22-1.0.17.

Special thanks to @milis92, @ChrisBanes, and @vulpeszerda for contributing to this release!

New Contributors

Full Changelog: https://github.com/slackhq/circuit/compare/0.18.2...0.19.0

0.18.2

4 months ago
  • Fix: Fix lifetime of Records' ViewModelStores. This fully fixes #1065.
  • Update Molecule to 1.3.2.
  • Update Jetbrains' compose-compiler to 1.5.7.1.

Special thanks to @dandc87 for contributing to this release!

What's Changed

Full Changelog: https://github.com/slackhq/circuit/compare/0.18.1...0.18.2

0.18.1

4 months ago

Happy new year!

  • Fix: Fix popped Record's ProvidedValues lifetime. See #1065 for more details.
  • Fix: Fix GestureNavDecoration dropping saveable/retained state on back gestures. See #1089 for more details.

Special thanks to @ChrisBanes and @dandc87 for contributing to this release!

What's Changed

New Contributors

Full Changelog: https://github.com/slackhq/circuit/compare/0.18.0...0.18.1

0.18.0

4 months ago
  • New: Support animating an overlay out after returning a result with AnimatedOverlay.
  • Fix: Fix dropping back stack retained state on Android Activity rotations.
  • Enhancement: Add ability to customize ModalBottomSheet appearance in BottomSheetOverlay.
  • Update Kotlin to 1.9.22.
  • Update KSP to 1.9.22-1.0.16.
  • Update Dagger to 2.50.
  • Update kotlinx-collections-immutable to 0.3.7.
  • Update AndroidX Activity to 1.8.2.

Special thanks to @ChrisBanes, @chriswiesner, and @BryanStern for contributing to this release!

What's Changed

New Contributors

Full Changelog: https://github.com/slackhq/circuit/compare/0.17.1...0.18.0

0.17.1

5 months ago
  • Enhancement: Commonize SaveableStateRegistryBackStackRecordLocalProvider to be supported across all currently supported platforms.
  • Fix: Fix LocalBackStackRecordLocalProviders always returning a new composition local.
  • Update androidx.compose.compiler:compiler to 1.5.5
  • Update KotlinPoet to 1.15.3
  • Update Dagger to 2.49

Special thanks to @alexvanyo for contributing to this release.

What's Changed

Full Changelog: https://github.com/slackhq/circuit/compare/0.17.0...0.17.1

0.17.0

5 months ago

New: circuitx-effects artifact

The circuitx-effects artifact provides some effects for use with logging/analytics. These effects are typically used in Circuit presenters for tracking impressions and will run only once until forgotten based on the current circuit-retained strategy.

dependencies {
  implementation("com.slack.circuit:circuitx-effects:<version>")
}

Docs: https://slackhq.github.io/circuit/circuitx/#effects

New: Add codegen mode to support both Anvil and Hilt

Circuit's code gen artifact now supports generating for Hilt projects. See the docs for usage instructions: https://slackhq.github.io/circuit/code-gen/

Misc

  • Decompose various CircuitContent internals like rememberPresenter(), rememberUi, etc for reuse.
  • Make CircuitContent() overload that accepts a pre-constructed presenter/ui parameters public to allow for more control over content.
  • [samples] Update README to include the interop sample.
  • [samples] Various bugfixes to samples.
  • [docs] Link sources in kdocs.
  • [docs] Nest CircuitX artifacts in kdocs ToC.
  • Update uuid to 0.8.2.
  • Update KotlinPoet to 1.15.1.
  • Update to Compose Multiplatform 1.5.11.
  • Update to Kotlin 1.9.21.
  • Update to KSP 1.9.21-1.0.15.
  • Update to compose-compiler (multiplatform) 1.5.4.
  • Update to Molecule 1.3.1.

Special thanks to @jamiesanson, @frett, and @bryanstern for contributing to this release!

What's Changed

New Contributors

Full Changelog: https://github.com/slackhq/circuit/compare/0.16.1...0.17.0

0.16.1

6 months ago
  • Fix: Fix retained value not recalculating if inputs changed.
  • Build against KSP 1.9.20-1.0.14.

What's Changed

New Contributors

Full Changelog: https://github.com/slackhq/circuit/compare/0.16.0...0.16.1

0.16.0

6 months ago

New: circut-retained is now enabled by default

Following the discussion in #891 circut-retained is automatically added in CircuitCompositionLocals by default, we still allow overriding it with a no-op implementation. (#931)

Other Changes

  • Update to Kotlin 1.9.20.
  • Update Compose Multiplatform to 1.5.2.
  • Update agp to 8.1.2.
  • Update androidx.activity to 1.8.0.
  • Update benchmark to 1.2.0.
  • Update coil to 2.5.0.
  • Update compose.material3 to 1.1.2.
  • Update compose.material to 1.5.4.
  • Update compose.runtime to 1.5.4.
  • Update compose.ui to 1.5.4.
  • Update roborazzi to 1.6.0.

Whats Changed

  • Update compose.material3 to v1.1.2 by @slack-oss-bot in (#893)
  • Update dependency mkdocs-material-extensions to v1.2 by @slack-oss-bot in (#898)
  • Update dependency me.saket.telephoto:zoomable-image-coil to v0.6.1 by @slack-oss-bot in (#897)
  • Update dependency androidx.compose:compose-bom to v2023.09.01 by @slack-oss-bot in (#896)
  • Update dependency androidx.activity:activity-ktx to v1.8.0-rc01 by @slack-oss-bot in (#895)
  • Update dependency androidx.activity:activity-compose to v1.8.0-rc01 by @slack-oss-bot in (#894)
  • Update benchmark to v1.2.0-rc01 by @slack-oss-bot in (#892)
  • Update dependency mkdocs-material to v9.4.1 by @slack-oss-bot in (#899)
  • Update dependency me.saket.telephoto:zoomable-image-coil to v0.6.2 by @slack-oss-bot in (#900)
  • Update dependency mkdocs-material to v9.4.2 by @slack-oss-bot in (#901)
  • Update compose.jb to v1.5.2 by @slack-oss-bot in (#902)
  • Update dependency com.slack.eithernet:eithernet to v1.6.0 by @slack-oss-bot in (#904)
  • Implement Context.findActivity() with tailrec by @ZacSweers in (#903)
  • Update dependency androidx.compose.foundation:foundation to v1.5.2 by @slack-oss-bot in (#909)
  • Update compose.ui to v1.5.2 by @slack-oss-bot in (#907)
  • Update agp to v8.1.2 by @slack-oss-bot in (#912)
  • Update dependency com.autonomousapps.dependency-analysis to v1.23.1 by @slack-oss-bot in (#913)
  • Update dependency androidx.compose:compose-bom to v2023.09.02 by @slack-oss-bot in (#910)
  • Update dependency androidx.compose.animation:animation to v1.5.2 by @slack-oss-bot in (#908)
  • Update compose.runtime to v1.5.2 by @slack-oss-bot in (#906)
  • Update compose.material to v1.5.2 by @slack-oss-bot in (#905)
  • Update dependency com.autonomousapps.dependency-analysis to v1.24.0 by @slack-oss-bot in (#916)
  • Update dependency io.reactivex.rxjava3:rxjava to v3.1.8 by @slack-oss-bot in (#915)
  • Update dependency com.squareup.okio:okio to v3.6.0 by @slack-oss-bot in (#917)
  • Update dependency com.github.ajalt.clikt:clikt to v4.2.1 by @slack-oss-bot in (#918)
  • Update dagger to v2.48.1 by @slack-oss-bot in (#920)
  • Update dependency mkdocs-material to v9.4.3 by @slack-oss-bot in (#919)
  • Update dependency gradle to v8.4 by @slack-oss-bot in (#929)
  • Update dependency androidx.compose.foundation:foundation to v1.5.3 by @slack-oss-bot in (#928)
  • Update dependency androidx.compose.animation:animation to v1.5.3 by @slack-oss-bot in (#927)
  • Update dependency androidx.activity:activity-compose to v1.8.0 by @slack-oss-bot in (#925)
  • Update compose.runtime to v1.5.3 by @slack-oss-bot in (#923)
  • Update compose.material to v1.5.3 by @slack-oss-bot in (#922)
  • Update compose.ui to v1.5.3 by @slack-oss-bot in (#924)
  • Remove custom activity dep by @slack-oss-bot in (#926)
  • Add tests for code gen by @ZacSweers in (#930)
  • Update gradle enterprise and redact local data by @ZacSweers in (#932)
  • Include retained state registry setup in CircuitCompositionLocals by @ZacSweers in (#931)
  • Update dependency androidx.compose:compose-bom to v2023.10.00 by @slack-oss-bot in (#938)
  • Update androidx.activity to v1.8.0 by @slack-oss-bot in (#937)
  • Update dependency org.jetbrains.kotlinx:kotlinx-collections-immutable to v0.3.6 by @slack-oss-bot in (#936)
  • Update dependency mkdocs-material to v9.4.4 by @slack-oss-bot in (#935)
  • Update compose.jb to v1.5.3 by @slack-oss-bot in (#934)
  • Update benchmark to v1.2.0-rc02 by @slack-oss-bot in (#940)
  • Update dependency Markdown to v3.5 by @slack-oss-bot in (#941)
  • Update dependency com.autonomousapps.dependency-analysis to v1.25.0 by @slack-oss-bot in (#943)
  • Update dependency mkdocs-material to v9.4.5 by @slack-oss-bot in (#945)
  • Update dependency com.google.testparameterinjector:test-parameter-injector to v1.13 by @slack-oss-bot in (#947)
  • Update roborazzi to v1.6.0 by @slack-oss-bot in (#946)
  • Update dependency mkdocs-material to v9.4.6 by @slack-oss-bot in (#948)
  • Update lint to latest by @ZacSweers in (#951)
  • Add more controls for overrides by @ZacSweers in (#950)
  • Update dependency mkdocs-material-extensions to v1.3 by @slack-oss-bot in (#953)
  • Update dependency org.jetbrains.dokka to v1.9.10 by @slack-oss-bot in (#952)
  • Use data object in more appropriate places by @ZacSweers in (#955)
  • Update dependency androidx.compose.foundation:foundation to v1.5.4 by @slack-oss-bot in (#961)
  • Update dependency androidx.compose.animation:animation to v1.5.4 by @slack-oss-bot in (#960)
  • Update compose.ui to v1.5.4 by @slack-oss-bot in (#959)
  • Update benchmark to v1.2.0 by @slack-oss-bot in (#956)
  • Update dependency pymdown-extensions to v10.3.1 by @slack-oss-bot in (#965)
  • Update dependency org.jsoup:jsoup to v1.16.2 by @slack-oss-bot in (#964)
  • Update dependency androidx.compose:compose-bom to v2023.10.01 by @slack-oss-bot in (#962)
  • Update compose.material to v1.5.4 by @slack-oss-bot in (#957)
  • Update compose.runtime to v1.5.4 by @slack-oss-bot in (#958)
  • Update dependency com.google.testparameterinjector:test-parameter-injector to v1.14 by @slack-oss-bot in (#967)
  • Update dependency org.jline:jline to v3.24.0 by @slack-oss-bot in (#968)
  • Update dependency mkdocs-material to v9.4.7 by @slack-oss-bot in (#969)
  • Update dependency org.robolectric:robolectric to v4.11 by @slack-oss-bot in (#970)
  • Update coil to v2.5.0 by @slack-oss-bot in (#973)
  • Update dependency io.gitlab.arturbosch.detekt to v1.23.2 by @slack-oss-bot in (#971)
  • Update to Kotlin 1.9.20 by @ZacSweers in (#889)
  • Update dependency org.robolectric:robolectric to v4.11.1 by @slack-oss-bot in (#977)
  • Update dependency app.cash.molecule:molecule-runtime to v1.3.0 by @slack-oss-bot in (#978)
  • Update dependency mkdocs-macros-plugin to v1.0.5 by @slack-oss-bot in (#976)
  • Update dependency io.gitlab.arturbosch.detekt to v1.23.3 by @slack-oss-bot in (#975)
  • Update dependency Markdown to v3.5.1 by @slack-oss-bot in (#974)

Full Changelog: https://github.com/slackhq/circuit/compare/0.15.0...0.16.0