degica / rails_drivers

Modularize your monolith without friction
MIT License
44 stars 5 forks source link

Nested Drivers #30

Open eanders opened 4 years ago

eanders commented 4 years ago

We've begun using drivers in our application and are loving the modularity of it. As our use grows we've begun wondering how hard it would be to allow for drivers to be nested one layer deeper without needing to combine multiple drivers into one. For example, we have multiple "populations" which make sense to keep together, but are each individually their own driver.

Is this something that would be difficult to implement within the existing architecture? So that you could have:

drivers/populations/veterans
drivers/populations/adults
...
drivers/other_random_driver

Maybe a check to see if there's an app folder within the top level?

Resonious commented 4 years ago

Hey, thanks for the suggestion! I think it's a good idea, and we might also get some value out of a system like that in the near future.

Right now, we use a lot of simple globs that look like "drivers/*" or "drivers/*/config/..." etc. for setting up things like RSpec and Webpack. I'm thinking we'll want a library function like RailsDrivers.each { |name, path| ... } (and an equivalent in JS) to use instead. That's the only hairy part, implementation-wise as far as I know right now.

I'll update this issue if we come up with something!