Skip to content

Add HookEngine.addPipe for typed pipe middleware registration - #148

Merged
damusix merged 1 commit into
masterfrom
hooks-add-pipe
Aug 9, 2026
Merged

damusix merged 1 commit into
masterfrom
hooks-add-pipe

Conversation

@damusix

@damusix damusix commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add() types every callback for the run() shape, so pipe middleware could not be registered without as any — the exported PipeCallback type was accepted nowhere. addPipe() accepts it, typed against the lifecycle signature, over the same registry pipe()/pipeSync() already invoke.
  • The fetch retry and dedupe plugins now register their execute middleware through it, dropping the casts that motivated the issue.
  • Adds the suite's first direct pipe()/pipeSync() coverage, and fixes three doc examples that passed arguments to the zero-arg coreFn.

What this solves

Any FetchPlugin (or other consumer) wrapping a pipe hook can now compile without suppressions. Type-only change — no runtime behavior differs.

Closes #147

add() types every callback for the run() shape, so pipe middleware
could not register without an as-any cast. addPipe accepts PipeCallback
against the lifecycle signature over the same registry pipe() already
invokes. Migrates the fetch retry/dedupe plugins off their casts, adds
the suite's first direct pipe()/pipeSync() coverage, documents the API
(changeset: hooks minor, fetch patch), and fixes three doc examples
that passed args to the zero-arg coreFn.

Closes #147
@damusix
damusix merged commit 3f41aa4 into master Aug 9, 2026
1 check passed
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.

HookEngine.add() rejects PipeCallback, so pipe hooks are untypeable

1 participant