mavericks

Mavericks: Android on Autopilot

APACHE-2.0 License

Stars
5.7K
Committers
65

Bot releases are visible (Hide)

mavericks - 2.0.0-beta3

Published by elihart almost 4 years ago

Changes since beta 2

Make MavericksViewModel extension functions protected (#488)
Add MavericksViewModel.awaitState (#487) to access current ViewModel state via a suspend function
Mark all @RestrictTo APIs with @InternalMavericksApi (#480)
Api additions to the mocking framework (#475) (#477)
Migrated CoroutinesStateStore to SharedFlow (#469)
Launcher and mock speed optimizations (#468)

mavericks - 2.0.0-beta2

Published by elihart almost 4 years ago

Coroutine api tweaks (#464)
Fix mocking docs (#465)
Never complete ViewModel.stateFlow (#460)
Tweaks and additions to the mocking framework (#461)
Allow configurable StateStore CoroutineContext (#454)
[2.0] Cleaned up and obfuscated some @RestrictTo APIs (#453)

Breaking

  • If you had been using any restricted internal mvrx library functions your build may break as they have been renamed (you shouldn't be doing this, but in case you are...)
  • MockableMavericks.initialize function signature has changed
mavericks - 2.0.0-beta1

Published by elihart about 4 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.
mavericks - 1.5.1

Published by elihart over 4 years ago

  • Fix incorrectly failing debug assertions for state class being a data class when a property has internal visibility
mavericks - 1.5.0

Published by elihart over 4 years ago

  • Add an optional nullable value to all Async classes (#383)
  • Update various dependencies

Note: MvRx now targets 1.8 for Java/Kotlin, so you may need to update your projects to also target
1.8

android {
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8.toString()
    }
}
mavericks - 1.4.0

Published by elihart over 4 years ago

  • Remove Kotlin-Reflect entirely (#334)
  • Remove extra proguard dependency (#310)
mavericks - 2.0.0 Alpha 2

Published by elihart almost 5 years ago

Fixes an issue in alpha 1 where the mvrx-launcher artifact wasn't actually present.

mavericks - 2.0.0 Alpha 1

Published by elihart almost 5 years ago

This is a new major release with breaking changes. It incorporates a mocking system into MvRx to declare test data for screens and leverage that data with various testing tools. For a high level overview of this system, see this article series.

The main breaking change is that the debugMode parameter no longer exists on BaseMvRxViewModel. Instead, you define a global app wide debug setting by setting MvRx.viewModelConfigFactory = MvRxViewModelConfigFactory(applicationContext) from your app's initialization.

See the configuration wiki for more details.

Additionally, the MvRxTestRule from the mvrx-testing artifact has changed its interface slightly. Notably the debug mode enum has been changed to a boolean. See the testing wiki page for details on this artifact.

Mocking

If you would like to use the new mocking system, you can replace the MvRx configuration call with MvRxMocks.install(applicationContext).

Additionally, you can define mocks for your screens by using the MockableMvRxView interface instead of MvRxView. This unlocks usage of the MvRx Launcher for easily browsing all screens and mocks in your app.

For more details on the mocking system, see the wiki page

Feedback

This is an alpha so that we can receive feedback on the mocking apis and documentation (as well as bugs of course). Please let us know what you think and what changes you would like to see before the stable release!

mavericks - 1.3.0

Published by elihart almost 5 years ago

  • Revamp state saving to use Android Jetpack SavedStateRegistry (#254)

Breaking - This removes the need for MvRxViewModelStoreOwner and BaseMvRxActivity and thus those classes
are now deleted.

If you were using BaseMvRxActivity you can instead now extend from AppCompatActivity.

All usages of mvrxViewModelStore can simply be deleted - state saving now happens completley
automatically.

mavericks - 1.2.1

Published by elihart about 5 years ago

  • Fix sources not included in 1.2.0 release
mavericks - 1.2.0

Published by elihart about 5 years ago

  • Make searching for the companion object factory more robust #283
  • Fix infinite thread leaks while flushing queues in state store #302
  • Adding inter view model subscription support #287
mavericks - v1.1.0

Published by gpeal about 5 years ago

  • New parentFragmentViewModel() and targetFragmentViewModel() ViewModel delegate scopes #247
  • Disallow functions in state #250
  • Log execute errors in debug mode #260
  • Fixed proguard issues with 1.0.2 #267
mavericks -

Published by gpeal over 5 years ago

  • MvRx now requires androidx.
  • Fix: prevented duplicate subscriptions when subscriptions are made after onCreate. #210
  • Respect uniqueOnly across configuration changes. #207
    • This comes with additional code in BaseMvRxFragment. If you are not using BaseMvRxFragment, please refer to #207 for the additional required code.
  • Remove state coalescing. #206
  • Require that all MvRxViewModels actually provide a value for debugMode. #196
Package Rankings
Top 5.65% on Repo1.maven.org
Top 3.88% on Proxy.golang.org
Badges
Extracted from project README
Build Status Maven Central codecov.io Maven Central
Related Projects