Skip to content

Semver Major Considerations #2722

Open
Open
@ronag

Description

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 and onRequestSent 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 and RedirectHandler 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    semver-majorFeatures or fixes that will be included in the next semver major release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions