Repository navigation
release: http-client@0.7.0 - #10
Merged
Merged
Conversation
afoures
force-pushed
the
release/http-client
branch
5 times, most recently
from
August 2, 2026 08:10
ee50eb3 to
ef4310f
Compare
afoures
force-pushed
the
release/http-client
branch
3 times, most recently
from
August 6, 2026 06:16
6aad427 to
dd96108
Compare
afoures
force-pushed
the
release/http-client
branch
from
August 26, 2026 07:01
dd96108 to
551eaae
Compare
afoures
force-pushed
the
release/http-client
branch
4 times, most recently
from
September 14, 2026 22:15
8ab12c2 to
17ced58
Compare
afoures
force-pushed
the
release/http-client
branch
from
September 15, 2026 05:51
17ced58 to
a151271
Compare
afoures
marked this pull request as ready for review
September 15, 2026 06:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is managed by auto-release. Do not edit it manually.
Automated release for
http-clientVersion:
0.6.0→0.7.0Changelog
Breaking Changes
Rework how endpoints and clients are declared
Endpointtakes three arguments now: the route, the definition, the options.A definition that needs the per-call context is a
(context) => definitionfactory whoseparameter annotation declares the context type. The context is then in scope by closure, so
define_context,with_defaultsand per-schema(context) => schemafactories are gone.HttpClientConfigis parameterized by the endpoint tree rather than by a hand-written context,with
ClientContext<endpoints>exported for wrappers, andEndpointMapis no longer exported.Pathnames use a built-in parser, so the package has no runtime dependencies.
:paramand nestedoptional groups are unchanged; wildcards, enums and the protocol, hostname, port and search
patterns are gone, and
?and#are rejected. An unparsablebase_urlor a tree leaf that isnot an
Endpointnow throws when the client is built, instead of failing per call.Rework request serialization
A declared
params,queryorbodyschema always runs, an omitted slot included, so defaultsand
preprocessapply where they used to be skipped; a schema output ofundefinedmeans sendnothing. A custom body
serializeownsContent-Typeand its return shape is keyed on the bodytype:
FormDataandURLSearchParamsreject one,BufferSourceandReadableStreamrequireone, and a
Content-Typefromheadersis dropped in favor of the serializer's. A query orparams schema whose output is
anynow requires aserializefunction.The
"urlencoded"encoder repeats array values (?tags=a&tags=b) and handles entry lists, andreturns a
SerializationErrorfor anything it cannot express instead of silently emitting[object Object]or nothing at all. The"json"body serializer returns its failures the sameway rather than throwing them out of the call.
Give a response body exactly one reader
The
parsedeclared for a status is the only thing handed the body; nothing else receives aResponse, and an unread body is released.raw_responseis gone from the response envelopes,which carry
status,ok,url,methodandheadersthemselves, and the retry callbacksreceive that same metadata in place of the
RequestandResponse. To reach or stream a bodythe client would not otherwise read, return it from
parse.A schema whose input is
any,unknown,voidornevernow requires aparsefunction,since the client cannot know how to decode for it. The undeclared-2xx fallback is typed
nullinstead of
void, which is what it already yielded at runtime and what204yields. MalformedJSON is now a
ParseErrorcarrying the offending text, and a1xxresponse is returned as anUnexpectedErrorrather than thrown.Rework retry and timeout semantics
timeoutis the deadline for the whole call, covering every attempt, every retry delay andresponse parsing, where it used to bound each attempt.
retry.attemptscounts retries ratherthan requests.
timeoutaccepts{ total?, attempt? }and merges per key, andErrorContext.request.timeoutcarries that object instead of a number. Only
undefineddisables it, so0means immediately.The default retry condition retries only transient failures (
NetworkError,TimeoutError, 408,429 and 5xx) rather than every non-ok response, and
retrymerges per key, withundefinedmeaning "not set here". A non-finite
attempts,delayor timeout is rejected instead of, inthe case of
NaN, retrying forever. This also fixes a retried body being held for the wholebackoff, a zero-delay retry loop starving the event loop, and an abort during a delay surfacing
as an
UnexpectedError.Features
Add a
kinddiscriminant to every response envelope and error classEach arm of a call result carries a
kindliteral named after its own type or class, exported asHTTPFetch.ResponseKindandErrorKind. It tells the redirect arm apart from the errorresponses, which
ok: falsealone does not:It also narrows the whole union in one
switchwith noinstanceof, for when a prototype checkcannot be trusted: after a spread, a clone, or two copies of the package being installed. Reading
a result is unaffected, but code that builds an envelope by hand, such as a test fixture, has to
add the matching
kind.