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

Multi-Scope Wiring #800

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

Multi-Scope Wiring #800

wants to merge 12 commits into from

Conversation

SentryMan
Copy link
Collaborator

@SentryMan SentryMan commented Apr 11, 2025

@cbarlin would this suffice?

With this, you would have to add the requires property in your @InjectModule annotations to control the order.

  • now will order manually provided AvajeModules
  • will generate an allRequiredModules static method if the module has no external project scope dependencies and no transitive constructor params

Resolves #793

@SentryMan SentryMan added the enhancement New feature or request label Apr 11, 2025
@SentryMan SentryMan enabled auto-merge April 11, 2025 04:11
@cbarlin
Copy link

cbarlin commented Apr 11, 2025

Looks great! Checking it out locally I can make it work with strictWiring = true on them as well (and make it work with a mix of some with and some without), if we wanted to add those to the test cases.

But yeah that solves the ordering problem nicely :)

@SentryMan SentryMan requested a review from rbygrave April 11, 2025 05:07
@SentryMan SentryMan self-assigned this Apr 11, 2025
@SentryMan SentryMan added this to the 11.5 milestone Apr 11, 2025
@cbarlin
Copy link

cbarlin commented Apr 11, 2025

Thanks heaps @SentryMan! Did you want me to leave those other two PRs up?


class BeanCrossTest {

@Test
void bootstrap() {
private static Stream<Arguments> allModulesDefined() {
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO these tests are not what we ergonomically desire/need.

That is, we want to say "Give me all the modules that I need for CrossCutModule [and ideally give them in the correct order]" ... and use those to create a BeanScope.

These tests are more just ... we can order the given list of modules correctly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These tests are more just ... we can order the given list of modules correctly.

do we have an existing test for that?

@SentryMan SentryMan requested a review from rbygrave April 11, 2025 14:12
@SentryMan
Copy link
Collaborator Author

Now you need only the requires property

@SentryMan SentryMan changed the title Order manually provided modules Multi-Scope Wiring Apr 12, 2025
@SentryMan SentryMan disabled auto-merge April 12, 2025 03:10
@SentryMan SentryMan enabled auto-merge (squash) April 12, 2025 03:10
@cbarlin
Copy link

cbarlin commented Apr 12, 2025

Looks awesome - thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cross-/multi-scope bean wiring
3 participants