MvRx v2.0.0-beta1 Release Notes

Release Date: 2020-09-18 // over 3 years ago
    • ✅ The mvrx artifact no longer has a dependency on RxJava, and the ViewModel and StateStore are now implemented with Kotlin Coroutines
    • You can continue accessing the previous RxJava ViewModel extensions by using the mvrx-rxjava2 artifact
    • To reflect the underlying removal of RxJava from the MvRx implementation we are renaming the implementation to Mavericks
    • 🆕 New documentation for the rewrite is available at https://airbnb.io/MvRx/#/
    • 🤡 A mvrx-mocking artifact now provides built in support for mocking viewmodels, states, and full screens
    • The order of nested with and set states has changed slightly. It now matches the original intention.
      If you had code like:

      withState { // W1 withState { // W2 } setState { // S1 setState { // S2 setState { // S3 } } } }

    Previously, setState would only be prioritized at that nesting level so it would run:
    [W1, S1, W2, S2, S3]
    Now, it will run:
    [W1, S1, S2, S3, W2]

    • If your MvRxView/Fragment does not use any ViewModels, invalidate() will NOT be called in onStart(). In MvRx 1.x, invalidate would be called even if MvRx was not used at all. If you would like to maintain the original behavior, call postInvalidate() from onStart in your base Fragment class.
    • BaseMvRxViewModel no longer extends Jetpack ViewModel
    • viewModelScope is now a property on BaseMvRxViewModel, not the Jetpack extension function for ViewModel. Functionally, this is the same but the previous viewModelScope import will now be unused.