Skip to content

Repository files navigation

BareReplay

Project Logo

Time-travel replay debugger for BareBuild apps.

Clojars Project

Part of a set. BareDOM is a comprehensive web component library. BareBuild is a small runtime that drives web components from server state alone. BareReplay is a powerful time-travel replay debugger for BareBuild-based apps. BareProbe reads the same log from a REPL.

BareReplay records the BareBuild event log and reconstructs any past state by replaying the pure step, then re-projects it onto the live components. Drop it into a BareBuild app and you get a draggable dock that scrubs, steps, and jumps through everything the app has done, with the request and response behind each step.

Why it is small

Every BareBuild transition is a pure function step : Resource × Event → Resource × [Effect]. BareReplay leans on that. It stores each recorded event, and the state at any position is a fold of step over the events up to it. Nothing is cached and nothing mutates. A position is a value you derive by replaying, so the debugger is almost free.

Usage

Call init! before your BareBuild init, so the recorder is in place before the first event.

(ns your-app
  (:require [barereplay.init :as barereplay]
            [barebuild.core :as barebuild]))

(barereplay/init!)
(barebuild/init)

The dock mounts itself in the top-right corner. Move it by its handle, travel with the transport buttons or the timeline, and open the Data pane to see each step's request and response. The dock can be collapsed to its title bar.

Install

deps.edn:

com.github.avanelsas/barereplay {:mvn/version "0.4.0"}

About

BareReplay: Time-travel replay debugger for BareBuild apps. Records the event log, reconstructs any past state by replaying the pure step, and re-projects it onto live components. Built in CLJS.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages