Skip to content

Update orbit to v12 - #285

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/major-orbit
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/major-orbit

Conversation

@renovate

@renovate renovate Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
org.orbit-mvi:orbit-compose 11.0.012.0.1 age confidence
org.orbit-mvi:orbit-core 11.0.012.0.1 age confidence

Release Notes

orbit-mvi/orbit-mvi (org.orbit-mvi:orbit-compose)

v12.0.1

Compare Source

  • Add orbitContainer factories with types inferred from OrbitContainerHost (#​348)
  • Add public awaitItem() to the new test contexts (#​343) (#​344)
  • Fix coroutine resource leaks and CancellationException handling (#​345)
  • Replace Unconfined produce with completion handler for idling teardown (#​346)

Full Changelog: orbit-mvi/orbit-mvi@12.0.0...12.0.1

Thank you for suggestions and contributions ❤️ :

v12.0.0

Compare Source

One container host to rule them all

The headline change in this release is the unification of Orbit's container host API. Until now, external state support lived in a parallel universe of types: ContainerHost sat alongside ContainerHostWithExternalState, Container alongside ContainerWithExternalState, and each pair dragged its own set of factory functions and extensions across the core, compose, viewmodel and test modules. Choosing to separate your internal and external state meant switching to an entirely different interface hierarchy, and the duplication made every feature twice as expensive to build and document.

That split is now gone. A single OrbitContainerHost<INTERNAL_STATE, EXTERNAL_STATE, SIDE_EFFECT> interface (backed by a matching OrbitContainer) covers both cases. A host that doesn't need the separation simply uses the same type for both state parameters — OrbitContainerHost<MyState, MyState, MySideEffect> — while a host that wants to keep a rich internal model and expose a lean UI-facing state declares two different types and supplies a transform to the new orbitContainer(initialState, transformState) factory. The container() factory functions on CoroutineScope and ViewModel have been renamed to orbitContainer() to match.

We decided to add the Orbit prefix to main library types, as the historical ones were too generic and this planned unification gave us a good opportunity to fix this.

Migration should be painless: the old names survive as deprecated typealiases with ReplaceWith guidance, so existing ContainerHost<S, SE> code compiles unchanged and the IDE can rewrite it for you. The withExternalState extension is deprecated in favour of the unified factory, and in the test module test() is deprecated in favour of testWithInternalState() and testWithExternalState(), whose assertion methods now say which state they mean (awaitInternalState(), expectExternalState(), and so on). The documentation has been rewritten around the unified API.

The unified path also picked up two correctness fixes along the way. Subscribing to a container's external state flows now triggers onCreate, which previously only fired for internal state and side effect subscriptions — despite the external flows being exactly what UI consumers collect. And testWithExternalState now seeds the initial external state correctly for hosts still built with the deprecated withExternalState, where it previously resolved the wrong transform and failed with a ClassCastException.

Side effect delivery modes

Side effects have historically assumed a single observer. This release introduces a SideEffectMode setting with three delivery strategies: FAN_OUT, the default, preserves the existing channel-based behaviour where each effect goes to exactly one consumer; FAN_OUT_STRICT does the same but throws if a second consumer ever attaches, turning a silent misconfiguration into a loud one; and the experimental BROADCAST delivers every effect to all active consumers and has a cache that holds effects while no one is listening with the same lossless backpressure as fan-out.

Configuring containers globally

Orbit.configureDefaults { } lets you set default container settings once at app startup instead of repeating them at every orbitContainer() call, with per-container settings still taking precedence. Relatedly, the dispatcher settings (eventLoopDispatcher, intentLaunchingDispatcher) are now factories of type () -> CoroutineDispatcher, invoked once per container — so an expression like Dispatchers.Default.limitedParallelism(1) in the global defaults gives each container its own dispatcher view rather than one shared app-wide. If you set these directly, wrap the value in a lambda.

Operators

runOn and subIntent have graduated to stable API and no longer require opting in to @OrbitExperimental. Joining them is the new experimental awaitRunOn<T>, designed for sealed-class states: where runOn returns immediately if the current state doesn't match, awaitRunOn suspends until the state becomes the requested subtype and then runs its block — handy for logic that should kick in once a Loading state resolves to Ready. Thank you to @​rubixhacker for the proposal and implementation.

Documentation

The docs website gained a version selector generated from release tags, so the site root always serves the docs for the latest release while unreleased documentation is published under /next/.

Detailed Changes
New Contributors

Full Changelog: orbit-mvi/orbit-mvi@11.0.0...12.0.0


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/major-orbit branch from 25cd113 to edf29f1 Compare August 28, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants