Skip to the content.

AGENTS.md

Guidance for AI coding agents in this repo. Human contributors: see the Contribute section of the README.

This is react-fetch-streams: React hooks for streaming a response body over the Fetch + Streams APIs (useStream, plus useNdjsonStream for newline-delimited JSON) and for Server-Sent Events (useEventSource, useEventStream). It is a small, dependency-free, published npm library written in TypeScript. Keep it that way; think twice before adding a runtime dependency.

The toolchain is the Rust-based oxc stack: oxlint to lint, Prettier to format, tsdown (Rolldown + oxc) to build and emit declarations, and Vitest to test; TypeScript (tsc --noEmit) type-checks. There is no Babel, ESLint, or Rollup; do not reintroduce them.

Workflow

Local CI (must be green before review):

npm run typecheck     # tsc --noEmit
npm run lint          # oxlint
npm run format:check  # prettier
npm run build         # tsdown
npm run test:cov      # vitest

Writing: code, comments, docs, commits

Commits

Tests

Code conventions

Browser support

Build and publish

CI workflows