The eleventy.after
event should not fire its handlers in parallel
#3415
Labels
Milestone
eleventy.after
event should not fire its handlers in parallel
#3415
Operating system
macOS Sonoma 14.6.1
Eleventy
3.0.0-beta.1
Describe the bug
Eleventy should not fire its
eleventy.after
(and probably also not itseleventy.before
) event handlers in parallel. This is an issue, because any plugin that manipulates files asynchronously now directly conflicts with another, introducting race conditions and potential flaky error scenarios.For example, I have written a plugin that adds hash parameters to referenced asset URLs. If I were to use it in combination with any plugin that moves or renames files, the ouput would be a mangled mess of half-combinations of files that have moved, some with hash parameters, some without, and potentially duplicate files because one plugin wrote to a file that the other has just moved.
In a nutshell, the
AsyncEventEmitter
should use a simple for-loop instead ofPromise.all()
to run the handlers sequentially, though potentially we'd want an (internal) option for it to determine whether to run handlers in parallel or not for each individual event type.The text was updated successfully, but these errors were encountered: