Skip to content

Dagger 2.49

Compare
Choose a tag to compare
@bcorso bcorso released this 01 Dec 21:04
· 64 commits to master since this release

Dagger

New features:

  • Fixed #4044: Add support for KSP with dagger.android (8327177).

Potential breaking changes:

  • Dagger’s generated component no longer contains deprecated no-op module setter methods for modules that have only static/abstract @Provides/@Binds methods (ed47d4b).

    Note: If you hit this issue, the fix is to remove the call to the setter method in your code. For example:

    MyComponent component =
        DaggerMyComponent.builder()
    -        .moduleWithOnlyStaticOrAbstractMethods(new ModuleWithOnlyStaticOrAbstractMethods())
            .build();

    These setter methods were already no-ops (i.e. Dagger just ignored them), so removing it should not cause any functional changes.

Bug fixes:

  • Fixed #4046, #4140: Fixes Unexpected element error in when calculating nullability (4593c0a)
  • Fixed #4096: Fix type names for inline types on the KSP side (aosp/2789273)
  • Build-time performance improvements (85e9ff1) and (d9d0a8e).
  • Fixed #4060: Updated KSP to 1.9.20-1.0.14 which should contain the fix for a number of incremental processing issues related to KSP (692015f).

Hilt

New features:

  • Fixed #2287, #3523: Add support for using @AssistedInject with @HiltViewModel. (8327177).
    For more details visit https://dagger.dev/hilt/view-model#assisted-injection.
  • Hilt now provides @ActivityRetainedSavedState SavedStateHandle from ActivityRetainedComponent (1cac33b).
    Note: This feature relies on a somewhat experimental implementation in order to provide this binding lazily while also avoiding leaking the activity. The laziness is a requirement to not restrict activity injection and also to avoid bloating the saved state when unused. While we predict this should be safe to rely on, if issues are discovered with this implementation, it is possible that a future release may have to remove this binding.

Bug fixes: