Skip to content

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
@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.

1 participant