Add option to disable module discovery#96
Conversation
|
Another possible change would be adding merging the |
|
I'm new to this package, so please let me know if I've misunderstood something. If automatic discovery was disabled, and I registered everything myself in the service providers, would I be able to use this package purely as a dev-dependency? I would like to be able to use all the nice artisan commands during development, but not have the package installed in production. |
|
Yes, this is important. I noticed on the draft v3 branch that it's now caching the autodiscovered files (so this alleviates my primary concern), but on v2 I want to disable autodiscovery so that I can implement discovery with caching for performance improvements |
This pull request refines the automatic discovery logic for various components within the modules. The changes introduce more flexibility by allowing users to specify which components should be automatically discovered and registered.
When decoupling modules to separate packages the autodiscover logic has to be implemented into the package itself so for my use case it's better to have autodiscovery disabled by default and implemented in the package through service prividers and the
extrakey incomposer.json. This way, modules can be converted into packages at any time without any extra changes needed