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
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ A React library for streaming text using Server-Sent Events (SSE) with `text/eve

![Demo of rendering text event stream](./demo.gif)

### Run the demo locally

From the repository root:

```bash
npm install
npm run demo
```

This installs dependencies for [`demo/server`](./demo/server) and [`demo/client`](./demo/client), builds the library into `dist/`, then starts both in parallel: the SSE test server on [http://localhost:3001](http://localhost:3001) (endpoint `/sse`) and the Vite app (by default [http://localhost:5173](http://localhost:5173); Vite may open a browser automatically). The client loads `react-text-stream` via `file:../..`, matching how the published package resolves to `dist`.

Other scripts:

- **`npm run demo:server`** — SSE server only (`demo/server`, `npm run dev`).
- **`npm run demo:client`** — Vite dev server only (`demo/client`). Run **`npm run build`** at the repo root first so `dist/` exists for the linked package.
- **`npm run demo:install`** — install dependencies in both demo packages without starting servers.
- **`npm run demo:verify`** — build the library and run a production build of the demo client (useful to confirm the package layout before publish).

## Installation

```bash
Expand Down
9 changes: 9 additions & 0 deletions demo/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<html>
<head>
<title>React Event Stream</title>
</head>
Comment on lines +1 to +4

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index.html is missing a <!doctype html> declaration. Without it, the page can render in quirks mode, which can cause inconsistent layout/styling across browsers. Add <!doctype html> at the top of the document (and consider adding a charset meta tag as well).

Copilot uses AI. Check for mistakes.
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading