build
build copied to clipboard
Re-order plugins in the UI
When set in netlify.toml
, the plugins
array order is significant. For example, if two plugins are using the same event (for example onPreBuild
), the plugin defined first in that array will be executed first.
However, this is not possible in the UI at the moment. From a data standpoint, we do store UI plugins in an ordered array behind the scene. But we might want to also let users order plugins from the UI.
The current workaround is to use netlify.toml
instead. It is also possible that uninstalling then re-installing a plugin in the UI might impact order, but this would be quite hacky.
This was requested by a user in Netlify community.
@verythorough
It is also possible that uninstalling then re-installing a plugin in the UI might impact order, but this would be quite hacky.
I've tried this and I can confirm that it works, but it might become a bit of a pain in case of numerous plugins installed.
Thanks for opening the issue! Have a good day 😄
Thanks for filing, @ehmicky! I've been thinking about plugin ordering, and I'm wondering if we should consider other ways of configuring inter-plugin dependencies. Ordering in the config file feels somewhat intuitive and simple (and does match some of our other patterns, like redirect rules), but it also feels somewhat fragile, especially in this context.
For example, one possible alternative might be to have the ability to set a property like runAfter
that includes an array of plugin names that must run before the current one. (This could be set in the plugin or configured by the user in plugin inputs
.) I suppose that adds some complexity to the implementation, but also maybe some flexibility? If we require plugins to be explicit about when order matters, it frees up the ability for us to run plugins in parallel (within the same event, of course!) when order doesn't matter.
Yes, I agree that's a bigger question. I am wondering what @erquhart and @erezrokah thinks about this one too.
A little less than one year ago, we went a similar route when talking about plugin "orchestration" and "outputs": letting either users define dependencies between plugins (like runAfter
). As you mention, this could enable parallelization, although many (potentially hard) problems would need to be solved to make this a smooth experience (see my comment here).
Considering the potential complexity of this feature (plugins execution order and parallelization) for both the user and us, I would personally favor delaying the exploration of it until we have several users asking for that level of configurability.
Most plugins have a single event. In that case, ordering the plugins list as a single array should fix most ordering problems users might encounter (including @Signoo). Also, it is already implemented in the netlify.toml
, not just in the UI. This is not an optimal solution, but I am wondering whether this could be a easy win fitting 95% of use cases?
This issue has been automatically marked as stale because it has not had activity in 1 year. It will be closed in 14 days if no further activity occurs. Thanks!
This issue was closed because it had no activity for over 1 year.