2023-04-06
circuit-runtime: common runtime components likeScreen,Navigator, etc.circuit-runtime-presenter: thePresenterAPI, depends oncircuit-runtime.circuit-runtime-ui: theUiAPI, depends oncircuit-runtime.circuit-foundation: the circuit foundational APIs likeCircuitConfig,CircuitContent, etc. Depends on the first three.
The goal in this is to allow more granular dependencies and easier building against subsets of the API. For example, this would allow a presenter implementation to easily live in a standalone module that doesn't depend on any UI dependencies. Vice versa for UI implementations.
Where we think this could really shine is in multiplatform projects where Circuit's UI APIs may be more or less abstracted away in service of using native UI, like in iOS.
| Before | After |
|---|---|
| com.slack.circuit.CircuitContext | com.slack.circuit.runtime.CircuitContext |
| com.slack.circuit.CircuitUiState | com.slack.circuit.runtime.CircuitUiState |
| com.slack.circuit.CircuitUiEvent | com.slack.circuit.runtime.CircuitUiEvent |
| com.slack.circuit.Navigator | com.slack.circuit.runtime.Navigator |
| com.slack.circuit.Screen | com.slack.circuit.runtime.Screen |
| Before | After |
|---|---|
| com.slack.circuit.Presenter | com.slack.circuit.runtime.presenter.Presenter |
| Before | After |
|---|---|
| com.slack.circuit.Ui | com.slack.circuit.runtime.presenter.Ui |
| Before | After |
|---|---|
| com.slack.circuit.CircuitCompositionLocals | com.slack.circuit.foundation.CircuitCompositionLocals |
| com.slack.circuit.CircuitConfig | com.slack.circuit.foundation.CircuitConfig |
| com.slack.circuit.CircuitContent | com.slack.circuit.foundation.CircuitContent |
| com.slack.circuit.EventListener | com.slack.circuit.foundation.EventListener |
| com.slack.circuit.NavEvent | com.slack.circuit.foundation.NavEvent |
| com.slack.circuit.onNavEvent | com.slack.circuit.foundation.onNavEvent |
| com.slack.circuit.NavigableCircuitContent | com.slack.circuit.foundation.NavigableCircuitContent |
| com.slack.circuit.NavigatorDefaults | com.slack.circuit.foundation.NavigatorDefaults |
| com.slack.circuit.rememberCircuitNavigator | com.slack.circuit.foundation.rememberCircuitNavigator |
| com.slack.circuit.push | com.slack.circuit.foundation.push |
| com.slack.circuit.screen | com.slack.circuit.foundation.screen |
- [Core] Remove Android-specific
NavigableCircuitContentand just use common one. Back handling still runs throughBackHandler, but is now configured inrememberCircuitNavigator. - [Core] Add
defaultNavDecorationtoCircuitConfigto allow for customizing the defaultNavDecorationused inNavigableCircuitContent. - [Core] Mark
CircuitUiStateas@Stableinstead of@Immutable. - [Code gen] Capitalize generated class names when source is a presenter function.
- [Sample] New
:samples:tacosorder builder sample to demonstrate complex state management. - [Sample]
NavigableCircuitContentexample in the desktop counter. - [Dependencies] Update compose to
1.4.1. - [Dependencies] Update compose-compiler to
1.4.4. - [Dependencies] Update androidx.activity to
1.7.0. - [Dependencies] Update molecule to
0.7.1.
2023-02-10
- New: Multiplatform support for
NavigableCircuitContent! Special thanks to @ashdavies for contributions to make this possible. - Fix:
circuit-retainedminSdk is now 21 again. We accidentally bumped it to 28 when merging in its instrumentation tests. - Enhancement: embedded baseline profiles are now embedded per-artifact instead of in the root
circuit-coreartifact. - Enhancement:
circuit-retainedis now covered in embedded baseline profiles. - [Code Gen] Update Dagger to
2.45. - [Code Gen] Update KSP to
1.8.10-1.0.9. - Update to compose-compiler
1.4.2. - Update to Kotlin
1.8.10.
2023-02-02
Happy groundhog day!
-
Breaking API change:
Ui.Content()now contains aModifierparameter.This allows you to pass modifiers on to UIs directly.
public interface Ui<UiState : CircuitUiState> { - @Composable public fun Content(state: UiState) + @Composable public fun Content(state: UiState, modifier: Modifier) } -
New: Add
Navigator.resetRoot(Screen)function to reset the backstack root with a new root screen. There is a correspondingawaitResetRoot()function added toFakeNavigator. -
New: Add
EventListener.startcallback function. -
New: Add Compose UI dependency to circuit-core (to support
Modifierin the API). -
Fix: Fix
CircuitContext.putTaggenerics. -
Fix: Fix KSP code gen artifact to just be a pure JVM artifact.
-
Fix:
EventListener.onState's type is nowCircuitUiStateinstead ofAny. -
Removed:
ScreenUiis now removed andUi.Factorysimply returnsUiinstances now. -
API Change:
CircuitConfig.onUnavailableContentis now no longer nullable. By default it displays a big ugly error text. If you want the previous behavior of erroring, replace it with a composable function that just throws an exception. -
Dependency updates
Kotlin 1.8.0
Compose-JB 1.3.0
KSP 1.8.0-1.0.9
Compose Runtime 1.3.3
Compose UI 1.3.3
Compose Animation 1.3.3
2022-12-22
- Enhancement: Circuit no longer requires manual provisioning of its internal backing
ViewModels. This is now done automatically by the Circuit itself. - Enhancement:
circuit-retainedis now fully optional and not included as a transitive dependency of circuit-core. If you want to use it, see its installation instructions in its README. - Enhancement: Mark
Screenas@Immutable. - Breaking API Change:
LocalCircuitOwneris now justLocalCircuitConfigto be more idiomatic. - Breaking API Change:
LocalRetainedStateRegistryOwneris now justLocalRetainedStateRegistryto be more idiomatic. - Breaking API Change:
Continuityis nowinternaland not publicly exposed since it no longer needs to be manually provided. - Breaking API Change:
ViewModelBackStackRecordLocalProvideris nowinternaland not publicly exposed since it no longer needs to be manually provided. - Fix: Add missing license info to pom.
- Dependency updates
[versions] anvil = "2.4.3" compose-jb = "1.2.2" compose-animation = "1.3.2" compose-compiler = "1.3.2" compose-foundation = "1.3.1" compose-material = "1.3.1" compose-material3 = "1.0.1" compose-runtime = "1.3.2" compose-ui = "1.3.2" kotlin = "1.7.22"
2022-12-07
- Breaking API Change:
PresenterandUifactories'create()functions now offer aCircuitContextparameter in place of aCircuitConfigparameter. This class contains aCircuitConfig, a tagging API, and access to parent contexts. This allows for plumbing your own metadata through Circuit's internals such as tracing tools, logging, etc. - Enhancement: New lifecycle functions added to
EventListener.onBeforeCreatePresenteronAfterCreatePresenteronBeforeCreateUionAfterCreateUionUnavailableContentonStartPresentonDisposePresentonStartContentonDisposeContentdispose
- Update Compose to
1.3.1. - Update Compose (JB) to
1.2.1. - Update Molecule to
0.6.1. - Added a demo to the STAR sample that shows how to navigate to standard Android components (#275).
2022-11-07
- Enhancement: Add back the
onRootPop()parameter inrememberCircuitNavigator()but useLocalOnBackPressedDispatcherOwnerfor backpress handling by default.
2022-11-01
- New: The Overlay API is now extracted to a separate, optional
circuit-overlayartifact. - New: The
circuit-coreartifact now packages in baseline profiles. - Enhancement: Simplify backstack root pop handling. There is no more
onRootPop()option inrememberCircuitNavigator(), instead you should install your ownBackHandler()prior to rendering your circuit content to customize back behavior when the circuitNavigatoris at root. - Fix:
circuit-codegen-annotationsis now a multiplatform project and doesn't accidentally impose the compose-desktop dependency.
We've also updated a number of docs around code gen, overlays, and interop (including a new interop sample).
2022-10-27
- Enhancement: Code gen now supports non-assisted constructor-injected types.
- Enhancement: Code gen checks that functions and classes are visible to generated factories.
2022-10-27
- Fix: Code gen didn't properly handle instantiating simple class types.
2022-10-26
-
New: Code gen artifact. This targets specifically using Dagger + Anvil and will generate
PresenterandUi.Factoryimplementations for you. SeeCircuitInjectfor more details.ksp("com.slack.circuit:circuit-codegen:x.y.z") implementation("com.slack.circuit:circuit-codegen-annotations:x.y.z")
-
New: There is now an
EventListenerAPI for instrumenting state changes for a givenScreen. See its docs for more details. -
Fix: Rework
rememberRetainedimplementation and support for multiple variables. Previously it only worked with one variable. -
Fix: Clean up some unnecessary transitive dependencies in misc artifacts.
Dependency updates
androidx.activity 1.6.1
androidx.compose 1.3.0
Molecule 0.5.0
2022-10-12
- Update to compose-jb
1.2.0. - Update to Turbine
0.12.0. - Fix: Accidentally running molecule twice in
Presenter.test().
2022-10-10
- Fix: Accidentally bundling more Compose UI dependencies than necessary.
2022-10-10
Initial release, see the docs: https://slackhq.github.io/circuit/.
Note that this library is still under active development and not recommended for production use. We'll do a more formal announcement when that time comes!