Closed kouks closed 5 years ago
The concern is that developers would not be sure how to use/register the logic from @exteranto/utils
, right?
On the contrary, I think this package serves as a great example of using these annotations. Let's write an in-depth description doc for each utils
export that is bound to the container implicitly. Even better would be indicating this annotation in docs with a link to the core/container
, hence we have this description in one place. This way, when a developer is searching for any of those packages, they actually learn about core functionality they might not know about.
I don't mind either though, exporting a Provider
or linking class to our docs.
Would adding another optional Provider
getter (like only: Script[]
) named depends/assumes: typeof Provider[]
overkill? I think Provider
would be preferable to Dependency
(not even sure if we export this).
I think this is now quite well solved with introducing stricter container that throws an exception when a dependency is not found.
At the moment, all functionality from
@exteranto/utils
is bound to the container automatically via@Binding
and@Singleton
.Although these are not bound to the container before including them via
import { ... } from '...'
, should it be explicit to the user? Should we instead export optionally registered providers?Another issue is when a user registers
CacheProvider
and leavesStorageProvider
out. Cache has its dependencies on storage as it uses its APIs but as it is not being registered, an error would be thrown.