Changelog History
Page 2
-
v2.1.0 Changes
- โฌ๏ธ Upgraded to Kotlin 1.4.30.
- โ Removed
@RestrictTo
annotations in favor of just@InternalMavericksApi
. The Kotlin opt-in annotations work more reliably than the Android lint rules and there is no need for both. - ๐ Created initial release of mavericks-compose.
๐ฅ Breaking Changes
- ActivityViewModelContext and MavericksViewModelFactory now uses ComponentActivity instead of FragmentActivity to improve Compose interop. ComponentActivity is the super class of FragmentActivity so you may need to replace FragmentActivity with ComponentActivity if you using ActivityViewModelContext.
-
v2.0.0 Changes
๐ Mavericks 2.0 is a ground up rewrite for coroutines. Check out the documentation for 2.0 to find out what is new and how to upgrade.
๐ฅ Breaking Changes
- All
mvrx
artifact names are nowmavericks
. - If you are using RxJava, you will need to use
mavericks-rxjava2
to maintain backwards compatibility. New Mavericks users who just use coroutines can just usemavericks
. - If your MavericksView/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 - MavericksViewModel and BaseMvRxViewModel (from mavericks-rxjava2) no longer extends Jetpack ViewModel. However,
viewModelScope
andonCleared()
still exist to match the existing API - The order of nested with and set states has changed slightly. It now matches the original intention.
If you had code like:
kotlin 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] - viewModelScope is now a property on MavericksViewModel and BaseMvRxViewModel (from mavericks-rxjava2), not the Jetpack extension function for ViewModel. Functionally, this is the same but the previous viewModelScope import will now be unused
- ๐ If you had been using any restricted internal mavericks library functions your build may break as they have been renamed (you shouldn't be doing this, but in case you are...)
Other Changes
- ๐ 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)
- FragmentViewModelContext now allows for custom ViewModelStoreOwner and/or SavedStateRegistry that are different from the fragment ones in FragmentViewModelContext. (#443)
- โ Add mavericks-navigation artifact to support AndroidX Navigation destination ViewModels
navGraphViewModel(R.id.my_graph)
(#443)
- All
-
v2.0.0-beta3 Changes
December 02, 2020๐ 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) -
v2.0.0-beta2 Changes
October 21, 2020๐ฅ Breaking Changes
- The order of nested with and set states has changed slightly. It now matches the original intention.
If you had code like:
kotlin 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.
- ๐ 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...)
- The order of nested with and set states has changed slightly. It now matches the original intention.
If you had code like:
-
v2.0.0-beta1 Changes
September 18, 2020- โ
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.
- โ
The
-
v2.0.0-alpha2 Changes
December 18, 2019๐ Fixes an issue in alpha 1 where the mvrx-launcher artifact wasn't actually present.
-
v2.0.0-alpha1 Changes
December 11, 2019๐ 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 onBaseMvRxViewModel
. Instead, you define a global app wide debug setting by settingMvRx.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 withMvRxMocks.install(applicationContext)
.โ Additionally, you can define mocks for your screens by using the
MockableMvRxView
interface instead ofMvRxView
. 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!
-
v1.5.1 Changes
June 22, 2020- ๐ Fix incorrectly failing debug assertions for state class being a data class when a property has internal visibility
-
v1.5.0 Changes
May 15, 2020- โ 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.8android { kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() } }
-
v1.4.0 Changes
March 16, 2020