workbench

package
v4.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package workbench turns component examples ("stories") into headless smoke tests — the stories-as-tests half of the gwc workbench (FB5). A Story is a named example that renders a component; RunStories mounts each through the real reconciler into a mock DOM and reports any panic or render failure, so a component gallery doubles as a browserless test suite that runs under plain `go test`. The visual workbench gallery is a separate GUI consumer of the same Story list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunStories

func RunStories(parseT TestingT, parseStories ...Story)

RunStories renders every story through the native runtime into a mock DOM, reporting (via Errorf, so the run continues) any story that panics, renders a nil node, or fails to mount. It is the documented headless default: no browser, no harness, just `go test`.

Types

type Story

type Story struct {
	// Name identifies the story in failures and the gallery.
	Name string
	// Render produces the component tree to mount.
	Render func() ui.Node
}

Story is one named component example.

type TestingT

type TestingT interface {
	Helper()
	Errorf(parseFormat string, parseArgs ...any)
}

TestingT is the slice of *testing.T that RunStories needs, so it can be driven by a test or any compatible reporter. *testing.T satisfies it.

Directories

Path Synopsis
Package fixtures ships first-class workbench stories for the framework's boundary components — async/suspense, error, and hydration boundaries — the stated reason for the workbench (FB5/D1).
Package fixtures ships first-class workbench stories for the framework's boundary components — async/suspense, error, and hydration boundaries — the stated reason for the workbench (FB5/D1).
Package gallery renders a component workbench as a GoWebComponents component — the visual half of gwc workbench (FB5).
Package gallery renders a component workbench as a GoWebComponents component — the visual half of gwc workbench (FB5).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL