Skip to content
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

Include context safety #42

Merged
merged 3 commits into from
Jul 22, 2024
Merged

Include context safety #42

merged 3 commits into from
Jul 22, 2024

Conversation

ioquatix
Copy link
Member

After some practical usage, I found the design of the before, after and around hooks to be a little counter-intuitive.

  • def before in a shared context can clobber existing before hooks.
  • before and after hooks are all run from bottom to top, and then around hooks. This leads to odd interleaving of hooks, in other words, an around hook is not equivalent to before and after hooks.

We introduce a better model for before and after hooks, and a better model for including shared contexts.

@ioquatix ioquatix merged commit 1151b95 into main Jul 22, 2024
44 of 50 checks passed
@ioquatix ioquatix deleted the include_context-safety branch July 22, 2024 02:28
ioquatix added a commit that referenced this pull request Jul 22, 2024
* Add before/after/around helpers.

* Make it possible to include/prepend shared modules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant