Automated Dependency Injection in IDX
<<Current State>>
Currently, dependency injection in IDX requires developers to explicitly import dependent files. This can lead to a significant amount of boilerplate code, especially in projects with numerous dependencies. Additionally, this manual approach can make it difficult to track and manage dependencies, especially as projects grow in size and complexity.
<< Solution >>
Automating dependency injection in IDX can involve creating a mechanism that automatically identifies and resolves dependencies based on code annotations or configuration files. This would eliminate the need for developers to explicitly import dependent files by reducing boilerplate code and improving code maintainability.
<< Benefits of Automation>>
- Reduced boilerplate code: Developers can focus on core functionalities instead of manually importing dependencies.
- Improved code maintainability for Dependencies.
- Reduced development time for Developers. Unwanted Errors can be ignored.
- Automated dependency injection can make it easier to swap out dependencies without modifying the consuming code.
<< Potential Approaches >>
- Code annotations: Developers can annotate their code with information about their dependencies. This information can then be used by a tool to automatically resolve the dependencies.
- Configuration files: Developers can specify their dependencies in a configuration file. This file can then be read by a tool to automatically resolve the dependencies.
eg: Like in VSC import / ES extensions file import suggestions.
Just thought this idea guys. We are working on Nest/Angular code bases where the dependency injection is getting more complex as the repository grows.
Hence I came up with this idea.
Please correct me if I am missing something. What are your comments guys?