Skip to content

Releases: DrewCarlson/mobius.kt

v1.2.1

22 Jan 17:59
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.1.0...v1.2.1

v1.2.0

22 Jan 00:48
Compare
Choose a tag to compare

What's Changed

  • Added ExecutionPolicy to subtypeEffectHandler to provide control over how handlers are executed. Documentation - #188
  • rememberMobiusLoop now supports Jetpack Navigation scoping using ViewModels. Documentation - #189
  • Update to Kotlin 1.9.22 by @DrewCarlson in #185

Full Changelog: v1.1.0...v1.2.0

v1.1.0

17 Oct 06:31
Compare
Choose a tag to compare

What's Changed

  • Added project documentation
  • Added Compose MobiusLoop utilities: Documentation
  • Renamed mobiuskt-update-generator-* modules to mobiuskt-codegen-*
  • Removed dependency on kotlinx.collections.immutable
  • MobiusLoopViewModel.create(...) no longer requires an Init function
  • Added MobiusHooks.InternalLogger for control over internal Mobius.kt logging: Documentation
  • Added ignore<Effect>() to subtypeEffectHandler to drop specific effects
  • Extract Js WorkRunner into AsyncWorkRunner
  • Upgrade to Kotlin 1.9.10
  • Added linuxArm64, watchosDeviceArm64, and tvosSimulatorArm64 targets
  • Removed iosArm32 target

Full Changelog: v1.0.0-rc06...v1.1.0

v1.0.0-rc05

24 Feb 06:45
Compare
Choose a tag to compare

What's Changed

  • Allow InnerUpdate eventExtractor to return null, enabling partial mapping of Outer event to Inner events. Calling InnerUpdate.update with an event that maps to null is an error.
InnerUpdate.builder()
    .eventExtractor { outer -> outer as? InnerEvent }
    .build()
  • Add FilterEffectHandler to help with effect routing in CompositeEffectHandler when using reactive adapters and other configurations. The following extensions are available on Connectable: filter { it !is Effect.A }, exclude(Effect.A::class)
  • Add MappedEffectHandler to help with mapping Effects and Events when using CompositeEffectHandler
sealed class Effect {
    // ...
    data class DisplayPopupMessage(
        val message: String,
    ) : Effect(), PopupMessageEffect
}

CompositeEffectHandler.from(
    MySubtypeEffectHandler()
        .asConnectable()
        .exclude(PopupMessageEffect::class),
    PopupMessageEffectHandler()
        .asConnectable()
        .mapped()
)

Update Spec Generator Changes

  • When using a sealed interface for an Event type, generate branches which include the event parameter. Previously no branches were generated.
  • By default, Event types containing sealed classes will generate a method for each subtype.
sealed class Event {
    sealed class DataLoaded : Event() {
        data class Success(val data: JsonObject) : DataLoaded()
        data class Error(val reason: String): DataLoaded()
    }
}

// Generated Update Spec methods:
fun dataLoadedSuccess(model: Model, event: Event.DataLoaded.Success): Next<Model, Effect>
fun dataLoadedError(model: Model, event: Event.DataLoaded.Error): Next<Model, Effect>
  • Added @DisableSubtypeSpec which can be applied to sealed class Event subtypes to restore the previous behavior of generating a single method.
sealed class Event {
    @DisableSubtypeSpec
    sealed class DataLoaded : Event() {
        data class Success(val data: JsonObject) : DataLoaded()
        data class Error(val reason: String): DataLoaded()
    }
}

// Generated Update Spec methods:
fun dataLoaded(model: Model, event: Event.DataLoaded): Next<Model, Effect>

Dependencies:

  • Update dependency org.jetbrains.kotlin.multiplatform to v1.7.22 by @renovate in #111
  • Update ksp to v1.7.22-1.0.8 by @renovate in #112
  • Update dependency org.slf4j:slf4j-api to v2.0.6 by @renovate in #114
  • Update dependency org.robolectric:robolectric to v4.9.2 by @renovate in #116
  • Update dependency androidx.test:runner to v1.5.2 by @renovate in #120

Full Changelog: v1.0.0-rc02...v1.0.0-rc05

v1.0.0-rc02

22 Nov 21:33
Compare
Choose a tag to compare

What's Changed

Dependencies:

  • Update dependency org.robolectric:robolectric to v4.9 by @renovate in #94
  • Update dependency org.jetbrains.kotlinx.kover to v0.6.1 by @renovate in #95
  • Update dependency org.jetbrains.dokka to v1.7.20 by @renovate in #97
  • Update atomicfu to v0.18.5 by @renovate in #100
  • Update dependency org.jetbrains.kotlinx.binary-compatibility-validator to v0.12.1 by @renovate in #99
  • Update dependency com.android.tools.build:gradle to v7.3.1 by @renovate in #89
  • Update dependency org.jetbrains.kotlin.multiplatform to v1.7.21 by @renovate in #102
  • Update ksp to v1.7.21-1.0.8 by @renovate in #104
  • Update dependency org.slf4j:slf4j-api to v2.0.4 by @renovate in #106
  • Update dependency androidx.test:runner to v1.5.1 by @renovate in #105

Full Changelog: v1.0.0-rc01...v1.0.0-rc02

v1.0.0-rc01

19 Aug 00:17
Compare
Choose a tag to compare
  • Add ExperimentalUpdateGenerator to GenerateUpdate annotation
  • Fix race condition when disposing WorkRunners in an active loop
  • Darwin: Fix crash when using WorkRunners.main()

v0.6.0

23 Feb 23:58
5a94d04
Compare
Choose a tag to compare
  • Update to Kotlin 1.6.20-M1
  • Add @JsExport to public API surface, which results in generally usable typescript definitions
  • Renamed mobiuskt-update-spec modules to mobiuskt-update-generator
  • Replaced @UpdateSpec with @GenerateUpdate which is applied to the Update<M, E, F> class declaration

v0.5.2

21 Jan 23:43
5aee60a
Compare
Choose a tag to compare
  • Add MobiusLoopViewModel
  • Hide SubtypeEffectHandler methods which include the kclass method parameter

v0.5.1

17 Jan 15:59
Compare
Choose a tag to compare
  • mobiskt-android has been merged into mobiuskt-core, previous 0.5.x and 0.4.x Android module release did not work correctly
  • Init logging from controllers

v0.5.0

13 Jan 23:27
db3564d
Compare
Choose a tag to compare
  • Implement Update Spec generator, see https://github.com/DrewCarlson/mobius.kt#update-spec
  • Hide various internal components from public API surface, removes MobiusLoopController_ from Swift autocomplete among other unnecessary classes and reduces compile time when exporting Mobius.kt to a Framework binary
  • Add WorkRunners.mainDispatchQueue() and WorkRunners.globalDispatchQueue() as well as DispatchQueueWorkRunner.companion.main() and DispatchQueueWorkRunner.companion.global() for Swift
  • Add @Throws to relevant APIs for improved Kotlin/Native usage