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

Allow AppScope -> ActivityScope -> FragmentScope dagger scope nesting #1604

Merged
merged 1 commit into from
Dec 13, 2021

Conversation

aitorvs
Copy link
Collaborator

@aitorvs aitorvs commented Dec 3, 2021

Task/Issue URL: https://app.asana.com/0/414730916066338/1201432423603230/f

Description

In PR #1597 we're harmonising the way we name dagger components and how we contribute dependencies to them. As a recap:

  • Use @SingletonIn(AppScope::class) for app scope
  • Use @SingletonIn(ActivityScope::class) for activity scope
  • Use @SingletonIn(FragmentScope::class) for fragment scope

This a follow up PR to enable nesting those scopes:

  • AppScope -> ActivityScope -> FragmentScope

Nesting means:

  • child scopes can get access to dependencies in their parent scopes (but not the other way around), ie.
  • FragmentScope would get access to deps in Fragment, Activity and App scopes
  • ActivityScope would get access to deps in Activity and App scopes
  • AppScope would get access to deps in App scope

The PR changes the fragments that were not in the FragmentScope to use that one instead. Functionality should not be affected at all

Steps to test this PR

Smoke tests for app and AppTP

@aitorvs
Copy link
Collaborator Author

aitorvs commented Dec 3, 2021

Current dependencies on/for this PR:

This comment was auto-generated by Graphite and will continue to be automatically updated while this PR remains open.

@aitorvs aitorvs force-pushed the feature/aitor/singlein branch from 2120ac1 to 541e259 Compare December 3, 2021 16:27
@aitorvs aitorvs force-pushed the feature/aitor/dagger_nesting branch 4 times, most recently from bfe4c5f to eede887 Compare December 4, 2021 21:10
@aitorvs aitorvs force-pushed the feature/aitor/singlein branch from d1288ae to 2418f88 Compare December 6, 2021 11:26
@aitorvs aitorvs force-pushed the feature/aitor/dagger_nesting branch from eede887 to da1639e Compare December 6, 2021 11:26
@aitorvs aitorvs force-pushed the feature/aitor/singlein branch from 2418f88 to 4fac7d1 Compare December 7, 2021 09:53
@aitorvs aitorvs force-pushed the feature/aitor/dagger_nesting branch from da1639e to d29dfb4 Compare December 7, 2021 09:53
@aitorvs aitorvs force-pushed the feature/aitor/singlein branch from 4fac7d1 to 85bea57 Compare December 7, 2021 18:32
@aitorvs aitorvs force-pushed the feature/aitor/dagger_nesting branch from d29dfb4 to ca9cec2 Compare December 7, 2021 18:32
@aitorvs aitorvs force-pushed the feature/aitor/singlein branch from 85bea57 to de9c77e Compare December 8, 2021 18:52
@aitorvs aitorvs force-pushed the feature/aitor/dagger_nesting branch from ca9cec2 to 76fd750 Compare December 8, 2021 18:52
@aitorvs aitorvs force-pushed the feature/aitor/singlein branch from de9c77e to bb87d74 Compare December 9, 2021 10:51
@aitorvs aitorvs force-pushed the feature/aitor/dagger_nesting branch from 76fd750 to b484a1f Compare December 9, 2021 10:52
@aitorvs aitorvs force-pushed the feature/aitor/singlein branch from bb87d74 to 2a4520a Compare December 10, 2021 08:19
@aitorvs aitorvs force-pushed the feature/aitor/dagger_nesting branch from b484a1f to df8be0f Compare December 10, 2021 08:19
@aitorvs aitorvs assigned marcosholgado and unassigned CDRussell Dec 10, 2021
Base automatically changed from feature/aitor/singlein to develop December 10, 2021 08:53
@aitorvs aitorvs force-pushed the feature/aitor/dagger_nesting branch from df8be0f to 0ff881c Compare December 10, 2021 10:06
Copy link
Contributor

@marcosholgado marcosholgado left a comment

Choose a reason for hiding this comment

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

Works as expected, nice job! 🚢 🇮🇹

@aitorvs aitorvs force-pushed the feature/aitor/dagger_nesting branch from 0ff881c to 91c6ea4 Compare December 13, 2021 08:44
@aitorvs aitorvs force-pushed the feature/aitor/dagger_nesting branch from 91c6ea4 to b177b55 Compare December 13, 2021 10:00
@aitorvs aitorvs merged commit f377e40 into develop Dec 13, 2021
@aitorvs aitorvs deleted the feature/aitor/dagger_nesting branch December 13, 2021 10:40
CDRussell pushed a commit that referenced this pull request Dec 15, 2021
…#1604)

Task/Issue URL: https://app.asana.com/0/414730916066338/1201432423603230/f

### Description
In PR #1597 we're harmonising the way we name dagger components and how we contribute dependencies to them. As a recap:
* Use @SingletonIn(AppScope::class) for app scope
* Use @SingletonIn(ActivityScope::class) for activity scope
* Use @SingletonIn(FragmentScope::class) for fragment scope


This a follow up PR to enable nesting those scopes:
* AppScope -> ActivityScope -> FragmentScope

Nesting means:
* child scopes can get access to dependencies in their parent scopes (but not the other way around), ie.
* `FragmentScope` would get access to deps in Fragment, Activity and App scopes
* `ActivityScope` would get access to deps in Activity and App scopes
* `AppScope` would get access to deps in App scope


The PR changes the fragments that were not in the `FragmentScope` to use that one instead. Functionality should not be affected at all

### Steps to test this PR
Smoke tests for app and AppTP
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.

3 participants