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

Fix dependency sort when dependencies have multiple environments #477

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

Conversation

EduardDumitrescu
Copy link

Hello, right now there is an issue regarding the order the dependencies are registered when using multiple environments.

Let's say we have a class UserApi which we annotate with @dev, then we create another class FakeUserApi which implements UserApi, we register that class as UserApi and annotate it with @test. Now we have a class UserRepository in which we inject UserApi. Now UserRepository has no environments annotated to it so in locator.config.dart there might be a case where the registrations would be in this order FakeUserApi then UserRepository then UserApi.

@mariomka
Copy link

It solves our issues with dependency ordering! There are several related issues, #475, #458, and possibly more.

Please merge it!

@EduardDumitrescu
Copy link
Author

@Milad-Akarie Hello, do you believe there is a way I can improve on this possible solution?

@mariomka
Copy link

@Milad-Akarie, can you take a look at this PR?

@westito
Copy link

westito commented Nov 21, 2024

Same issue here! When will be merged and released?

@SAGARSURI
Copy link

Is there any update on this? @Milad-Akarie

@ciprig
Copy link

ciprig commented Nov 29, 2024

I have added a unit test that proves the fix @Milad-Akarie.

@JulienDev
Copy link

Thanks, working perfectly! @Milad-Akarie could you please merge? 🙏

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.

6 participants