typical-data icon indicating copy to clipboard operation
typical-data copied to clipboard

Re-assess ordering of global afterBuild hooks

Open davidtkramer opened this issue 4 years ago • 0 comments

Right now global afterBuild hooks are ran after trait afterBuild hooks. When combined with extended factories, this may lead to unintuitive execution order of hooks.

Running global hooks after results in parent hooks being mixed in with child hooks:

  1. child trait hooks
  2. parent global hook
  3. child global hook

Running global hooks before results in a more intuitive ordering that follows the inheritance hierarchy:

  1. parent global hook
  2. child global hook
  3. child trait hooks

davidtkramer avatar Jul 31 '21 01:07 davidtkramer