Skip to content

3.1.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 24 Dec 10:31
· 40 commits to master since this release
304b73f

Highlights of 3.1 release

API Changes:

  • Reversed the order of onStop invocations. The onStop callback in plugins is now invoked in the opposite order (bottom to top)! This change was made to support using and referencing plugins or values of a store (such as cache) in the onStop callback. Most users shouldn't be affected, but ideally you should check each place where onStop is used manually.
  • updateStateImmediate is now inline. This will require additional imports in your code.
  • the unsafe state property of the store is now inline. Additional imports will be needed in your code if you are using it.
  • In test DSL, the time travel plugin is now installed after the plugin is run, meaning it gets the resulting value of the plugin test, not the initial. For example, if previously a plugin swallowed an exception, it was still present in the TimeTravel. Now it isn't, to better align with expectations on plugin execution.
  • Changed the return type of Store.start() to a new object - StoreLifecycle - which can be used to wait for the store to start, stop, and shut it down.

New features

  • First release of the IDE plugin 💫! It provides easy to use Live templates which generate stores, plugins, screens for you using shortcuts fmvim - for models, fmvic - for containers, fmvis - for composable screens, fmvip - for plugins, and more.
    • Additionally, the plugin fully includes the debugger, previously packaged as a standalone app.
  • New branch of plugin DSL - Decorators! Currently experimental, they are very similar to plugins, but allow to intercept and observe the invocation chain of a plugin, or the entire store. They are a more powerful alternative to plugins with a slightly different behavior. See docs for more info.
  • Debugger now allows basic operations to control the store
  • New onStop handler callback for PipelineContext, which will invoke an action on store closure. It is less safe than the deinit plugin but can be used where deinit is not available, e.g. async code.
  • android module now has more than just the android target and uses the new Androidx.Viewmodel multiplatform support.
  • Wasm WASI support for core module
  • New plugin callbacks:
    • onUndeliveredIntent to handle undelivered intents
    • onUndeliveredAction - same for actions.
    • onStop now has access to store config and can change the state.
  • Huge performance improvements to the library improve the speed by 250-1600%, making the library one of the fastest among 35 researched alternatives
  • New config property stateStrategy that replaces the atomicStateUpdates and allows for customization of whether the state transactions will be reentrant, serialized, or immediate. The non-reentrant strategy now includes runtime checks that prevent deadlocks (active in debug mode only)
  • New config property allowTransientSubscriptions allows to control whether the subscribers can leave and return on their own
  • New savedStatePlugin's SaveBehavior - Periodic, that allows to save the state every N seconds.
  • Quickstart has been rewritten from scratch to explain the library in <10 minutes. Added a page for decorators and updated readme as well

New Plug-Ins

  • resetStatePlugin - to clean up the store's state
  • asyncCache - to asynchronously run initialization routines and cache the result
  • deinit - for running actions when the store is stopped

New Decorators

  • intentTimeout - for disallowing long reducing operations
  • conflateIntents / conflateActions - for preventing duplicate events
  • retryIntents - for retrying failed intent reduction
  • batchIntents - sends intents in batches to improve peformance

Dependencies:

  • CMP 1.7.3
  • Kotlin 2.0.21
  • Coroutines 1.10.1
  • Ktor 3.0.3 for debugger
  • Serialization 1.8-RC

Bug fixes

  • Important fix for #121 which would throw UnrecoverableException if the exception was caught in a nested clause, like: onStart { updateState { throw Exception() } }
  • A lot of issues fixed on the debugger
  • Improved visuals of the debugger and sample app, new theme colors

Since 3.1.0-beta06 release:

  • fix plugin live templates
  • fix wide screen display on sample app
  • bump deps
  • update readme
  • remove dokka workaround and enable it back