Skip to content

Commit 7ea8a3b

Browse files
Add comprehensive documentation for debugging, performance, and multi-stage pipelines in ComputeKit
- Introduced a detailed guide on debugging worker code, including error handling, Chrome DevTools integration, and common issues. - Added performance optimization strategies focusing on data transfer methods, including structured cloning, transferable objects, and SharedArrayBuffer. - Documented the use of multi-stage pipelines for complex workflows, including examples of stage configuration, input/output transformation, and error handling. - Enhanced the user experience with progress tracking, metrics, and execution reports for pipelines.
1 parent 4e22a11 commit 7ea8a3b

12 files changed

Lines changed: 3012 additions & 20 deletions

File tree

docs/debugging.md

Lines changed: 461 additions & 0 deletions
Large diffs are not rendered by default.

docs/getting-started.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ module.exports = {
200200
## Next Steps
201201

202202
- Learn about [React Hooks]({{ site.baseurl }}/react-hooks) for the full React experience
203+
- Read the [Debugging Guide]({{ site.baseurl }}/debugging) for troubleshooting tips
204+
- Understand [Performance & Data Transfer]({{ site.baseurl }}/performance) to optimize payloads
203205
- Check the [API Reference]({{ site.baseurl }}/api-reference) for all available methods
204206
- Explore [WASM integration]({{ site.baseurl }}/wasm) for maximum performance
205207
- See [Examples]({{ site.baseurl }}/examples) for real-world use cases

docs/index.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,33 @@ Run heavy computations with React hooks. Use WASM for native-speed performance.
2727

2828
## ✨ Features
2929

30-
| Feature | Description |
31-
| :----------------------- | :----------------------------------------------------------------------------- |
32-
| ⚛️ **React-first** | Purpose-built hooks like `useCompute` with loading, error, and progress states |
33-
| 🦀 **WASM integration** | Load and call AssemblyScript/Rust WASM modules with zero boilerplate |
34-
| 🚀 **Non-blocking** | Everything runs in Web Workers, keeping your UI at 60fps |
35-
| 🔧 **Zero config** | No manual worker files, postMessage handlers, or WASM glue code |
36-
| 📦 **Tiny** | Core library is ~3KB gzipped |
37-
| 🎯 **TypeScript** | Full type safety for your compute functions and WASM bindings |
38-
| 🔄 **Worker pool** | Automatic load balancing across CPU cores |
39-
| 📊 **Progress tracking** | Built-in progress reporting for long-running tasks |
30+
| Feature | Description |
31+
| :--------------------------- | :----------------------------------------------------------------------------- |
32+
| ⚛️ **React-first** | Purpose-built hooks like `useCompute` with loading, error, and progress states |
33+
| 🦀 **WASM integration** | Load and call AssemblyScript/Rust WASM modules with zero boilerplate |
34+
| 🚀 **Non-blocking** | Everything runs in Web Workers, keeping your UI at 60fps |
35+
| 🔧 **Zero config** | No manual worker files, postMessage handlers, or WASM glue code |
36+
| 📦 **Tiny** | Core library is ~3KB gzipped |
37+
| 🎯 **TypeScript** | Full type safety for your compute functions and WASM bindings |
38+
| 🔄 **Worker pool** | Automatic load balancing across CPU cores |
39+
| 📊 **Progress tracking** | Built-in progress reporting for long-running tasks |
40+
| 🔗 **Multi-stage pipelines** | Chain compute operations with `usePipeline` for complex workflows |
4041

4142
---
4243

4344
## 🤔 Why ComputeKit?
4445

4546
You _can_ use Web Workers and WASM without a library. But here's the reality:
4647

47-
| Task | Without ComputeKit | With ComputeKit |
48-
| ----------------- | ------------------------------------------------------------------- | ---------------------------------- |
49-
| Web Worker setup | Create separate `.js` files, handle `postMessage`, manage callbacks | `kit.register('fn', myFunc)` |
50-
| WASM loading | Fetch, instantiate, memory management, glue code | `await loadWasmModule('/my.wasm')` |
51-
| React integration | Manual state, effects, cleanup, abort handling | `useCompute()` hook |
52-
| Worker pooling | Build your own pool, queue, and load balancer | Built-in |
53-
| TypeScript | Tricky worker typing, no WASM types | Full type inference |
54-
| Error handling | Try-catch across message boundaries | Automatic with React error states |
48+
| Task | Without ComputeKit | With ComputeKit |
49+
| --------------------- | ------------------------------------------------------------------- | ---------------------------------- |
50+
| Web Worker setup | Create separate `.js` files, handle `postMessage`, manage callbacks | `kit.register('fn', myFunc)` |
51+
| WASM loading | Fetch, instantiate, memory management, glue code | `await loadWasmModule('/my.wasm')` |
52+
| React integration | Manual state, effects, cleanup, abort handling | `useCompute()` hook |
53+
| Worker pooling | Build your own pool, queue, and load balancer | Built-in |
54+
| Multi-stage workflows | Manual chaining, error handling per stage, retry logic | `usePipeline()` hook |
55+
| TypeScript | Tricky worker typing, no WASM types | Full type inference |
56+
| Error handling | Try-catch across message boundaries | Automatic with React error states |
5557

5658
**ComputeKit's unique value:** The only library that combines **React hooks + WASM + Worker pool** into one cohesive, type-safe developer experience.
5759

@@ -67,6 +69,7 @@ You _can_ use Web Workers and WASM without a library. But here's the reality:
6769
| Parsing large files | String formatting |
6870
| Cryptographic operations | UI state management |
6971
| Real-time data analysis | Small form validations |
72+
| Multi-file processing pipelines | Simple single-step tasks |
7073

7174
---
7275

@@ -170,6 +173,9 @@ function Calculator() {
170173

171174
- [Getting Started Guide]({{ site.baseurl }}/getting-started)
172175
- [React Hooks Reference]({{ site.baseurl }}/react-hooks)
176+
- [Multi-Stage Pipelines]({{ site.baseurl }}/pipeline)
177+
- [Debugging Guide]({{ site.baseurl }}/debugging)
178+
- [Performance & Data Transfer]({{ site.baseurl }}/performance)
173179
- [API Reference]({{ site.baseurl }}/api-reference)
174180
- [WASM Guide]({{ site.baseurl }}/wasm)
175181
- [Examples]({{ site.baseurl }}/examples)

0 commit comments

Comments
 (0)