question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Convince Dagger to support automatic module discovery in a general way

See original GitHub issue

We’ve now hit the rule of three with public use cases for this feature:

  • @ContributesAndroidInjector
  • @AssistedInject
  • @InflationInject

The first one has massively superior ergonomics because its generated bindings can be auto-discovered and bound into the graph. It gets this by virtue of being built by the Dagger team. Lucky!

The latter two are in this repo and do not receive auto-discovery. Instead, we force the consumers to annotate a module such that we generate a sibling module which contains only unscoped bindings. This lets us talk to Dagger where we otherwise cannot. It has devastating effects on incremental compilation and incremental annotation processing since both need to aggregate all usages in a compilation unit. And finally, it has annoying ergonomics because you have to reference generated code directly and manually include a module.

An additional hypothetic use case as well as the general Dagger feature request is tracked here: https://github.com/google/dagger/issues/869. This also would eliminate the need for Dagger to build everything as a first-party feature (e.g., https://github.com/google/dagger/issues/935) and allow people to mix-in behavior from other libraries.

We should come up with a proposal for the general mechanism on which Dagger’s @ContributesAndroidInjector and our @AssistedInject and @InflationInject can be built.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:27
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
filipkowiczcommented, May 9, 2019

Do you have any update from Dagger side?

1reaction
JakeWhartoncommented, Apr 25, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Convince Dagger to support automatic module discovery in a ...
We should come up with a proposal for the general mechanism on which Dagger's @ContributesAndroidInjector and our @AssistedInject and @InflationInject can be ...
Read more >
Convince Dagger to support automatic module discovery in a ...
Convince Dagger to support automatic module discovery in a general way ... We've now hit the rule of three with public use cases...
Read more >
Using Dagger in Android apps
The Dagger basics page explained how Dagger can help you automate dependency injection in your app. With Dagger, you don't have to write ......
Read more >
"Disarming Discovery" - Quest - Fallout 76 - Bethesda Support
You will be given the opportunity to either attack Dagger and her crew or to convince her to hand over the Brotherhood's property...
Read more >
We're on the engineering team for Android Jetpack ... - Reddit
Android Jetpack is our suite of libraries to help developers follow best practices ... In other words, you would still use Dagger &...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found