mavericks

Mavericks: Android on Autopilot

APACHE-2.0 License

Stars
5.7K
Committers
65

Bot releases are hidden (Show)

mavericks - 3.0.9 Latest Release

Published by rossbacher 9 months ago

  • Fix crash in state restoration with multiple of 32 fields (#707)
mavericks - 3.0.8

Published by elihart 11 months ago

Fixing #699 java.lang.SecurityException from mock printer (#700)

mavericks - 3.0.7

Published by elihart about 1 year ago

Update dependencies to fix lifecycle inheritance (#689)

mavericks - v3.0.5

Published by rossbacher over 1 year ago

    • fc70e45: Fix issue with classloader while loading fragment args (#688) (Andreas Rossbacher) #688
mavericks - 3.0.0

Published by elihart about 2 years ago

3.0.0

  • Experimental mvrx-common module with new abstraction MavericksRepository that behaves exactly like MavericksViewModel except it doesn't have any Android dependencies and can be used in pure Kotlin modules (#635)
  • Breaking changes: MavericksViewModelConfig.BlockExecutions is extracted into top level class MavericksBlockExecutions (#635)
  • New mavericks extension argsOrNull to handle optional (nullable) fragment args (#639)
  • New Anvil sample in the sample-anvil module

See more details in https://airbnb.io/mavericks/#/new-3x

mavericks - 2.7.0

Published by elihart over 2 years ago

  • Add mockEightViewModels and mockNineViewModels to MockBuilder (#633)
mavericks - 2.6.1

Published by elihart over 2 years ago

Expose state restoration functions (https://github.com/airbnb/mavericks/pull/611)
Use passed scope as fragment if possible (https://github.com/airbnb/mavericks/pull/618)

mavericks - 2.6.0

Published by elihart over 2 years ago

Big thanks to @itsandreramon for contributing the two main improvements in this release!

mavericks - 2.5.1

Published by elihart almost 3 years ago

  • Add ability to manually pass argument to composable viewModel factories (#595)
  • Fix Fragment arguments not being correctly passed to viewmodel state initialization in compose usage (#595)
  • Switch mavericks-compose artifact to use same versioning scheme as other artifacts
mavericks - 2.5.0

Published by elihart almost 3 years ago

  • Fix issue when the LocalContext is not directly an Activity (#582)
  • update to Compose 1.0.4, Kotlin 1.5.31, Koin 3.1.3 (#586)
  • Ignore VerifyError Exception when loading potential mockable classes #590
mavericks - 2.4.0

Published by elihart about 3 years ago

2.4.0

  • Add covariant recreation support (#565)
  • Exposing unique subscription handling for custom flow operations (#560)
  • Add support for restoring ViewModels that were initially created with a companion factory in a superclass #566
mavericks - 2.3.0

Published by elihart over 3 years ago

2.3.0

  • Error handling enhancements (#540)
  • Upgraded Compose to beta07 (#549)

Note: Compose support is experimental and mvrx-compose artifact is at version 2.1.0-alpha02

mavericks - 2.2.0

Published by elihart over 3 years ago

  • Fix subscriptionLifecycleOwner to use viewLifecycleOwner in Fragment's onCreateView (#533)
  • Remove createUnsafe and don't auto-subscribe on background threads (#525)
  • Fix lifecycle 2.3.0 throwing IllegalStateException when using MavericksLauncherActivity (#523)
mavericks - 2.1.0

Published by elihart over 3 years ago

  • Initial release of mavericks-compose:2.1.0-alpha01.
  • 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 (use version 2.1.0-alpha01 for the mavericks-compose artifact)
  • Fixed a change in androidx-lifecycle 2.2.0 that would have required any unit tests that use Mavericks to also use robolectric.

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.
mavericks - 2.0.0

Published by elihart over 3 years ago

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 now mavericks.
  • 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 use mavericks.
  • 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 and onCleared() 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:
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)
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()
    }
}
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