engems
engems copied to clipboard
engine module / namespace and zeitwerk
@palkan Did your team figure out a way to keep the engine namespaced and NOT have to repeat the engine name as a subdirectory everywhere:
- engines/subsystem1/app/controllers/subsystem1/application_controller.rb
- engines/subsystem1/app/controllers/subsystem1/foos_controller.rb
- engines/subsystem1/app/models/subsystem1/foo.rb
- engines/subsystem1/app/api/subsystem1/foo_service.rb
Short answer — no. But I understand your pain 🙂
I think, to accomplish this with Zeitwerk, we need to:
- Disable the existing autoloading configuration for engines
- Create a custom loader.