moqui-framework icon indicating copy to clipboard operation
moqui-framework copied to clipboard

New Feature: Add before/after ordering to components

Open eigood opened this issue 3 years ago • 1 comments

Sometimes when loading components from a filesystem, the order is inconsistent, and can be random. It would be nice to have a way for extensions to insert themselves before an existing component, or after some other one, but while not actually needed to depend on the other.

There is a pull request for this, sending that shortly.

eigood avatar Sep 04 '20 19:09 eigood

Could you describe the scenario you ran into where depends-on was not adequate and the before & after options helped?

This may be a result of my limited imagination but I'm having a hard time seeing where this is useful, and justifies the additional complexity. By complexity I don't mean the code so much, we can deal with that, but when configuring components the semantics of how depends-on, before, and after work together is messy. There are many possible 'invalid' permutations, like A depends-on B so would be after in the component order but B is set to be after A. With potential loops among multiple components it becomes even more complex, or rather there are even more invalid configuration scenarios (or perhaps valid depending on semantics yet to be defined). In general what should happen with those?

My preference would be to avoid those issues altogether by keeping this more simple, hence the initial question.

jonesde avatar Sep 04 '20 21:09 jonesde