Skip to content

Commit 4c2eba4

Browse files
hosted demo live, docs overhaul, bump package versions
release: prepare v0.1.4 — hosted demo live, docs overhaul, bump package versions
2 parents d8bc66f + 7a1f257 commit 4c2eba4

7 files changed

Lines changed: 157 additions & 380 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on Keep a Changelog, and this project follows Semantic Versioning.
66

7+
## [0.1.4] - 2026-04-07
8+
9+
### Added
10+
11+
- Published hosted demo page: https://www.zhangjiahang.com/react-virtualized-diff.
12+
13+
### Changed
14+
15+
- Bumped workspace package versions to `0.1.4` for the release.
16+
- Reworked both English and Chinese README documents with clearer, search-friendly structure.
17+
- Promoted API, benchmark, and demo sections for faster discovery by humans and AI crawlers.
18+
719
## [0.1.3] - 2026-04-07
820

921
### Added

README.md

Lines changed: 61 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,183 +1,122 @@
11
# react-virtualized-diff
22

3-
A high-performance, virtualized React diff viewer designed for **very large text files** and smooth developer experience.
3+
High-performance React diff viewer for **large text/code files** with virtualized rendering.
44

5-
> Package name on npm: **`react-virtualized-diff`**
5+
- 📦 npm: [`react-virtualized-diff`](https://www.npmjs.com/package/react-virtualized-diff)
6+
- 🌐 Live Demo: https://www.zhangjiahang.com/react-virtualized-diff
7+
- 📊 Benchmark report: [benchmark-results/results.md](./benchmark-results/results.md)
8+
- 🇨🇳 中文文档: [README.zh-CN.md](./README.zh-CN.md)
69

7-
[中文文档(Chinese README)](./README.zh-CN.md)
10+
## Why react-virtualized-diff
811

9-
---
12+
Most diff components are smooth for small files, but degrade heavily with 10k+ lines.
1013

11-
## Why this project
14+
`react-virtualized-diff` is built for:
1215

13-
Most diff viewers are good for small files but become slow when input grows to tens of thousands of lines.
14-
15-
`react-virtualized-diff` focuses on:
16-
17-
- **Performance first** rendering with virtualization
18-
- **Readable side-by-side UI** for code/text review
19-
- **Configurable context lines** around changes
20-
- **TypeScript support** for reliable integration
21-
- **Simple React API** for quick adoption
22-
23-
---
24-
25-
## Features
26-
27-
- ✅ Side-by-side diff layout
28-
- ✅ Virtualized row rendering (good for large files)
29-
- ✅ Collapsed unchanged blocks with configurable context
30-
- ✅ Lightweight integration in React apps
31-
- ✅ TypeScript declarations out of the box
32-
33-
---
16+
- **Virtualized rendering** for big-file performance
17+
- **Side-by-side layout** for easy review
18+
- **Collapsed unchanged blocks** with configurable context
19+
- **TypeScript support** for predictable integration
3420

3521
## Installation
3622

3723
```bash
38-
# pnpm
3924
pnpm add react-virtualized-diff
40-
41-
# npm
42-
npm install react-virtualized-diff
43-
44-
# yarn
45-
yarn add react-virtualized-diff
25+
# or npm i react-virtualized-diff
26+
# or yarn add react-virtualized-diff
4627
```
4728

48-
---
49-
50-
## Quick start
29+
## Quick Start
5130

5231
```tsx
5332
import { DiffViewer } from 'react-virtualized-diff';
5433

55-
const oldText = `line 1\nline 2\nline 3`;
56-
const newText = `line 1\nline 2 changed\nline 3\nline 4`;
34+
const original = `line 1\nline 2\nline 3`;
35+
const modified = `line 1\nline 2 changed\nline 3\nline 4`;
5736

58-
export function Example() {
37+
export function App() {
5938
return (
6039
<DiffViewer
61-
original={oldText}
62-
modified={newText}
40+
original={original}
41+
modified={modified}
6342
contextLines={2}
6443
height={480}
6544
/>
6645
);
6746
}
6847
```
6948

70-
---
49+
## API
7150

72-
## API (current)
51+
### `DiffViewer`
7352

74-
### `DiffViewer` props
53+
| Prop | Type | Default | Description |
54+
| --- | --- | --- | --- |
55+
| `original` | `string` | - | Original text content |
56+
| `modified` | `string` | - | Modified text content |
57+
| `contextLines` | `number` | `2` | Number of unchanged lines kept around diff hunks |
58+
| `height` | `number \| string` | `500` | Viewport height of the virtual list |
59+
| `locale` | `DiffViewerLocale` | - | UI text localization |
60+
| `language` | `string` | - | Reserved field for future language-related extensions |
7561

76-
- `original: string` – original text content
77-
- `modified: string` – modified text content
78-
- `contextLines?: number` – unchanged lines to keep around changes (default behavior from component)
79-
- `height?: number | string` – viewport height for virtualization container
62+
### `DiffViewerLocale`
8063

81-
> Tip: for best performance with huge files, keep rendering area constrained with a fixed `height`.
64+
| Field | Type | Description |
65+
| --- | --- | --- |
66+
| `collapse` | `string` | Label for collapse button |
67+
| `showMoreLines` | `(count: number) => string` | Label factory for “show hidden lines” |
8268

83-
---
69+
## Benchmark
8470

85-
## Benchmark suite
71+
Included benchmark compares:
8672

87-
A runnable benchmark harness is included to compare:
88-
89-
- `react-virtualized-diff` (this project)
73+
- `react-virtualized-diff`
9074
- `react-diff-viewer`
9175
- `react-diff-viewer-continued`
9276
- `react-diff-view`
9377

94-
Metrics collected for each dataset size (`1k / 10k / 50k / 100k` lines):
78+
Dataset sizes: `1k / 10k / 50k / 100k` lines.
79+
80+
Metrics:
9581

96-
- FPS (average during auto-scroll)
97-
- Initial render time (ms)
98-
- Memory usage (`usedJSHeapSize` in Chromium)
99-
- Per benchmark case timeout: `60000 ms` (timeout cases are recorded in results instead of failing the run)
82+
- FPS (during auto-scroll)
83+
- initial render time
84+
- memory usage (`usedJSHeapSize`)
10085

101-
Quick result highlights (from the latest run):
86+
Quick highlights from latest report:
10287

103-
- At **10k lines**, `react-virtualized-diff` keeps ~**60 FPS**, with **187.2 ms** initial render and **9.5 MB** memory.
104-
- At **50k/100k lines**, `react-diff-viewer` and `react-diff-viewer-continued` hit timeout, while this project finishes both cases.
105-
- At **100k lines**, this project uses **141.1 MB** memory vs `react-diff-view` at **1297.0 MB** (~9.2x lower), and keeps **60.4 FPS** vs **5.6 FPS**.
88+
- At `10k` lines: ~`60 FPS`, `187.2 ms` initial render, `9.5 MB` memory.
89+
- At `50k/100k` lines: `react-diff-viewer` and `react-diff-viewer-continued` timeout.
90+
- At `100k` lines: `141.1 MB` (`react-virtualized-diff`) vs `1297.0 MB` (`react-diff-view`).
10691

107-
Run:
92+
Run benchmark:
10893

10994
```bash
11095
pnpm install
11196
pnpm benchmark
11297
```
11398

114-
> If Playwright Chromium is missing, the script will auto-run `pnpm exec playwright install chromium` once.
115-
116-
> `react-diff-viewer-continued` is optional in the benchmark app. If missing locally, benchmark falls back to `react-diff-viewer` for that case.
117-
118-
Output files:
119-
120-
- `benchmark-results/results.json`
121-
- `benchmark-results/results.md`
122-
123-
➡️ See detailed benchmark table: [benchmark-results/results.md](./benchmark-results/results.md)
124-
125-
## Monorepo structure
126-
127-
```text
128-
apps/demo/ # Vite demo app
129-
packages/react/ # npm package: react-virtualized-diff
130-
```
131-
132-
---
99+
## Demo
133100

134-
## Local development
101+
- Hosted demo page: https://www.zhangjiahang.com/react-virtualized-diff
102+
- Local demo:
135103

136104
```bash
137105
pnpm install
138-
pnpm dev # run demo app
139-
pnpm build # build workspace packages
106+
pnpm dev
140107
```
141108

142-
---
143-
144-
## npm package README support
145-
146-
To ensure npm users always see correct documentation:
147-
148-
- Package-level README is maintained at `packages/react/README.md`
149-
- `packages/react/package.json` includes README in publish files
150-
- Root README links to the package docs and Chinese docs
151-
152-
---
153-
154-
## Release log
109+
## Monorepo Structure
155110

156-
See [CHANGELOG.md](./CHANGELOG.md) for tracked releases and supported capabilities.
157-
158-
---
159-
160-
## Future plan
161-
162-
### Near-term roadmap
163-
164-
- [ ] Optional syntax highlighting (performance-aware)
165-
- [ ] More comprehensive live demo scenarios (big files, mixed edits)
166-
- [ ] Public hosted demo site for quick evaluation
167-
- [ ] Better customization hooks (line renderers, gutters)
168-
169-
### Additional TODOs to make this project more popular
111+
```text
112+
apps/demo/ # Vite demo app
113+
apps/benchmark/ # benchmark app
114+
packages/react/ # npm package source
115+
```
170116

171-
- [x] Detailed benchmark report vs common diff viewers
172-
- [ ] Keyboard navigation + accessibility improvements
173-
- [ ] Dark/light theme presets and design tokens
174-
- [ ] SSR usage guide (Next.js / Remix examples)
175-
- [ ] More real-world examples (JSON, logs, markdown, code)
176-
- [ ] CI release automation + semantic versioning workflow
177-
- [ ] Contribution guide and issue templates
178-
- [ ] International docs beyond English/Chinese
117+
## Changelog
179118

180-
---
119+
See [CHANGELOG.md](./CHANGELOG.md).
181120

182121
## License
183122

0 commit comments

Comments
 (0)