Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

Fill in README.md#12

Open
TWiStErRob wants to merge 4 commits intoJakeWharton:masterfrom
TWiStErRob:usage
Open

Fill in README.md#12
TWiStErRob wants to merge 4 commits intoJakeWharton:masterfrom
TWiStErRob:usage

Conversation

@TWiStErRob
Copy link
Copy Markdown
Contributor

@TWiStErRob TWiStErRob commented Feb 4, 2019

Copied from butterknife-reflect as a baseline.
Added both usages, Kotlin to be done after it's implemented.
dagger-android to be discovered

preview available at https://github.com/TWiStErRob/dagger-reflect/tree/usage

@PaulWoitaschek
Copy link
Copy Markdown
Contributor

Could you also document what the limitations currently are, meaning what of dagger is not supported yet?

@TWiStErRob
Copy link
Copy Markdown
Contributor Author

If only I knew, I guess https://github.com/JakeWharton/dagger-reflect/search?q=notImplemented&unscoped_q=notImplemented is a good starting point (sadly it doesn't show all occurrences, only 1 for each file). I wouldn't put it in the README as a list though, just a link like above.

@JakeWharton any thoughts on having a GH milestone with issues for each missing feature?

@TWiStErRob
Copy link
Copy Markdown
Contributor Author

@PaulWoitaschek added limitations.

@TWiStErRob
Copy link
Copy Markdown
Contributor Author

@JakeWharton is there any reason to not merge this? Do I need to do something here?

@JakeWharton
Copy link
Copy Markdown
Owner

JakeWharton commented Feb 14, 2019 via email

@PaulWoitaschek
Copy link
Copy Markdown
Contributor

Then merge it and add a disclaimer: "Do not use this".

It's helpful for people taking a look at it and who are experimenting.

@JakeWharton
Copy link
Copy Markdown
Owner

I just said that I don't want you to and I have no interest in helping you do so at this time.

Er, what? Why would I want this?
--------------------------------

Feels like going back to Dagger 1 by Square? Not quite: we keep the benefits of Dagger 2, including the annotation processing compile-time validation in production, but using reflection speeds up development builds.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dagger 1 used code generation and compile-time validation. The only feature it didn't have compared Dagger 2 was... maps?

This project is more like Guice.


* ProGuard/DexGuard/R8: since the dependency injection entry point (e.g. `@Component.Builder`) is being reflected with either usage case, you'll lose some shrinkability, but the majority of the generated `@Component` code using `@Module`s will be shrinked the same as before.

* `dagger-android`: it uses a lot of Dagger features, namingly:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of these are implementation details. I don't think it's our responsibility or useful to document all this.

-keepclassmembers class ** implements @dagger.Component ** {
public static <2> create();
}
```
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These rules can be embedded in the jar to be picked up automatically and we can add test cases to ensure they work. They don't need to be documented anywhere.

This is due to a limitation in Java, where instances of proxies cannot create another proxy instance where the second interface is not public. This prevents proxies of builders from creating proxies of the component. See `dagger.reflect.ComponentBuilderInvocationHandler.create`.

* There are some missing features that are not yet implemented.
They can be found by looking at [`notImplemented` calls in the code][notImplemented].
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There won't be any releases until these are all gone

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants