Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fill in README.md #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fill in README.md #12

wants to merge 4 commits into from

Conversation

TWiStErRob
Copy link
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
Contributor

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

@TWiStErRob
Copy link
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?

README.md Outdated Show resolved Hide resolved
@TWiStErRob
Copy link
Contributor Author

@PaulWoitaschek added limitations.

@TWiStErRob
Copy link
Contributor Author

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

@JakeWharton
Copy link
Owner

JakeWharton commented Feb 14, 2019 via email

@PaulWoitaschek
Copy link
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
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
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
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
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
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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants