Skip to content

Releases: respawn-app/FlowMVI

2.5.0-alpha02

09 Mar 17:13
2.5.0-alpha02
f55a84d
Compare
Choose a tag to compare
2.5.0-alpha02 Pre-release
Pre-release

New Features:

  • Remote Debugging! A new module family debugger-* allows to debug your stores remotely, with a dedicated app provided for Linux, MacOS, Windows. Also, the debugger app is implemented using FlowMVI and can be used as a sample app. Debugger setup explained in docs.
  • Essenty Integration! Two new modules: essenty and essenty-compose provide integration with Decompose and Essenty libraries. Essenty setup explained in docs
  • New Lifecycle Implementation for store subscription in Compose. The Compose module now provides an interface SubscriberLifecycle that has to be provided to the subscribe function to subscribe to the store. It also allows integration with Platform lifecycle (when it is made multiplatform) and Essenty lifecycle.
  • Refactoring of StoreLogging allowed to provide a more robust logging code on all supported platforms. You can now provide your own StoreLogger implementation or use the platform one as before.
  • Wasm support for core, test and compose modules! Also enables missing js support for compose module.
  • Compose 1.6.3
  • New flag atomicStateUpdates in store builders allows disabling serialization / atomicity of state updates if that is not needed, improving performance. true by default
  • Project Icon, banner, and star history
  • New overload of store.subscribe() that does not require a scope ( a with() call)

Bug Fixes:

  • Fixed file name for serializeState function using store name
  • Fix Saver s handling cancellation exceptions
  • Added a missing overload of timeTravel that would create and return the object for the user

Breaking Changes:

  • Compose's subscribe function now requires the consumer to pass a lifecycle to it as a parameter on all platforms where lifecycle is not supported to prevent the user from mistakenly subscribing to the store without using a proper lifecycle. Lifecycle implementations can be custom, provided via a composition local, or used from an integration module. To maintain a previous behavior on non-Android platforms, pass a DefaultLifecycle as a parameter to the subscribe function. Android users don't have this breaking change.
  • Store implementations now require a hashcode/equals contract
  • When store has actions disabled, it will now throw an UnrecoverableException to fail faster and avoid recover plugins
  • Deprecated parentStorePlugin in favor of a simple store.collect suspending function. It's much more flexible and allows to merge the incoming state with other data sources
  • Deprecated platformLoggingPlugin as a default loggingPlugin now uses a platform logger by default

What's Changed

2.4.1

13 Feb 16:16
ee47c22
Compare
Choose a tag to compare
  • Added compose stability configuration definitions
  • Added docs on how to configure stability in compose
  • Removed annotations module and related hacks

2.4.0

11 Feb 23:19
2.4.0
6403ec7
Compare
Choose a tag to compare

New Features:

  • Implemented a plugin testing DSL. The plugin allows invoking store plugin methods directly and observing any side effects the plugin produced. It also embeds and installs the time travel plugin to keep track of any changes.
    Library tests are already using the testing dsl. See the tests for some example usages.
  • New overload for subscribe that suspends forever. Useful inside other stores and other places
  • Logging plugin now logs when it is created and exception stacktraces
  • joinAll method for JobManager with vararg argument
  • Made compositePlugin public. Composite plugin is the underlying implementation of FlowMVI's plugin logic. It is mostly useful in tests and some very rare edge cases.
  • Updated docs and readme
  • Dropped the rc suffix as the library is 70% covered by tests and has been in prod for quite some time

Breaking changes

  • nameByType has been relocated to a different package
  • TimeTravelPlugin no longer implements the plugin interface directly. Instead, it uses a TimeTravel object and installs a separate plugin when requested. This is to allow storing the time travel object elsewhere and to not leak plugin methods as public API
  • Same change for CachePlugin and UndoRedoPlugin. Their plugins are now just hooks and the CachedValue and UndoRedo are completely separate from the store.
  • NativeStore for iOS code has been changed to implement Store, and some useless methods such as cancel were removed. Canceling the store now also cancels its scope. To cancel just the subscription job, cancel the one returned from subscribe
  • AbstractStorePlugin is now deprecated. Base classes are evil! Everything that you could do with the base class you can do with a plugin { } builder.

Bug fixes:

  • Disabled android debug artifacts publishing. FlowMVI does not publish different debug/release configurations
  • Removed reified parameter from savedStatePlugin builder to allow creating this plugin somewhere else. For example, savers can now be injected, with different savers for testing (NoOpSaver) and main code:
    internal class DefaultStoreConfiguration(
        files: FileManager,
        private val analytics: Analytics,
        private val json: Json,
    ) : StoreConfiguration() {
     override fun <S : MVIState, I : MVIIntent, A : MVIAction> StoreBuilder<S, I, A>.configure(
         serializer: KSerializer<S>,
     ) { 
         /* configure the store builder here without exposing any implementation details*/
         install(
           analyticsPlugin(analytics),
           kermitLoggingPlugin(),
           serializeStatePlugin(dir = files.cacheDir, json = json, serializer = serializer)
         )
       }
    }
    A documentation page is going to be made soon for this functionality.

Dependencies:

  • Kotlin 1.9.22
  • Compose: Compiler 1.5.9, compose 1.6.1,
  • Coroutines 1.8.0-rc2
  • lifecycle 2.7.0

2.3.0-rc

04 Jan 09:58
c0512a8
Compare
Choose a tag to compare

Added a new module: savedstate

The module allows saving the state of the store to a persistent storage.

  • Saves the state safely, clears it on exceptions in the store
  • Allows providing customizable conditions for saving the state, such as on unsubscription and on state changes
  • Supports GZIP compression on JVM and Android
  • Supports Android Parcelable
  • Supports saving state of a particular type
  • Can save partial data (subset of a state)
  • Supports kotlinx.serialization
  • Supports custom saving logic
  • Allows to inject saving logic using DI

Learn more in the documentation: https://opensource.respawn.pro/FlowMVI/#/savedstate

2.2.2-rc

22 Dec 11:48
5c306c8
Compare
Choose a tag to compare
  • Improve exception handling of stores. No changes are necessary when using the library. This update prevents some issues with stackoverflow errors due to throwing in onException handling
  • Minor refactoring

2.2.1-rc

13 Dec 16:02
78601c6
Compare
Choose a tag to compare
  • Fixed recoverPlugin not catching all errors
  • Kotlin 1.9.21
  • Fixed package name for some android plugins

2.2.0-rc

02 Dec 18:42
afc3526
Compare
Choose a tag to compare

New features

  • Compose multiplatform support for android, ios and jvm (desktop). New module compose replaces android-compose
  • New versioning schema (without rc candidate numbers) to indicate the library as a whole being RC

Bugfixes

  • Fixed logging plugin reporting invalid subscription counts
  • Fixed awaitSubscribers plugin deadlocking the store
  • Improved internal store performance by inlining some code

Breaking Changes

  • android-compose artifact is deprecated entirely.
    To migrate, please replace "android-compose" with "compose" in your gradle dependency definition, and then run a project-wide replace action:
    pro.respawn.flowmvi.android.compose. -> pro.respawn.flowmvi.compose.
    No other actions should be necessary.

2.1.0-rc03

01 Dec 12:34
2.1.0-rc03
2fd1b67
Compare
Choose a tag to compare

This is an important release with fixes, performance improvements and a better API.

Breaking changes

  • JobManager object now has a type for the Job's key. If you used string keys before, just add a string type: JobManager<String>
  • onSubscribe and onUnsubscribe are now suspending. Suspending either of the callbacks will make other updates to the subscription count wait for the completion of the job
  • Subscribers will no longer wait for the store to start. This means there are no guarantees anymore that all of the onSubscribe/onUnsubscribe callbacks will be invoked and in a given order. This is because due to asynchronous systems and frameworks such as Compose, the subscription event may come before the previous subscriber unsubscribes.
  • onSubscribe's "subscriber scope" parameter has been removed. We haven't found any use cases for that other than influencing the subscription lifecycle from inside the store, which is a leak of responsibility and creates unexpected behavior. You'll likely want to simply remove the "_" from the _, subs -> lambda you were using and that will be it.
  • Immutable store interface is no longer autocloseable to better align with the api

New Features

  • ImmutableStore interface is now fully supported. This interface is useful for MVVM+ style declarations to prevent leaking the store internals to subscribers of the store
  • Undo/Redo can now be configured to clear the queue on exception. true by default
  • New plugin - parentStore - will allow a store to connect to another store, becoming a subscriber of it. The subscription will follow the lifecycle of the child store subscribers (whileSubscribed is used under the hood)
  • New EmptyState object as a placeholder for stores with no state

Bugfixes

  • Fixed an issue where store's lifecycle owner would not restart the subscription job when it changes. This happened with, for example, the navbackstack entry's lifecycle in compose
  • Fixed an issue where whileSubscribed would sometimes leak its jobs
  • Fixed subscribe DSL in compose not using Dispatchers.Main.immediate
  • Fixed some infinite loops with recover plugin exception handling
  • Improved performance of subscribe dsl by creating different overloads
  • Kotlin 1.9.20 / compose 1.6.0-beta02

2.1.0-rc02

26 Oct 16:05
cdb03ce
Compare
Choose a tag to compare
  • Fixed a bug that would cause the store to resubscribe every time the state was change
  • Fixed a bug that would start the store with its initial state and not the current one upon entering composition
  • Some performance improvements
  • Fixes to NativeStore API
  • Updated deps (Compose 1.5.4)

P.S. Github messed up the order of releases, so please see RC01 for the previous release

2.0.0-beta08

26 Oct 16:02
ebacf71
Compare
Choose a tag to compare
  • Added a new plugin - disallowRestartPlugin to make the store non-restartable
  • Added a new plugin - cachePlugin to cache the values in store's scope and execute suspending code
  • Updated docs
  • Published an article about the architecture