0xBUFF / docs

Compatibility and upgrading

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.

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

npm install @0xbuff/throughline@0.0.2

For the optional React player:

npm install react@^19 react-dom@^19
Requirementv0.0.2 support
Node.js24 or newer for Node-hosted tooling
JavaScript module formatESM; there is no CommonJS require() export
TypeScriptType declarations are included; no separate @types package
ReactReact 19 peer dependency, only if using the player
React DOMReact DOM 19 peer dependency, only if using the player
CSSImport the player CSS explicitly from the package export
Remote serviceNone required to compile or play traces

Core compilation works independently of React and DOM APIs. For a framework-specific setup, see Other products and frameworks.

The four supported imports

import { compile, tracer, compileProgram } from "@0xbuff/throughline";
import { ThroughlinePlayer } from "@0xbuff/throughline/react";
import { EXAMPLES } from "@0xbuff/throughline/examples";
import "@0xbuff/throughline/styles/throughline.css";

Only the first import is required for a compiler-only application. Other paths are public optional features. Deep imports into the published src or dist directories are unsupported.

Package version versus data schema

Versionv0.0.2 valueInterpretation
npm package0.0.2Installation and behavioral compatibility
Program.version1Input Program schema
Trace.version1Compiled snapshot schema

The package version and data schema versions are independent. A package update can alter controls, layout, or CSS behavior without changing the Trace schema number. The project is pre-1.0, so pin exact versions when you need reproducible learning materials.

Persisted trace data

import type { Trace } from "@0xbuff/throughline";

function readTrace(data: unknown): Trace {
  if (
    data === null ||
    typeof data !== "object" ||
    !("version" in data) ||
    data.version !== 1 ||
    !("frames" in data) ||
    !Array.isArray(data.frames)
  ) {
    throw new Error("Unsupported or malformed trace format");
  }

  // This is only a minimal compatibility check, not full schema validation.
  // Verify trust and shape at the host boundary before passing data to a player.
  return data as Trace;
}

This example checks the schema version and the existence of frames. It does not validate nested frame structures; treat remote or user-provided JSON as untrusted and validate it with your own schema before rendering. There is no published validateTrace export in v0.0.2. The safest path for editable content is to store the source and recompile it with the current version.

Upgrade checklist for an application

  1. Pin the desired version in package.json and commit the lockfile.
  2. Confirm your build/runtime meets the Node engine requirement.
  3. Run a compilation test for every shipped thl example.
  4. Compare important frame counts, labels, final values, and captions against your expected lessons.
  5. If using React, verify compatible peer versions, accessible controls, mobile layout, SSR, and styling.
  6. Review any overrides of .thl implementation selectors and the ten CSS variables.
  7. Check compatibility of saved Trace documents before feeding them to the player.

Use Errors and limits to diagnose source errors after upgrading.

Changes from v0.0.1 to v0.0.2

The initial 0.0.1 release introduced the five trace domains, deterministic Trace/Program schema 1, and optional React player. The 0.0.2 release refined package documentation and metadata; it did not introduce a sixth domain or a new public player prop. The compilation grammar and schema described across these pages apply to v0.0.2.

Common compatibility problems

SymptomCauseResolution
Engine error during installationNode 22 or older used for a Node-hosted appUpgrade Node to 24+
require() import failsPackage is ESM-onlyUse ESM import syntax
React peer warningsApp uses incompatible React versionsUse supported React/React DOM 19 peers
Unstyled visualizationPlayer stylesheet not importedImport @0xbuff/throughline/styles/throughline.css once
CSS override has no effectVariables placed on an ancestor instead of .thlTarget the player root; see CSS and theming
Trace playback restarts on parent renderPassing a freshly compiled Trace each timeKeep a stable Trace object or use useMemo
Old JSON trace behaves unexpectedlyPersisted schema shape or package behavior differsRecompile original source with the current package where possible

License and support for users

Throughline is licensed under Apache-2.0. The npm distribution includes the license text; when redistributing the software, comply with the applicable license and notice requirements. For bugs, use the public issue tracker. Use the guides here for installation, APIs, authoring, styling, and integration.

On this page