Skip to content

Release 0.1.0-rc.3 - #7

Merged
monarcode merged 10 commits into
mainfrom
next/0.1.0-rc.3
Nov 16, 2026
Merged

monarcode merged 10 commits into
mainfrom
next/0.1.0-rc.3

Conversation

@monarcode

Copy link
Copy Markdown
Owner
  • feat: add Fetch.Service to declare a client as a service class
  • feat: add Fetch.Endpoints and client.bindAll to share a module's endpoints as a service
  • feat(plugins): add token refresh to bearer, plus retryAfter and budget to retry
  • feat: add a decoded-and-response mode and text and bytes outputs
  • feat: add endpoint query schemas, endpoint.url, catchStatus and optional
  • feat: add @monarcode/effetch/test with FetchTest, a typed fake backend from endpoints
  • feat: add SSE and NDJSON streams and Fetch.paginate
  • fix!: tighten the rc.3 APIs and add a streams example
  • docs: rewrite the README around Fetch.Service
  • fix: type inline endpoint definitions in pairs, and port examples to Fetch.Service

- Add Service, ServiceClass and isService; the class carries a static layer and
  a frozen config
- Use Fetch.Service in the README, the examples, the smoke test and the editor
  check
- Bump version to 0.1.0-rc.3 and add the changelog entry
…t to retry

- bearer({ refresh }) gets a new token on a 401 and sends the request again
  once; requests refused with the same token share one refresh
- retry({ retryAfter }) waits as long as a response's Retry-After header asks;
  retry({ budget }) caps the whole call and fails with TimeoutError when it runs
  out
- Add the RefreshSource, RetryBudgetPlugin and RetryBudgetOptions types, with
  docs and tests
- responseMode: "decoded-and-response" makes a call succeed with [decoded,
  response], on calls, endpoints and definitions; ResponseMode adds a defaulted
  type parameter to the call and endpoint types
- Fetch.text() and Fetch.bytes() read a 2xx body as text or a Uint8Array;
  Fetch.text(schema) trims the text and decodes one value
- consoleLogger and onExit handle the pair; add TextSchema and BytesSchema with
  tests and docs
- A query schema on an endpoint types each call's query and encodes it before
  it's sent; adds QuerySchema and EndpointQuery, and a defaulted type parameter
  on the endpoint and call types
- endpoint.url(options) builds the URL a call would use, for links and cache
  keys
- Fetch.catchStatus handles HttpErrors with the given statuses, and
  Fetch.optional turns a 404 into Option.none()
- api.sse and api.ndjson read a streamed body as a Stream, decoding each event
  or line with output; calls go through plugins, retry and status errors as
  usual
- stream: "sse" | "ndjson" on an endpoint definition makes its calls return a
  Stream; FetchTest.respond can answer them with a list of events
- Fetch.paginate pages through a bound endpoint as a lazy Stream of pages
- client.bind's response mode and query schema type parameters lose their
  defaults, so a definition written inline keeps its literal types; stream
  endpoint definitions reject responseMode and Fetch.bytes()
- FetchTest decodes a single query value for a field that takes a list or a
  value, and matches the root route only for "/"; retry gets a no-budget
  overload
- Add examples/streams.ts and its test, and reorganise the 0.1.0-rc.3 changelog
Make Fetch.Service the recommended way to set up a client, with a section
on when to use Fetch.make instead. Lead endpoints with Fetch.endpoint and
Fetch.Endpoints, add "Providing the client", list statusErrors in the
config table, fold edge cases into Details blocks, and add badges for
bundle size, types, provenance, license and the supported runtimes.1
Fetch.Service

An inline Fetch.endpoint(...) inside a [definition, options] pair, in
Fetch.Endpoints or client.bindAll, took its unset stream and response
mode from the surrounding type and was typed as a stream endpoint. The
return types of Fetch.endpoint and client.endpoint are now NoInfer.

Port examples/endpoints.ts, status-errors.ts and backends.ts, and the
JSDoc examples, to Fetch.Service and Fetch.Endpoints. Call the package
Effetch in prose, including the log message for a failed plugin hook.
@monarcode monarcode changed the title next/0.1.0 rc.3 Release 0.1.0-rc.3 Nov 16, 2026
@monarcode
monarcode merged commit dc9837c into main Nov 16, 2026
2 checks passed
@monarcode
monarcode deleted the next/0.1.0-rc.3 branch November 16, 2026 18:50
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