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
2 changes: 2 additions & 0 deletions content/docs/throughline/accessibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Accessibility and interaction
description: Player keyboard support, screen-reader descriptions, captions, inspector, reduced motion, and sound.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

Throughline does not rely on the visualization alone to communicate a trace. Its React player supplies semantic controls and textual summaries of each frame.

## Screen-reader experience
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: How Throughline works
description: Learn how Throughline validates, compiles, and renders traces.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

Throughline has two independent layers: a **React-free compiler** and an optional **React 19 player**. The root package can compile traces without a browser, account, backend, or network connection.

## Compilation
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/binary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Binary addition
description: Visualize unsigned ripple-carry addition one bit at a time.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

The `binary` domain generates a trace for **unsigned binary addition**. Each step handles one column, starting at the least significant bit (rightmost position), and exposes the outgoing carry.

## Input
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/bindings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Bindings and references
description: Explain primitive assignments, heap references, shared mutations, and rebinding with the bindings domain.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

The `bindings` domain visualizes a **small, intentionally restricted assignment language**. It shows variable slots in a **Stack** lane and arrays/objects in a **Heap** lane. Use it to explain the difference between copying a primitive and copying a reference.

It is not a JavaScript interpreter: it supports only declarations, assignments, and array `push`. Expressions, property access, branching, and arbitrary method calls are not supported.
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/callstack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Call stack and recursion
description: Understand factorial recursion through explicit call, return, and completion steps.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

The `callstack` domain models a **single factorial recursion**. It shows how frames are pushed while calls descend, and how return values accumulate as the stack unwinds.

## Input
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/compatibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Compatibility and upgrading
description: Use the right runtime versions, interpret trace schema versions, upgrade safely, and troubleshoot compatibility.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

These guides describe **`@0xbuff/throughline@0.0.2`**, published November 8, 2026. This page helps applications choose a compatible environment and upgrade without changing trace behavior unexpectedly.

## Installation and requirements
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/concepts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Core concepts
description: Learn how Throughline turns source text into steps and complete state snapshots.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

Throughline separates the trace you write from the frames it produces. This makes the result predictable and lets a player move directly to any step.

## From source to frames
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/custom-traces.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Create visualizations with TypeScript
description: Use the public TypeScript API to show how your own algorithms and systems change.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

The five built-in `thl` domains cover common teaching scenarios. For any other algorithm or workflow, use **`tracer()`** to construct a Program from ordinary TypeScript, then compile it into a Trace. This is a **public consumer API**: you do not need to modify Throughline, add package source files, or register anything.

Choose this approach when your product already knows the values and you want to decide which intermediate steps learners should see. Throughline does **not** instrument or execute arbitrary JavaScript statements from a `thl` fence.
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/errors-and-limits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Troubleshooting and limits
description: Understand input errors, validation failures, and compilation limits.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

Throughline validates authored and generated programs before returning snapshots. It throws `ProgramError` for known compilation failures. The package intentionally rejects invalid or unbounded input instead of attempting to recover silently.

## Catch source diagnostics
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/flow.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Create flow visualizations
description: Write a sequence of steps that shows how values, connections, and visibility change.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

`flow` is the hand-authored domain. Use it when the explanation is a sequence of explicit state changes rather than a built-in computation.

## Complete example
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/frameworks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Framework and runtime support
description: Use Throughline with React, Next.js, React Router, Astro, Node.js, and other runtimes.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

The compiler is a standalone ESM package. The official visual player requires **React 19** and its separately imported CSS.

## Choose your environment
Expand Down
6 changes: 4 additions & 2 deletions content/docs/throughline/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Getting started
description: Install Throughline, create your first visualization, and display it in React.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

This guide starts with the standalone compiler. You can add the React player afterward.

## Before you begin
Expand All @@ -12,10 +14,10 @@ Use an ESM project and **Node.js 24 or newer** for Node-based execution. React i
## 1. Install Throughline

~~~sh
npm install @0xbuff/throughline
npm install @0xbuff/throughline@0.0.2
~~~

For a reproducible setup, pin `@0xbuff/throughline@0.0.2` and commit your package lockfile.
Keep this exact version and commit your package lockfile so the examples match the installed API.

## 2. Compile a trace

Expand Down
4 changes: 3 additions & 1 deletion content/docs/throughline/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ description: Create step-by-step visualizations with Throughline. Find setup gui
icon: Play
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

Throughline turns a short description of state changes into a sequence of frames you can inspect or play back. Write a `thl` block in Markdown, compile it with TypeScript, and optionally display it with the React player.

Use it to explain algorithms, data structures, recursion, and system workflows. Throughline **does not run the code being explained**; you describe the changes you want to show.
Expand All @@ -19,7 +21,7 @@ This checkout scenario follows a lost provider reply, an unknown payment outcome
Install the package:

~~~sh
npm install @0xbuff/throughline
npm install @0xbuff/throughline@0.0.2
~~~

Compile a trace:
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Use Throughline in applications
description: Compile visualizations at build time or runtime and display them in your application.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

Throughline compiles **one trace block at a time**. Your host application decides where blocks come from and how to display the results.

## Choose an approach
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/markdown-mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Markdown and MDX
description: Validate Throughline code blocks and show interactive traces in Markdown-based content.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

Throughline compiles **one `thl` block at a time**. Your Markdown or MDX host must recognize those blocks and decide how to render them. Without an integration, a `thl` fence remains a normal code block.

## Write a trace in Markdown
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/matrix.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Matrix multiplication
description: Follow rows, columns, partial products, and result cells in the matrix domain.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

The `matrix` domain explains ordinary **matrix multiplication**, one output cell at a time. Its steps are deterministic and computed from the two supplied numeric grids.

## Input
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/programmatic-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: API reference
description: Find the public imports, compilation functions, data types, and helper functions.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

This page documents the exported TypeScript API of **`@0xbuff/throughline@0.0.2`**. Names listed here are exported from supported package entry points, not private source modules.

## Public package entry points
Expand Down
4 changes: 3 additions & 1 deletion content/docs/throughline/react-player.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ title: React player
description: Render compiled traces with controls, captions, keyboard navigation, and optional sound.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

`ThroughlinePlayer` displays a compiled `Trace` in React 19. The compiler works without React; import the player only when you need the interactive visualization.

## Install and render

~~~sh
npm install @0xbuff/throughline react@^19 react-dom@^19
npm install @0xbuff/throughline@0.0.2 react@^19 react-dom@^19
~~~

~~~tsx
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/recipes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Worked examples and recipes
description: Copyable flow traces and a programmatic TypeScript tracer example for teaching state changes.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

These examples demonstrate the five-domain model without claiming to execute the algorithms or systems being explained. Each block is valid input to `compile()`. Use the [Flow reference](/docs/throughline/flow) when editing event syntax.

## Recipe 1: a queue receiving and consuming items
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/styling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Styling and themes
description: Set light or dark mode and customize the React player with CSS properties.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

The optional React player ships its own stylesheet. It does not require Tailwind, a theme provider, or a CSS-in-JS library.

## Import the stylesheet
Expand Down
2 changes: 2 additions & 0 deletions content/docs/throughline/type-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Type reference
description: Look up public TypeScript types, event shapes, and exports for version 0.0.2.
---

**Version scope — v0.0.2 (historical schema 1).** This page and its examples use `@0xbuff/throughline@0.0.2`, the version pinned by this documentation app. They do not describe the unreleased schema-2 API intended for v0.2.0. See [compatibility and upgrading](/docs/throughline/compatibility).

This reference covers the **publicly exported symbols** of `@0xbuff/throughline@0.0.2` and `@0xbuff/throughline/react`. It is a self-contained companion to [API usage](/docs/throughline/programmatic-api) and [Flow authoring](/docs/throughline/flow).

## Supported import paths
Expand Down
16 changes: 16 additions & 0 deletions scripts/throughline-docs.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,19 @@ test("Throughline public docs exclude package-contribution procedures", () => {
);
}
});


test("Historical Throughline articles match the pinned schema-1 package", async () => {
const manifest = JSON.parse(await readFile(new URL("../package.json", import.meta.url), "utf8"));
assert.equal(manifest.dependencies["@0xbuff/throughline"], "0.0.2");
for (const [name, doc] of content) {
assert.match(doc, /Version scope — v0\.0\.2 \(historical schema 1\)/, name);
assert.match(doc, /@0xbuff\/throughline@0\.0\.2/, name);
assert.match(doc, /unreleased schema-2 API intended for v0\.2\.0/, name);
for (const line of doc.split("\n")) {
if (/\b(?:install|add)\b/.test(line) && /@0xbuff\/throughline(?:@|\s|$)/.test(line) && /^(?:npm|pnpm|yarn|bun)\s/.test(line.trim())) {
assert.match(line, /@0xbuff\/throughline@0\.0\.2(?=\s|$)/, name + ": mismatched install version");
}
}
}
});
Loading