square / Cleanse

Lightweight Swift Dependency Injection Framework
Other
1.78k stars 90 forks source link

[cleansec] Remove support for configuration bindings. #170

Closed sebastianv1 closed 3 years ago

sebastianv1 commented 3 years ago

This removes support from cleansec to parse bindings that are created via the configured(with:) API. This configuration API will soon be deprecated in the core Cleanse library and will explain in greater detail the reasonings behind the deprecation (tl;dr- ergonomics are a pain and doesn't provide enough value). Deprecating this API means that we can remove a whole lot of complexity from cleansec.

By removing the configuration API, we are able to effectively delete the ReferenceProvider types and only parse a DanglingProvider type for the Component's root binding. We can also remove the linking logic to find a reference provider's dangling provider that should ultimately form a normal StandardProvider. The remainder of the changes seen are dealing with removing some tests covering the Dangling/Reference provider relationships (removing tests here is a good thing!) in addition to some minor refactoring I did along the way to make the code cleaner.