Skip to content

Prepare Clearfetch 2.0.0 release - #53

Merged
bmurdock merged 7 commits into
mainfrom
release-2.0.0
Sep 23, 2026
Merged

bmurdock merged 7 commits into
mainfrom
release-2.0.0

Conversation

@bmurdock

Copy link
Copy Markdown
Owner

Prepare Clearfetch 2.0.0 to correct client response-mode typing and make cancellation reliable through pending hooks and raw response body reads. The major version communicates the TypeScript compatibility changes; runtime support and zero runtime dependencies remain unchanged.

Breaking changes

  • Non-JSON and dynamic clients no longer satisfy the JSON-default HttpClient type. For example, use HttpClient<'text'> instead of HttpClient for createClient({ responseType: 'text' }), or let inference preserve the mode.
  • Remove the deprecated NormalizedRequestOptions public export. MIGRATION.md explains the appropriate public request, client-default, and hook-option types.

Other changes

  • Race pending request/response hooks against caller cancellation; response hooks also respect attempt timeouts. Preserve caller cancellation after raw response handoff while ending the attempt timeout at handoff.
  • Preserve custom library-error abort reasons as AbortRequestError.cause and valid client error observers when request configuration is malformed.
  • Accept forwarded request options and dynamic response modes with appropriately broad result types.
  • Retry transient attestation response-body failures during release verification.
  • Align the changelog, migration guide, diagnostic/cancellation documentation, and exact-artifact release/recovery procedures.

Validation

  • Final staged release-confidence bundle passed: lint, 199 unit tests, build, package metadata, retained tarball smoke checks, whitespace checks, and exact-tarball npm dry-run against the public registry.
  • Release preparation also passed native Node HTTP integration (4 tests), browser-like tests (3), real Chromium coverage (1), TypeScript 5/6/7 declarations, benchmark smoke, lockfile checks, dependency audit (zero vulnerabilities), and registry signature/attestation checks.
  • Migration examples compile against v2. The legacy client assignment compiles against the actual v1.0.9 source and correctly fails against v2.
  • Independent review found no actionable issues.
  • Tarball: 174,175 unpacked bytes, below the unchanged 175,000-byte budget (825 bytes of headroom).

One initial focused cancellation run stalled and was terminated. The full suite subsequently passed, including the final staged run; the affected four-file selection also passed 12 bounded repetitions. No source defect was established, and the initial stall remains unexplained.

Hosted CI and dependency review are separate merge gates. This PR does not tag or publish: after merge and passing checks, create the annotated v2.0.0 tag on main and verify npm integrity/provenance and the matching GitHub Release through the existing workflow.

Race pending response hooks against cancellation and observe late rejections. Retain caller abort forwarding for raw response bodies without strongly retaining abandoned requests.

Cover hook settlement, native streaming cancellation, and garbage collection; document the response handoff contract.
Give established cancellation precedence over existing clearfetch errors while preserving the abort reason as the cause.

Add fetch, parser, and retry-backoff regressions and record the behavior in the changelog.
Remove JSON intersections and preserve response-mode covariance for clients and extracted methods. Add broad overloads for dynamic request options while retaining precise literal overloads.

Cover source and packed declarations across supported TypeScript versions and document the annotation compatibility change.
- Stop pending hooks on caller abort while preserving timeout start semantics.
- Preserve abort causes and observe late hook rejections without running later hooks.
- Add cancellation regressions and document the hook lifecycle behavior.
- Recover client and request onError lists independently during normalization failures.
- Keep valid client observers and preserve the original configuration error.
- Cover malformed options through request and get, and document recovery behavior.
Remove the deprecated normalized-options export with source, declaration, and packed-package regressions. Add migration guidance for the breaking type changes and document cancellation and diagnostic boundaries.

Align package versions, changelog, and release procedures while retaining existing runtime support and package-size budgets.
@bmurdock
bmurdock merged commit 171a421 into main Sep 23, 2026
15 checks 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.

1 participant