Dagger 2.43
Chang-Eric
released this
21 Jul 20:45
·
613 commits
to master
since this release
What’s New In Dagger
Potentially Breaking Changes
- Note: Dagger 2.43/2.43.1 require java 11 due to a change in Dagger's XProcessing dependency.
However, this requirement has been recently reverted in XProcessing
and Dagger 2.43.2 should support java 8 again (see issue #3495).
Bug Fixes
- Fixes #3401 where Dagger generated mismatched parameter names in subcomponent factory method implementations when the original factory method is in a separate build unit from the component that implements it.
What’s New In Hilt
Potentially Breaking Changes
- Hilt now throws if the base activity/fragment class’s
getDefaultViewModelProviderFactory()
returns null. This is unlikely to happen though unless overridden by the user to return null. (9eee8e4) - As part ViewModel bug fixes, dependencies were updated as below.
androidx.navigation
users will need to update to 2.5.0 to interoperate. These libraries require building with SDK 31. To build with SDK 31, AGP users will need to use AGP 7.0+. This will also require using JDK11.androidx.activity
andandroidx.fragment
to 1.5.0androidx.lifecycle
to 2.5.0androidx.savedstate
to 1.2.0
Bug Fixes
- Fix #3464 where SPI plugins were not being invoked with Hilt's Gradle Plugin aggregation (
enableAggregatingTask
) turned on. (b838876) - Fixes #2328 and #3232 where getting multiple instances of
@HiltViewModel
with different keys would cause a crash. - Fixes #2152. hiltNavGraphViewModels is now no longer necessary to use
@HiltViewModel
with navigation backstack entries as the owner. The defaultViewModelProvider.Factory
from activities and fragments can be used directly with the backstack entry as the owner. (74ea765) - Make it so that map keys used with
@BindValueIntoMap
in Kotlin code do not need to use the@field
notation. (e591833)