Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
fedb859
feat: add transport abstraction for POST SSE and custom transports
queso Feb 13, 2026
fb4c58f
feat: add schema-driven SSE with defineSchema, createChannel, and SSE…
queso Feb 17, 2026
a6747c0
refactor: extract shared SSE wire format utilities into sseParser
queso Feb 19, 2026
7f8303e
fix: rewrite channel.respond() with dual Web/Node.js signatures
queso Feb 19, 2026
2b1c6ab
fix: enforce schema/events mutual exclusivity at TypeScript type level
queso Feb 19, 2026
02b2a0f
fix: stop heartbeat timer when all clients disconnect
queso Feb 19, 2026
01eaa9a
chore: trigger CodeRabbit review
queso Feb 20, 2026
e72e4b7
ci: add GitHub Actions workflow for lint, typecheck, test, and build
queso Feb 20, 2026
f45a9cb
fix: exclude test files from tsc typecheck
queso Feb 20, 2026
8fc6a80
fix: make flushMicrotasks more robust for CI environments
queso Feb 20, 2026
96413b4
fix: use polling waitFor pattern for fetch transport tests
queso Feb 20, 2026
e30865d
fix: address CodeRabbit review feedback and CI test failures
queso Feb 21, 2026
e20157f
docs: fix markdown lint warning in README sendSSE description
queso Feb 21, 2026
8e8ce54
fix: move useSSEStream refCount to useEffect for concurrent mode safety
queso Feb 21, 2026
6cebf27
docs: fix code fence language and sendSSE comment in README
queso Feb 21, 2026
e0228c1
fix: stabilize non-serializable key and canonicalize headers in useSS…
queso Feb 21, 2026
105537f
docs: fix remaining typescript code fences containing JSX
queso Feb 21, 2026
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
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- run: bun install

- name: Lint
run: bun run lint

- name: Typecheck
run: bun run typecheck

- name: Test
run: bun test

- name: Build
run: bun run build
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/),
and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Added
- `defineSchema()` function for shared, type-safe event definitions consumed by both server and client (#WI-037)
- `createChannel(schema)` server-side SSE channel with dual Web/Node.js signatures, heartbeats, broadcast, and disconnect cleanup (#WI-039)
- `reactive-swr/server` subpath export for tree-shakeable server-side imports (#WI-036)
- `schema` prop on `SSEProvider` to auto-derive `events` mapping from a `defineSchema()` result (#WI-040)
- `sendSSE(data)` convenience method on `mockSSE` controls for simpler test assertions (#WI-038)
- `channel.connect()` for persistent SSE connections with initial `connected` event and configurable heartbeat interval
- `channel.respond()` for scoped request-response SSE emitters (no broadcast pool, no heartbeats)
- `channel.emit()` for type-safe broadcast to all connected clients with automatic dead-client cleanup
- `channel.close()` for graceful shutdown of all connections and heartbeat timers
- `SchemaDefinition`, `SchemaEventDefinition`, and `SchemaResult` types exported from main entry point
- `prepare` script (`bun run build`) for automatic builds on `link:` installs (#WI-036)
- `tsconfig.emit.json` for `.d.ts` declaration generation across all entry points (#WI-036)

### Changed
- Build script now compiles all three entry points (`index`, `testing`, `server`) with external peer deps (#WI-036)
- Mock fetch in testing module cast as `typeof globalThis.fetch` for `@types/node` 24+ compatibility (#WI-036)
- `SSEConfig` now accepts either `events` (manual) or `schema` (auto-derived), mutually exclusive at the type level (#WI-040)

### Previous

#### Added (Transport Abstraction)
- Transport abstraction layer for non-GET SSE connections (#WI-216, #WI-218, #WI-219, #WI-220)
- POST SSE support via `method` and `body` options in `useSSEStream` and `SSEProvider`
- Custom HTTP headers for SSE connections via `headers` option
- Custom transport factory via `transport` option for full control over SSE connections
- Automatic JSON serialization for plain object request bodies with `Content-Type: application/json`
- Body-implies-POST behavior: providing `body` without `method` defaults to POST
- `SSETransport` interface for building custom transport implementations (#WI-216)
- `SSERequestOptions` type for method/body/headers grouping (#WI-216)
- `createSSEParser` export for advanced users building custom transports (#WI-217, #WI-222)
- Spec-compliant SSE wire format parser with chunked input support (#WI-217)
- Fetch-based SSE transport using `fetch()` + `ReadableStream` (#WI-218)
- Shared reconnection utilities with exponential backoff (#WI-223)
- Unified reconnection for all transport types in SSEProvider (#WI-220)
- Composite connection keys in `useSSEStream` for proper connection reuse across different request configurations (#WI-219)
- Dual EventSource + fetch interception in `mockSSE` test utility (#WI-221)
- `sendRaw()` method on `mockSSE` controls for testing SSE parser edge cases (#WI-221)
Loading