Skip to content

2.4.0

Compare
Choose a tag to compare
@Nek-12 Nek-12 released this 11 Feb 23:19
· 395 commits to master since this release
2.4.0
6403ec7

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