Files
iris/CLAUDE.md
Hugo Nijhuis 00d98879d3
Some checks failed
CI / build (push) Failing after 36s
Initial iris repository structure
WASM reactive UI framework for Go:
- reactive/ - Signal[T], Effect, Runtime
- ui/ - Button, Text, Input, View, Canvas, SVG components
- navigation/ - Router, guards, history management
- auth/ - OIDC client for WASM applications
- host/ - Static file server

Extracted from arcadia as open-source component.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 19:23:49 +01:00

2.1 KiB

Iris

WASM reactive UI framework for Go.

Organization Context

This repo is part of Flowmade. See:

Setup

git clone git@git.flowmade.one:flowmade-one/iris.git
cd iris

Project Structure

iris/
├── reactive/      # Signal[T], Effect, Runtime - core reactivity
├── ui/            # Components: Button, Text, Input, View, Canvas, SVG
├── navigation/    # Router, guards, history management
├── auth/          # OIDC client for WASM applications
├── host/          # Static file server for WASM apps
└── internal/      # Internal element abstraction

Development

# Build (WASM target)
GOOS=js GOARCH=wasm go build ./...

# Build host server (native)
go build ./host/...

# Test
go test ./...

# Lint
golangci-lint run

Architecture

Reactivity Model

Iris uses a signals-based reactivity model:

// Create a signal
count := reactive.NewSignal(0)

// Read value
fmt.Println(count.Get())

// Update value - triggers dependent effects
count.Set(count.Get() + 1)

// Create derived state
doubled := reactive.Computed(func() int {
    return count.Get() * 2
})

Components

All UI components implement a common interface and render to DOM elements:

// Create a button
btn := ui.Button("Click me", func() {
    count.Set(count.Get() + 1)
})

// Create reactive text
text := ui.Text(func() string {
    return fmt.Sprintf("Count: %d", count.Get())
})

Routing

Client-side routing with guards:

router := navigation.NewRouter()
router.Route("/", homeView)
router.Route("/users/:id", userView)
router.Guard("/admin/*", authGuard)

Key Patterns

  • No virtual DOM - Direct DOM manipulation via syscall/js
  • Signals propagate - Changes flow through the dependency graph
  • Components are functions - Return DOM elements, not component instances
  • WASM-only UI code - Use build tags for browser-specific code