Releases: lwj1994/android_view_model
Releases · lwj1994/android_view_model
Release list
v0.4.0
Added
- Add an English, skill-local Instagram architecture example showing a
multi-root Compose app composed from API, repository, user, feed,
post-detail, comment, and startup-coordinator ViewModels. - Add nestable, idempotently restorable
overrideWithand coroutine-isolated
runWithOverrideAPIs to zero- through four-argument ViewModel specs. - Add the strongly typed Compose
selectViewModelStateAPI with an optional
selector-local equality rule.
Changed
- Make
ViewModel.reset()the complete runtime reset: it force-disposes every
cached generation, includingaliveForever, before clearing configuration
and lifecycle observers. - Align full-state and selector equality with Flutter: full state uses local,
global, then reference identity; selected values use local, global, then
Kotlin==. - Freeze each state transition before synchronous listener dispatch so a
reentrantsetStatecannot corrupt later listeners' previous/current pair. - Make Compose
watchViewModelandreadViewModelre-resolve after their
handle is recycled instead of retaining the disposed generation. - Make
maybe*Cachedreturnnullonly forViewModelError; unrelated
exceptions now propagate to the caller.
Fixed
- Skip listeners removed before their turn during the current notification.
- Contain failures thrown by the configured error handler so later listeners
and disposal callbacks still run. - Preserve explicit
nullkey/tag andfalseretention values from an active
legacy or scoped spec proxy instead of falling back to the base spec. - Guard the complete reset sequence against teardown-triggered nested resets so
remaining generations still use the outer error and lifecycle pipeline. - Throw
ViewModelErrorconsistently when resolving through a disposed
binding. - Keep read-style Compose resolution and typed selectors subscribed only to
generation changes, avoiding recomposition from unrelated watched
ViewModels on the same binding.
Tests
- Add serial contract coverage for reset, maybe lookup errors, listener
mutation, reentrant state, equality fallback, secondary error handling, and
scoped spec overrides, plus Compose recycle and typed-selector behavior.
v0.3.0
Removed
- Remove the public
ViewModelBinding.recreateAPI together with Manager,
Store, andInstanceHandlein-place replacement logic, plus all
InstanceAction/currentActionbookkeeping. - Remove the Compose
ViewModelBuilderconvenience function. Use
watchViewModel(spec)for reactive spec-based resolution.
Changed
- AutoDispose now observes handle disposal only. Owner paths, ViewModel
listeners, binding-owned subscriptions, and dependency edges are no longer
migrated between object generations. - Obtain a distinct instance with a new explicit key, or globally
recyclethe
old generation and let a resolver property callwatch/read(spec)again.
AndroidViewModel 0.2.2
Documentation
- Make stable specs plus
watch/readthe unambiguous default in the README,
bundled skill, project guidance, examples, and public API documentation. - Separate cached lookup into an advanced-only section and document its cache
miss, creation-order, identity, and cross-owner lifecycle coupling. - Replace stored ViewModel references in the sample with resolver properties
and remove unnecessaryaliveForeverretention.
v0.2.1
Fixed
- Require an explicit key for every
aliveForeverspec, including root
bindings as well as ViewModel-to-ViewModel dependencies. Invalid
configurations now throwViewModelErrorbefore the builder runs, while the
Store enforces the same rule for internal factories.
Tests
- Add root, nested, computed-key, and Store-boundary validation coverage while
retaining single-fork, sequential unit-test execution.
v0.2.0
Highlights
- Add a stable dependency binding owned by each parent ViewModel generation.
- Preserve unkeyed child identity while shared-parent root owners join or leave.
- Track direct and parent ownership paths independently with source-aware references.
- Deduplicate synchronous watch propagation across diamond dependency graphs.
- Make
recycleglobal and preserve owners plus binding subscriptions duringrecreate. - Add construction rollback, cycle detection, reset-safe recreation, aligned docs, and serial test enforcement.
Migration notes
- Repeated unkeyed specs of the same resolved ViewModel type now reuse one instance within a binding. Add distinct keys when multiple same-type instances are intentional.
- Nested
aliveForeverdependencies now require an explicit key. - Resolve ViewModels through properties rather than
by lazyor stored references so recycle/recreate can return the active generation.
Validation
:android-view-model:testDebugUnitTest:android-view-model:assembleRelease:android-view-model:lintRelease:android-view-model:publishToMavenLocal
v0.1.1
JitPack release for AndroidViewModel.
Gradle dependency:
implementation("com.github.lwj1994:android_view_model:v0.1.1")Build log: https://jitpack.io/com/github/lwj1994/android_view_model/v0.1.1/build.log
v0.1.0
Initial release of AndroidViewModel.\n\n- Package namespace is milu.viewmodel.\n- Example now consumes the library through Gradle Git source dependencies instead of project(":android-view-model").\n- README documents Maven-free Git source dependency usage.\n- Includes ViewModel, StateViewModel, ViewModelSpec, and ViewModelBinding support for Compose, Activity, Fragment, View, and plain classes.