Configurable hook execution order for extensions #25796
the-other-dev
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Allow explicit control over the execution order of custom hooks/extensions listening to the same event in Directus.
Basic Example
Suppose you have two hooks: one called hook-virus-scanner that scans uploaded files for viruses, and another called hook-file-processor that processes files after upload. With this feature, you could explicitly specify that hook-virus-scanner should always run before hook-file-processor, ensuring files are scanned before any processing occurs.
Motivation
Currently, the execution order of hooks is determined by their names, which is not explicit or reliable. This limits modularity and maintainability, as developers must use naming conventions to control order. Explicit ordering would enable smaller, focused extensions and allow instance-level customization, supporting more complex and modular workflows.
Detailed Design
Requirements List
Must Have:
Should Have:
Could Have:
Won't Have:
Drawbacks
Alternatives
Adoption Strategy
Unresolved Questions
No response
Beta Was this translation helpful? Give feedback.
All reactions