github google/dagger dagger-2.36
Dagger 2.36

latest releases: dagger-2.51.1, dagger-2.51, dagger-2.50...
2 years ago

What’s New in Dagger

New breaking changes

  • Added compile time set binding validation for cases where the same binding key is bound into a set multiple times. Previously, cases of this could result in a runtime failure due to a similar check at runtime, but in rare cases that don’t trigger the runtime error, this could be a breaking change. (cf20470)

Bug Fixes

  • Make nested subcomponents and switching provider impls static within the generated component class. This is in preparation for eventually unnesting these classes from within their parent component to avoid issues that arise from deeply nested class names being too long. (d9f08aa)

What’s New in Hilt

Fragment#getContext() behavior fixed behind a flag

Currently, a Hilt fragment’s getContext() method incorrectly continues to return a context value even after the fragment is removed. This differs from the behavior of a regular fragment. Fixing this is a breaking change that may introduce crashes at runtime if code incorrectly accessed the fragment’s context after removal and relied on Hilt’s incorrect behavior, so a flag has been introduced with the new fixed behavior default off.

Please enable the flag with -Adagger.hilt.android.useFragmentGetContextFix=true to roll out this change at your own discretion. You may choose to, for example, start by enabling this only in development or some small testing population to find errors. In a future release, this flag will be defaulted to true and then in some release after that, the flag will be removed. (5ce0cea)

Bug Fixes

  • Fix a bug where a Hilt fragment’s getContext() method could not be called before super.onAttach(). (8acc433)
  • Fix compatibility issue with the Hilt Gradle Plugin and Android Gradle Plugin 7.0 (371a2c3)
  • Fix lint issue with Hilt testing classes that get compiled to reference invalid ReflectiveOperationException for API < 19. (e58abc3)

Don't miss a new dagger release

NewReleases is sending notifications on new releases.