Releases: JiangJie/fetch-t
Releases · JiangJie/fetch-t
v1.9.1
[1.9.1] - 2026-01-16
Added
- Add fallback overload to support passing
FetchInitas a variable (returns union typeFetchTask | FetchResult) - Add
@sincetags to all public APIs for version tracking
Changed
- Upgrade
happy-rustydependency 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
[1.9.0] - 2026-01-13
Changed
- BREAKING: Rename
FetchResponse<T, E>toFetchResult<T>(simplified type,Eis alwaysError) - BREAKING: Rename
FetchTask.responseproperty toFetchTask.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
[1.8.1] - 2026-01-13
Changed
- Replace
tiny-invariantwith explicitthrowstatements to preserve error messages in production builds - Improve parameter validation error messages with proper
TypeErrorvsErrordistinction
Removed
- Remove
tiny-invariantdependency (smaller bundle size)
Full Changelog: v1.8.0...v1.8.1
v1.8.0
[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.hrefas base) - Throws
TypeErrorwith unified message for invalid URLs in non-browser environments
- Validates URLs upfront before calling
Full Changelog: v1.7.0...v1.8.0
v1.7.0
[1.7.0] - 2026-01-08
Added
- Export
FetchResponseDataunion type for dynamicresponseTypescenarios - Add
FetchResponseTypeunion overloads for whenresponseTypeis a type variable (not a literal) - Add
examples/overload-demonstration.tsshowcasing all fetchT overloads with explicit type annotations
Changed
- Add
abortable?: falseconstraint to non-abortable overloads for stricter type checking - Update JSDoc for non-abortable overloads to document
abortable must be false or omittedconstraint
Full Changelog: v1.6.0...v1.7.0
v1.6.0
[1.6.0] - 2026-01-06
Added
- Add
'bytes'responseType to returnUint8ArrayviaResponse.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 ofstream.tee() - Simplify
setupProgressCallbackswithfor-await-ofloop - Use
AsyncIOResulttype alias for internal consistency - Use stricter
Uint8Array<ArrayBuffer>typing throughout - Upgrade
typescript-eslintto ^8.52.0
Fixed
- Fix
body.cancel()rejection handling on non-ok responses - Fix stream reader cancellation on error to release resources
- Fix
jsonandstreamresponseType to returnnullfor empty body
Full Changelog: v1.5.1...v1.6.0
v1.5.1
[1.5.1] - 2026-01-04
Fixed
- Fix
ReadableStream<Uint8Array<ArrayBuffer>>type parameter for abortable stream overload - Fix
ReadableStreamgeneric type parameter
Changed
- Refactor
multiplexStreamas internal function offetchTfor better encapsulation - Use
Number.parseIntinstead of globalparseIntfor stricter linting compliance - Upgrade
happy-rustydependency to ^1.9.0
Full Changelog: v1.5.0...v1.5.1
v1.5.0
[1.5.0] - 2026-01-04
Added
- Add automatic retry support with configurable strategies (
retryoption)retries: Number of retry attemptsdelay: Static delay or exponential backoff functionwhen: Retry on specific HTTP status codes or custom conditiononRetry: Callback before each retry attempt
- Add
'stream'responseType to return rawReadableStream<Uint8Array> - Add runtime validation for
fetchToptions (responseType, timeout, callbacks, retry) - Add
examples/with-retry.tswith comprehensive retry examples
Changed
- Optimize timeout handling using native
AbortSignal.timeout()andAbortSignal.any()APIs - Upgrade
happy-rustydependency to ^1.8.0 - Upgrade
typescript-eslintto ^8.51.0 - Upgrade
mswto ^2.12.7
Fixed
- Fix abort reason always wrapped as Error with proper
ABORT_ERRORname
Full Changelog: v1.4.1...v1.5.0
v1.4.1
[1.4.1] - 2025-12-25
Fixed
- Fix unhandled promise rejections when
onChunkoronProgresscallbacks throw errors - Fix unhandled promise rejections during stream read errors
Changed
- Upgrade
happy-rustydependency to ^1.6.2 - Upgrade
typescript-eslintto ^8.50.1
Full Changelog: v1.4.0...v1.4.1
v1.4.0
[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-rustydependency 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