-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: rework runSequentialHandlers
plugin ordering
#5751
Conversation
In prep for extending the `runSequential` tests, break out the `beforeEach` sections to allow for variation in the tests.
We have a bug where if two plugins A and B, that both use the `hre/created` hook, where B depends on A, then we are seeing B run first then A run second. The ordering tests against the chained run have also been expanded.
The plugin reverse ordering of handlers makes sense for the chained running of hooks but is wrong for the sequential running, where dependent plugins should run before the dependee. We make several moves: - remove the `getHandlers` method from the API as it is only used internally to the hook manager - create equivalents to `getHandlers` with explicit logic for reversing the plugin order for chained running, and keeping the dependency order for sequential.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
runSequentialHandlers
plugin ordering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment re order
We change the ordering of dynamic hooks in run sequential, so that it is in effect the reverse of running chained. Plugins are now run first, with dynamic handlers coming second. Plugins run in resolved dependency order (if B depends on A, A runs before B). Dynamic handlers are run in the order they are registered. The tests and docs have been updated to reflect this change.
The plugin reverse ordering of handlers makes sense for the chained
running of hooks but is wrong for the sequential running, where
dependent plugins should run before the dependee.
We make several moves:
getHandlers
method from the API as it is only usedinternally to the hook manager
getHandlers
with explicit logic for reversingthe plugin order for chained running, and keeping the dependency order
for sequential.
Reviewers Suggestion
This PR should be reviewed a commit at a time to avoid the jitter from the test restructuring.