solidusio / solidus_auth_devise

🔑 Devise authentication for your Solidus store.
http://solidus.io
BSD 3-Clause "New" or "Revised" License
53 stars 128 forks source link

Add support for Zeitwerk #180

Closed kennyadsl closed 4 years ago

kennyadsl commented 4 years ago

Decorator files are now correctly added to the autoloader and are also loaded on engine boot. This extension is quite unique since it conditionally loads frontend and backend so we can't use the Engine helpers recently added in solidus_support.

This PR is also removing useless assets compilation and refactoring the Engine a little bit.

aldesantis commented 4 years ago

@kennyadsl how about moving decorators into their own directory (like we do in app) and having a structure like the following instead?

So, basically, the pattern is: lib/[file type]/[solidus engine].

This creates a very clean visual separation for developers and also makes sure we don't add decorator files to paths['app/controllers'].

If you think this structure works, I would suggest adding this to solidus_support instead. A lot of extensions could benefit from this pattern.

kennyadsl commented 4 years ago

We'd still need to differentiate the type of decorator in an inner folder, so it would be:

So it's a bit more complex, but maybe the best path.

aldesantis commented 4 years ago

I think that works, even if it's not exactly beautiful, and it's basically the same structure we have in app/decorators so it's also consistent.