Skip to content

Releases: JiangJie/fetch-t

v1.9.1

16 Jan 03:54

Choose a tag to compare

[1.9.1] - 2026-01-16

Added

  • Add fallback overload to support passing FetchInit as a variable (returns union type FetchTask | FetchResult)
  • Add @since tags to all public APIs for version tracking

Changed

  • Upgrade happy-rusty dependency to ^1.9.1
  • Trigger JSR publish workflow on release instead of push to main

Documentation

  • Fix JSDoc format (tag order, spacing between tags)
  • Clarify response.clone() memory overhead for progress tracking in CODEBUDDY.md

Full Changelog: v1.9.0...v1.9.1

v1.9.0

13 Jan 08:38

Choose a tag to compare

[1.9.0] - 2026-01-13

Changed

  • BREAKING: Rename FetchResponse<T, E> to FetchResult<T> (simplified type, E is always Error)
  • BREAKING: Rename FetchTask.response property to FetchTask.result

Migration

// Before
import type { FetchResponse } from '@happy-ts/fetch-t';
const task = fetchT(url, { abortable: true });
const result = await task.response;

// After
import type { FetchResult } from '@happy-ts/fetch-t';
const task = fetchT(url, { abortable: true });
const result = await task.result;

Full Changelog: v1.8.1...v1.9.0

v1.8.1

13 Jan 01:14

Choose a tag to compare

[1.8.1] - 2026-01-13

Changed

  • Replace tiny-invariant with explicit throw statements to preserve error messages in production builds
  • Improve parameter validation error messages with proper TypeError vs Error distinction

Removed

  • Remove tiny-invariant dependency (smaller bundle size)

Full Changelog: v1.8.0...v1.8.1

v1.8.0

12 Jan 07:06

Choose a tag to compare

[1.8.0] - 2026-01-12

Added

  • Add URL validation with browser relative path support
    • Validates URLs upfront before calling fetch
    • Supports relative URLs in browser environments (using location.href as base)
    • Throws TypeError with unified message for invalid URLs in non-browser environments

Full Changelog: v1.7.0...v1.8.0

v1.7.0

08 Jan 12:23

Choose a tag to compare

[1.7.0] - 2026-01-08

Added

  • Export FetchResponseData union type for dynamic responseType scenarios
  • Add FetchResponseType union overloads for when responseType is a type variable (not a literal)
  • Add examples/overload-demonstration.ts showcasing all fetchT overloads with explicit type annotations

Changed

  • Add abortable?: false constraint to non-abortable overloads for stricter type checking
  • Update JSDoc for non-abortable overloads to document abortable must be false or omitted constraint

Full Changelog: v1.6.0...v1.7.0

v1.6.0

06 Jan 15:52

Choose a tag to compare

[1.6.0] - 2026-01-06

Added

  • Add 'bytes' responseType to return Uint8Array via Response.bytes() (with fallback for older environments)

Changed

  • Refactor signal handling: extract configureSignal() function to ensure fresh timeout signal on retries
  • Refactor progress tracking to use response.clone() instead of stream.tee()
  • Simplify setupProgressCallbacks with for-await-of loop
  • Use AsyncIOResult type alias for internal consistency
  • Use stricter Uint8Array<ArrayBuffer> typing throughout
  • Upgrade typescript-eslint to ^8.52.0

Fixed

  • Fix body.cancel() rejection handling on non-ok responses
  • Fix stream reader cancellation on error to release resources
  • Fix json and stream responseType to return null for empty body

Full Changelog: v1.5.1...v1.6.0

v1.5.1

04 Jan 12:15

Choose a tag to compare

[1.5.1] - 2026-01-04

Fixed

  • Fix ReadableStream<Uint8Array<ArrayBuffer>> type parameter for abortable stream overload
  • Fix ReadableStream generic type parameter

Changed

  • Refactor multiplexStream as internal function of fetchT for better encapsulation
  • Use Number.parseInt instead of global parseInt for stricter linting compliance
  • Upgrade happy-rusty dependency to ^1.9.0

Full Changelog: v1.5.0...v1.5.1

v1.5.0

04 Jan 01:32

Choose a tag to compare

[1.5.0] - 2026-01-04

Added

  • Add automatic retry support with configurable strategies (retry option)
    • retries: Number of retry attempts
    • delay: Static delay or exponential backoff function
    • when: Retry on specific HTTP status codes or custom condition
    • onRetry: Callback before each retry attempt
  • Add 'stream' responseType to return raw ReadableStream<Uint8Array>
  • Add runtime validation for fetchT options (responseType, timeout, callbacks, retry)
  • Add examples/with-retry.ts with comprehensive retry examples

Changed

  • Optimize timeout handling using native AbortSignal.timeout() and AbortSignal.any() APIs
  • Upgrade happy-rusty dependency to ^1.8.0
  • Upgrade typescript-eslint to ^8.51.0
  • Upgrade msw to ^2.12.7

Fixed

  • Fix abort reason always wrapped as Error with proper ABORT_ERROR name

Full Changelog: v1.4.1...v1.5.0

v1.4.1

25 Dec 07:29

Choose a tag to compare

[1.4.1] - 2025-12-25

Fixed

  • Fix unhandled promise rejections when onChunk or onProgress callbacks throw errors
  • Fix unhandled promise rejections during stream read errors

Changed

  • Upgrade happy-rusty dependency to ^1.6.2
  • Upgrade typescript-eslint to ^8.50.1

Full Changelog: v1.4.0...v1.4.1

v1.4.0

19 Dec 12:05

Choose a tag to compare

[1.4.0] - 2025-12-19

Changed

  • BREAKING: Migrate from Deno test runner to Vitest with MSW mocking
  • BREAKING: Migrate from Rollup to Vite for building
  • BREAKING: Change license from GPL-3.0 to MIT
  • Upgrade happy-rusty dependency to ^1.6.1
  • Upgrade all dev dependencies to latest versions
  • Rewrite README with improved structure, examples, and API documentation
  • Update GitHub Actions workflows for Vitest

Added

  • Add examples/ directory with runnable usage examples
  • Add ESLint stylistic rules for code formatting
  • Add TypeDoc HTML documentation hosted on GitHub Pages

Removed

  • Remove Deno configuration (deno.json)
  • Remove Rollup configuration (rollup.config.mjs)

Full Changelog: v1.3.3...v1.4.0