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

Make manually wiring up services easier #377

Merged
merged 1 commit into from Mar 30, 2024

Conversation

Blacksmoke16
Copy link
Member

This PR makes it easier to work with manually registering services by reducing amount of boilerplate needed to do so.

  • Ensure class_ann is present before auto configuring tags and/or resolving generics
    • TODO: I think we should refactor things to decouple the annotations from the service definitions. This way register_services ONLY uses them to populate the definitions and things can still be manually wired up. I.e. it makes the annotations specific to the auto registration pass, and not a requirement for the whole process
  • Create new NormalizeDefinitions pass that ensures required keys are present and with proper defaults if not specified
    • Makes it so you do not have to provide every property when manually registering service
  • Breaks out the alias and parameter processes from register_services pass into their own passes
    • Makes it so aliases can be handled via manual registration via including the array of aliases within the definition and not just on the annotation
    • Allows manually wired up parameters to have their extra information populated (type, idx, etc) while still retaining the previous value
  • Refactor factory resolution to include non "new" class methods
    • Allows new parameter pass to be dumber

@Blacksmoke16 Blacksmoke16 added component:dependency-injection kind:enhancement New functionality to an existing feature labels Mar 30, 2024
@Blacksmoke16 Blacksmoke16 merged commit caaee25 into master Mar 30, 2024
10 checks passed
@Blacksmoke16 Blacksmoke16 deleted the manual-service-improvements branch March 30, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:dependency-injection kind:enhancement New functionality to an existing feature
Development

Successfully merging this pull request may close these issues.

None yet

1 participant