This is a minor thing, but would it be possible to make required plugins inherit the requiring plugin's opt flag (i.e., if the original plugin is marked opt = true, all required plugins should be in opt as well without having to specify it)?
That's a great point, yeah.
One nuance of this (mostly as a note to myself) is that implementing this means that all requires of an opt plugin that is opt because of a lazy-load keyword (i.e. as opposed to being manually marked opt) need to be automatically loaded after the parent plugin in the lazy-loader.
I added the transitive_opt option to implement this. It seems to work in my testing; @clason please let me know if you see bugs or if this isn't what you had in mind.
Looks good and seems to work well! One question: should it also apply to after? (I have to admit I'm not exactly sure about the full differences between requires and after...)
No, but perhaps I can clarify this in the docs:
after only controls sequencing: you can use it to set up a chain of lazy-loads, e.g. by defining a trigger for one plugin and specifying that a set of other plugins are after the original.
requires is meant to specify dependencies which should also be installed; it's largely syntactic sugar to make it easier to organize plugins. All it does is add more plugins to the managed set. Incidentally, it uses after under the hood to apply the transitive_opt setting.
Most helpful comment
No, but perhaps I can clarify this in the docs:
afteronly controls sequencing: you can use it to set up a chain of lazy-loads, e.g. by defining a trigger for one plugin and specifying that a set of other plugins areafterthe original.requiresis meant to specify dependencies which should also be installed; it's largely syntactic sugar to make it easier to organize plugins. All it does is add more plugins to the managed set. Incidentally, it usesafterunder the hood to apply thetransitive_optsetting.