Skip to content

Releases: google/dagger

Dagger 2.20

20 Dec 22:02
Compare
Choose a tag to compare
  • Peformance improvements in annotation processing (8012ab5)
  • Report duplicate bindings only once, not once per request. (623461f)
  • Make sure all processing steps defer elements properly if they have missing types. (3b0fcc8)
  • Make @ProductionComponent have runtime retention so tools can interpret it like all of the other component annotations (fff65e3)
  • 325b516:
    • Add module-level validation. When -Adagger.moduleBindingValidation=ERROR or =WARNING is set, then each module is processed as a kind of component (without generating any code) in order to validate the bindings installed by it and all included modules. Any binding graph errors, such as duplicate bindngs (but not including missing bindings), will be reported as errors or warnings depending on the option.
  • Report map multibinding contribution errors once regardless of whether the map is requested as Map<K, V>, Map<K, Provider<V>>, or Map<K, Producer<V>>. (350368e)
  • c7e7c4f:
    • Fixes two bugs related to @ProductionScope bindings:
      • Where modules with @ProductionScope bindings are installed in multiple components in the same component ancestry, the binding is now resolved only once and only in the rootmost component.
      • When @Inject bindings with @ProductionScope are referenced in a binding graph, the binding is now resolved in the rootmost @ProductionScope component.
  • 221f000:
    • dagger.android code can no longer use the AndroidInjector.Factory<? extends Activity> format to bind injector factories. See https://google.github.io/dagger/android and the 2.19 release notes for information on how to migrate.
    • Adds an ErrorProne refactoring for migrating from AndroidSupportInjectionModule (which now is functionless) to AndroidInjectionModule. See these docs for how to apply the refactoring to your codebase if you're on dagger-compiler-2.20.
  • Removed dagger.releaseablereferences (a72c342)
  • Removed the -Adagger.floatingBindsMethods flag added in 2.17 (https://github.com/google/dagger/wiki/Dagger-2.17-@Binds-bugs) (bc8dd5b)

Dagger 2.19

29 Oct 18:16
Compare
Choose a tag to compare
  • dagger.android has a new format for binding AndroidInjector.Factorys:
    • Instead of returning AndroidInjector.Factory<? extends Activity> (or Service, Fragment, etc), return just AndroidInjector.Factory>
    • Instead of using @ActivityKey (or @ServiceKey, @FragmentKey, etc), use @ClassKey. The dagger.android map keys (with the exception of @AndroidInjectionKey are now deprecated
    • If you use @ContributesAndroidInjector, there's nothing to do. We have updated the output to match the new format
    • We have provided an ErrorProne refactoring for migrating to the new format of binding AndroidInjector.Factorys with dagger.android. See these docs for how to apply the refactoring to your codebase if you're on dagger-compiler-2.19. (02dc4a7)
    • In the next release (2.20), we will remove the old format. This will allow us to support AndroidX packages better.
    • For the complete docs, visit https://google.github.io/dagger/android
  • Avoid some thrown errors during Dagger compilation for invalid modules. (4df5adf)
  • Some formatting fixes even when the formatter is turned off

Dagger 2.18

19 Oct 14:23
Compare
Choose a tag to compare
  • Producers:
    • Added @CancellationPolicy annotation, which can be used to make a production component or subcomponent allow cancellation of its subcomponent(s) to propagate up to it and cancel its nodes as well. (f5c04a5)
    • Producer cancellation is now deterministic; cancelling an entry point of a production component will now ensure that it cancels all running tasks for that component and prevents any further tasks for that component from starting. For components with more than one entry point, this does mean that cancelling one entry point will cancel all entry points for the component. For production subcomponents, cancellation of a subcomponent entry point will not propagate cancellation to tasks owned by an ancestor component. (ea48dfd)
  • Better Errors:
    • Change constructor bindings and dependency requests from void package.Class.<init>(params) to package.Class(params), which looks more like how Java users think of constructors. (d31943c)
    • Report errors on members injection component methods and MembersInjector requests that have qualifiers. (3be3073)
    • Report erroneous bindings once for all their incoming dependency requests, instead of once for each incoming dependency request. If a binding is owned in more than one component, it will still be reported once for each component that owns it. (beefa94)
    • Report errors when members-injecting primitives and arrays in component methods as well as unused bindings. (d6a0db3)
    • Report binding graph errors once at the root component, not once per entry point from which the error is reachable. Include the dependency trace from one entry point only, and list the other entry points from which the error is reachable. (46f315f)
    • Report errors for dependency requests with multiple qualifiers in @Provides and @Produces methods and component entry points instead of throwing IllegalArgumentException. (da2e1f0)
  • dagger.android:
    • Adds a support version of DaggerDialogFragment (47be5db)
  • Build perf:
    • Add an option to disable formatting of generated code: -Adagger.formatGeneratedSource=disabled (6814a21)
    • Add support for gradle's incremental annotation processing. This can be enabled by passing -Adagger.gradle.incremental to javac (cd83b30)
    • Originating elements are now reported to the Filer (baf2357)
    • Improvements in processing time (b0786a5)
  • Bug fixes:
    • Fixes bug in fast init (b/116268009). (be9493d)
    • Report an error (instead of throwing IAE) if a component builder method has a primitive parameter and is not annotated with @BindsInstance. (5c69aab)
    • Avoid IncompatibleClassChangeError in DiagnosticReporterImpl when guava-android is on the processor path. (efb042d)

Dagger 2.17

07 Aug 17:12
Compare
Choose a tag to compare
  • 7eab363:
    • Fixed a bug where parent components sometimes had bindings for child subcomponents if a parent module had a @Binds @ChildScope method.
    • Fixed a bug where a @Binds method in a parent but used only from a child, whose dependency is missing in the parent but present in the child, used to result in a valid graph. Now an error is correctly added.
    • If you start seeing missing binding errors in this release, check out this wiki page for information on how to debug the issues.
  • Fix bug when reporting cycles if some components have no entry points that depend on the cycle. (c55bec3)
  • 3a08964:
    • If you use dagger.android and you aren't already installing AndroidInjectionModule (or AndroidSupportInjectionModule), you should do so, otherwise you are likely to get a missing binding error from Dagger when you upgrade.
    • Adds an option to use string keys for dagger.android and allow the keys to be obfuscated.
      • Note that if you use a bytecode shrinker/optimizer, this is only viable if you use a version of R8 that can read generated proguard rules (or if you extract the contents of the generated rule and include it in your build)
      • You can enable this mode with the flag -Adagger.android.experimentalUseStringKeys.
  • If two entry point methods with different keys are inherited from different supertypes of a component type, Dagger will now report an error. (51d049f)
  • Renamed experimentalAndroidMode to fastInit. See https://google.github.io/dagger/compiler-options (d55c02d)
  • Deprecated dagger.android.DaggerFragment in favor of dagger.android.support.DaggerFragment to match Android P's deprecation of framework fragments. (a1bd0ea)
  • Scope annotations have no meaning on @BindsOptionalOf methods. Dagger now reports an error for them. Instead of applying a scope to the @BindsOptionalOf method, apply it to the non-optional binding that satisfies the optional binding. (8852d0b)
  • Report an error for binding methods that have more than one scope annotation, instead of throwing an exception. (192d359)
  • Fixes a bug where scope annotations in error messages were missing annotation attributes (fc09c71)

Dagger 2.16

08 May 19:49
Compare
Choose a tag to compare
  • Deprecate dagger.releasablereferences (928b157)
  • @Module cycles will no longer crash the processor. (cd70691)
  • Change SPI diagnostic reporting to calling methods on a DiagnosticReporter instead of returning ValidationItems. (1f4f6bc)
  • Construct inlined multibindings more efficiently if a newer version of Guava is available (84ec3c6)
  • Fix a bug where @Binds methods with inaccessible map keys crashed the processor. (ebf0742)
  • Fixes dagger-android-processor to handle androidx types

Dagger 2.15

07 Mar 22:00
Compare
Choose a tag to compare
  • 98b9c3f:
    • Fix a bug where binding collisions were not properly checked across subcomponent boundaries when a parent provided a concrete Set/Map and a child provided a multibinding contribution with the same key.
    • Also applies to providing a concrete optional binding and @BindsOptionalOf declarations.
  • Fix a case where injecting a Provider<GeneratedType> might not have properly delayed processing until that type was generated (57a43df)
  • Add Android proguard specs (b34edaf)
  • Adds a dagger.spi package (in the com.google.dagger:dagger-spi artifact) so users can hook into the Dagger binding graph at build time to report custom validation or generate extra files at build time. Note that this is still experimental and the APIs may change. (120a339)
  • Scopes are no longer allowed on @Module elements. They never had a function and are now disallowed. (beeb29d)
  • Clarified DaggerBroadcastReceiver documentation with respect to when injection is performed (a49cee0)
  • Fix some cases of the Kythe plugin (412c879)
  • Fixed a bug with @Provides/@Produces methods in generic modules. (716dbcf)
  • FluentFuture is now a supported return type of @ProductionComponent and @Produces methods. (c98f88f)
  • Always parameterize Optional.<Foo>absent/empty() to fix a javac7 issue (83459f2)

Dagger 2.14.1

19 Dec 23:28
Compare
Choose a tag to compare
  • Fix a NoClassDefFound issue with 2.14 (4a202b7)

Dagger 2.14

19 Dec 17:39
Compare
Choose a tag to compare
  • Fix JPMS issue with javax.annotation types (b04e769)
  • Remove dependency on JSR 305 annotations (02de197)
  • Fixed a compilation issue with Eclipse (4e74fce)
  • Adds a new error for component methods with type variables (71d0ad1)
  • Improved compilation times (8ddc04e)

An issue (#994) was discovered with this release - please use dagger-2.14.1 instead.

Dagger 2.13

07 Nov 18:33
Compare
Choose a tag to compare
  • Reductions in code size - code for repeated bindings is now placed in private methods instead of duplicating it throughout the component
  • dagger.android speed improvements:
    • Avoid calling Class.getCanonicalName(), which is slow on Android, during normal execution (c19f0c2)
  • dagger.grpc - update to gRPC 1.8 (19cc9f4)

Dagger 2.12

10 Oct 19:53
Compare
Choose a tag to compare
  • The following kind of bindings are now inlined in the generated components and do not need a Provider wrapper object (unless they are scoped or otherwise requested as a Provider).
    • Multibound Sets and Maps
      • If you have Guava on your classpath, these will be implemented using ImmutableSet/ImmutableMap too
    • Optional bindings
    • @Binds bindings
    • @BindsInstance bindings
    • Component dependencies
    • Subcomponent Builders
    • All members injection methods on a component
  • Unused Provider objects are now removed from components, which should speed up initialization times!
  • In Dagger Producers, a provision binding that is used in a producers context will no longer be cached.
  • Better support for running the dagger compiler with javac9