Closed Blacksmoke16 closed 5 months ago
ADI.bind
is going to have to stick around, as there isn't really a place to add an annotation or something to for global bindings.
Going to keep this open, are a few more annotations I think we can add. However they're all new functionality, so can release them whenever.
Actually going to close this as the new annotations won't need the breaking
label and can be their own issues if needed.
The DI component currently has some features that are implemented at top level macro calls. Specifically
.bind
and.auto_configure
. These were implemented like that for reasons, mainly not having thought of a better way, and due the increased complexity of the alternatives.However with the introduction of #337, the DI component is a lot more robust and flexible when it comes to adding in features. As such, I propose we start to deprecate the "legacy" macros calls where possible into annotations that can be applied closer to the source.
E.g. something like:
Could become:
There is also room to improve how other DI features work by adding additional annotations. Service aliasing for example. Instead of:
You could do
This is nice not only from a readability perspective, but also from an implementation POV as it decouples the alias logic from the
Register
annotation itself.