Is your feature request related to a problem? Please describe.
Forge doesn't support having multiple "entrypoints". Because class loading and "active mod container" detection seems to be handled differently, it's not a great idea to invoke everything from Annotated Di's side during setup. But we can't wait until after setup for access to an Injector either.
If anything is wrong with any mod's setup in the global injector, it's difficult to see which.
Describe the solution you'd like
Rather than a single Injector, use a separate injector for each mod which only pulls its own config and any dependencies' configs. This default is the "auto" injector for that mod. An api method with no parameters can be used to grab this (it will look at active mod container). It is also possible to get another mod's "auto" injector by passing in a modid. Lastly, manually building an injector by passing a list of modids should be allowed.
Loading would look something like:
Build a list of modids and their corresponding DI configs.
On Fabric, call the entrypoints to get custom modules and store those too
On Fabric, call the "Injector Ready" entrypoints for each mod, building the injectors as we iterate and wrap in a try/catch in case something goes wrong. This way we know which mod(s) are broken.
On Forge, other mods call Annotated DI to register their custom modules.
On Forge, other mods call Annotated DI to build their injectors during their own entrypoints.
Is your feature request related to a problem? Please describe.
Describe the solution you'd like Rather than a single Injector, use a separate injector for each mod which only pulls its own config and any dependencies' configs. This default is the "auto" injector for that mod. An api method with no parameters can be used to grab this (it will look at active mod container). It is also possible to get another mod's "auto" injector by passing in a modid. Lastly, manually building an injector by passing a list of modids should be allowed.
Loading would look something like: