Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.2] - 2026-11-10 (Latest Updates)

### Performance & Memory Footprint Optimization

- **Zero-Allocation Pipeline Fast-Paths**: Refactored the core request pipeline to eliminate redundant intermediate object allocations on hot request paths and bypass serialization overhead during cache hits.
- **Shared djb2 Auth Hashing (`src/hash.ts`)**: Extracted a dedicated 32-bit djb2 string hashing function (`hashAuthHeader`) to replace repetitive string concatenation when building cache and request deduplication keys.
- **Deterministic Query String Sorting (`src/url.ts`)**: Implemented standalone `sortQueryString` utility to normalize query parameters alphabetically for consistent, deterministic cache key evaluation across concurrent requests.
- **Static Fallback Policy Hoisting**: Hoisted static configurations (`ZERO_RETRY_POLICY`, `SENSITIVE_HEADERS`, `DUMMY_HYDRATE_CONFIG`) to module level, eliminating transient per-request allocation overhead.
- **HTTP Method Boilerplate Consolidation**: Unified verb handler closures (`get`, `post`, `put`, `patch`, `delete`, `head`, `options`) in `src/client.ts` via an internal `mergeReq` helper, reducing bundle footprint and closure memory retention.
- **Tree-Shaking Pure Annotation**: Added `/* @__PURE__ */` annotation to `createFetchClient` in `src/index.ts` enabling downstream bundlers (Metro, Vite, Rollup, Webpack) to fully tree-shake unused exports.
- **Bundlephobia Footprint**: Reduced minified bundle size to **38.3 kB** (~**12.1 kB** gzipped).

### Code Deduplication & Refactoring

- **Header Merge Consolidation**: Reused internal `mergeHeaders` utility across `src/mock.ts` and `src/offline/queue.ts`, eliminating duplicate header normalization logic.
- **Validator Error Mapping**: Unified error construction in `src/validator.ts` via `toValidationError`.
- **SSE Stream Field Parsing**: Streamlined line-parsing logic in `src/stream.ts` via `parseFieldLine`.

### Supply Chain Security

- **Socket.dev Configuration**: Added `.socket.yml` / `socket.yml` acknowledging legitimate `networkAccess` for WHATWG `globalThis.fetch` with explicit zero-telemetry confirmation.

---

## [1.0.1] - 2026-11-04

### Improvements & Type Ergonomics
Expand All @@ -15,11 +39,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

---

## [1.0.0] - 2026-11-02
## [1.0.0] - 2026-11-02 (Official LTS Release)

### General Availability & Stable Release
### General Availability & Long Term Support Foundation

- **Official Stable Release (`v1.0.0`)**: Declares the public API stable with strict adherence to Semantic Versioning (SemVer).
- **Official LTS Stable Release (`v1.0.0`)**: Declares the public API stable with strict adherence to Semantic Versioning (SemVer) as the Long Term Support foundation.
- **Enterprise-Vetted & Production-Hardened**:
- **Zero Runtime Dependencies**: Strict `dependencies: {}` footprint guaranteed.
- **Comprehensive Test Coverage**: 35 test suites with 301 automated unit and integration tests passing with 100% reliability.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A lightweight, Fetch-native HTTP client for TypeScript and JavaScript across Rea
[![npm version](https://img.shields.io/npm/v/react-native-fetch-client.svg)](https://www.npmjs.com/package/react-native-fetch-client)
[![CI](https://github.com/arunkumarArjun/react-native-fetch-client/actions/workflows/ci.yml/badge.svg)](https://github.com/arunkumarArjun/react-native-fetch-client/actions/workflows/ci.yml)
[![Socket Security](https://badge.socket.dev/npm/package/react-native-fetch-client)](https://socket.dev/npm/package/react-native-fetch-client)
[![Bundle Size](https://img.shields.io/badge/bundle%20size-12.67%20KB%20min%2Bgzip-brightgreen.svg)](https://bundlephobia.com/package/react-native-fetch-client)
[![Bundle Size](https://img.shields.io/badge/bundle%20size-12.1%20kB%20min%2Bgzip-brightgreen.svg)](https://bundlephobia.com/package/react-native-fetch-client)
[![Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)](package.json)
[![Tests](https://img.shields.io/badge/tests-304%20passed-brightgreen.svg)](test)
[![Documentation](https://img.shields.io/badge/docs-interactive%20site-blue.svg)](https://react-native-fetch-client.vercel.app/)
Expand All @@ -19,7 +19,7 @@ A lightweight, Fetch-native HTTP client for TypeScript and JavaScript across Rea
| Feature | `react-native-fetch-client` | Axios |
| :--- | :--- | :--- |
| **Runtime Dependencies** | **0** (`dependencies: {}`) | 4 dependencies (`proxy-agent`, `redirects`, etc.) |
| **Minified Core Bundle** | **38.08 KB** (~12.67 KB gzip) | ~75 KB |
| **Minified Core Bundle** | **38.3 kB** (~12.1 kB gzip) | **56.8 kB** (~21 kB gzip • + plugins: ~75-120 KB) |
| **Mobile Network Engine**| Native WHATWG `fetch` (Hermes C++ JNI) | Legacy `XMLHttpRequest` (XHR bridge) |
| **401 Token Refresh** | **Built-in Atomic Mutex** (zero race conditions) | Manual race-prone interceptor boilerplate |
| **Caching & Deduplication** | **Built-in SWR Cache (0ms)** & In-Flight Dedup | Requires 3rd-party plugins |
Expand Down
14 changes: 7 additions & 7 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

We actively support and provide security patches for the following versions:

| Version | Supported |
| ------- | --------- |
| 1.0.x | Yes |
| 0.3.x | Yes |
| 0.2.x | Yes |
| 0.1.x | Yes |
| < 0.1.0 | No |
| Version | Supported | Status / Channel |
| ------- | --------- | ---------------- |
| 1.0.x | Yes | Active (LTS: 1.0.0, Updates: 1.0.2) |
| 0.3.x | Yes | Maintenance |
| 0.2.x | Yes | Maintenance |
| 0.1.x | Yes | Maintenance |
| < 0.1.0 | No | End of Life |

## Reporting a Vulnerability

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-fetch-client",
"version": "1.0.1",
"version": "1.0.2",
"description": "Zero-dependency, Fetch-native HTTP client for React Native, Expo, browsers, and Node.js with built-in 401 auth mutex, SWR caching, retries, and offline queue.",
"author": "Arunkumar Arjunan",
"license": "MIT",
Expand Down
Loading