Open
Description
opened on Feb 9, 2024
Based on my experience working with undici through nxt-undici and building a more advanced client on top undici I have come to a few realizations that have semver major implications:
onBodySent
andonRequestSent
are huge footguns. Remove it. (just wrap the body)interceptors
are weird and overengineered. Remove it. (just wrap dispatchers)onConnect
is confusing and should be renamed or something to make it more intuitive. Possibly entirely removed.body
should support a factory method (important for retries and redirects).onResponseStarted
. Why is onHeaders insufficient?maxRedirections
andRedirectHandler
should not be part of core/dispatcher APi. Move to the api methods.- Change hooks signature to accept objects instead of params.
- Rename disatpcher param to dispatch which is just a function (opts, handler) => {}
Activity