Implement dependency injection using hilt and inject CoroutineDisptacher#12419
Implement dependency injection using hilt and inject CoroutineDisptacher#12419ShridharGoel wants to merge 1 commit into
Conversation
d339a03 to
3e2bbc6
Compare
|
What does this do to build times? |
I think there's no significant difference in build time, though it needs to be checked in detail. |
|
Any idea how we can exclude a directory from compilerArgs, specifically |
|
lint at least offers this: https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/dsl/LintOptions
Not sure if lint can check for deprecation or not, but if lint can detect deprecation then perhaps the compiler flag could go away and we could rely on lint with this flag. Otherwise I'm not sure how this could be done. I did a brief search for a repo for hilt and could not find one ? But it strikes me that they should have a version that does not generate deprecated APIs, or if it does it does similar to us and generates a conditional where they use the old or the new depending on runtime SDK and suppresswarnings |
|
Should be fine after #12431 gets merged. |
|
I'm for dependency injection as this would be a step towards some sort of architecture where everything is not tied to everything. However I'm not sure this PR is the way to start with this. Unless @ShridharGoel has plans for more work on top of this in the real near future, I wouldn't approve this:
Just my 2:moneybag: |
@lukstbit What do you mean by this? Aren't they being used inside the activity? |
|
The plan here is to use dependency injection at more places in the app and not only limiting it to coroutine dispatchers. |
We're already using |
This is only for the initial PR. Further changes would be there in different pull requests. |
|
@mikehardy This was for ACRA. Is this still necessary as we've partially moved away from annotation-based ACRA instantiation EDIT: Our one usage: EDIT: https://github.com/ACRA/acra/wiki/Custom-Extensions#registering-an-extension - looks like this can be manual. We may want to extract this to another issue if it's a good target for reducing compile time |
|
Hmm annotations fir Acra are on the way out - the PR for Acra has the final structure more or less and the work that already went in killed annotations I think. Could be a remove it and see if it works test |
|
Edited the comment above (sorry), still used in one case |
They are just that ideally you'd use this injection in other places as well, most notable being tests for that class(which we don't have).
This is what I'm concerned about, that we are introducing dependencies/plugins which are not going to really be used in the near future seeing that the bulk work is done in scoped storage, some cleanups and moving to the new backend(at least from the changes I see). |
|
Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
No description provided.