Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
94f4e31
feat: Add WebGPU DSL support to Guix language
claude Nov 29, 2025
d6e647d
feat: Implement full WebGPU DSL integration for .gx files
claude Nov 29, 2025
35d2f48
feat: Add WebGPU Scene component DSL support with comprehensive tests
claude Nov 29, 2025
c82125a
fix: Fix receiver reference bug and syscall/js import for Scene compo…
claude Nov 29, 2025
4b68196
chore: Remove outdated TODO comment (bug is fixed)
claude Nov 29, 2025
0a31c31
chore: Format code with gofmt (remove trailing blank lines)
claude Nov 29, 2025
8943212
feat: Add declarative Canvas component for WebGPU integration
claude Nov 29, 2025
75ab982
refactor: Change Scene from prop to child element using GPUScene wrapper
claude Nov 29, 2025
0141aea
feat: Implement channel-based reactive controls for WebGPU cube
claude Nov 29, 2025
196f1ab
fix: Fix codegen to properly handle component params in channel sends
claude Nov 29, 2025
b648fd5
fix: Apply component parameter conversion only to channel sends
claude Nov 29, 2025
157fda3
feat: Add keyboard event support and refactor WebGPU cube to Guix pat…
claude Nov 29, 2025
9b6da3d
fix: Clear componentParams when generating regular functions
claude Nov 29, 2025
3316275
test: Update E2E tests to match refactored implementation
claude Nov 29, 2025
5355bad
fix: Remove duplicate ID in AppWithControls Render method
claude Nov 29, 2025
d2b0c5a
test: Reduce E2E test timeouts from 30s to 5s
claude Nov 29, 2025
6b06f0d
debug: Add comprehensive logging to webgpu-cube initialization
claude Nov 29, 2025
b4797ad
fix: Use console.Call for WASM logging in webgpu-cube
claude Nov 29, 2025
92939e8
fix: Add TabIndex to runtimeFunctions map in codegen
claude Nov 30, 2025
6185464
refactor: Use declarative component composition for webgpu-cube
claude Nov 30, 2025
bc2d905
feat: Add if/else conditional rendering support to Guix
claude Nov 30, 2025
3317745
feat: Add reactive state feedback to Controls component
claude Nov 30, 2025
b1e042a
fix: Only generate channel listeners for channels that are received from
claude Nov 30, 2025
b8b1588
feat: Add conditional rendering for speed control and improve type in…
claude Nov 30, 2025
54c57df
fix: Correct channel receive variable handling in code generation
claude Dec 1, 2025
adbb790
fix: Support both inline and explicit channel receives
claude Dec 1, 2025
756d523
chore: Update regenerated example binaries
claude Dec 1, 2025
1a46b8b
fix: Correct channel receive variable handling in code generation
claude Dec 1, 2025
ca06755
feat: Add Magefile for pre-commit automation
claude Dec 1, 2025
2d6917c
fix: Only generate automatic channel fields for inline receives
claude Dec 1, 2025
36ae013
feat: Add goroutine support to Guix (useEffect-like)
claude Dec 1, 2025
e269df2
feat: Add switch/select statement support and move helper to Guix
claude Dec 1, 2025
bd8e648
fix: Move goroutine execution to constructor to prevent deadlock
claude Dec 1, 2025
de841e7
debug: Add comprehensive channel and state logging
claude Dec 1, 2025
4ed58a9
fix: Update event handlers during DOM patches
claude Dec 2, 2025
5944879
fix: Don't update event handlers during patches
claude Dec 2, 2025
3c99d04
test: Add cache-busting to ensure fresh WASM loads between tests
claude Dec 2, 2025
1521fa8
fix: Replace cache-busting with hard reload in WebGPU tests
claude Dec 2, 2025
abcd1a2
fix: Remove always-true nil checks in generateStatement calls
claude Dec 2, 2025
a200532
test: Add console logging to all WebGPU cube tests
claude Dec 2, 2025
4b5d7bc
fix: Remove unused isChannelReceiveFrom function
claude Dec 2, 2025
5ec443c
fix: Check DOM presence instead of display style for speed control
claude Dec 2, 2025
481e8a8
style: Add comprehensive CSS styling for WebGPU cube controls
claude Dec 2, 2025
ce6c5f1
refactor: Remove keyboard event handling from WebGPU cube example
claude Dec 2, 2025
f56e5b0
feat: Add struct receiver support and auto-generated logging
claude Dec 2, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ go.work
*.wasm
wasm_exec.js
main.wasm
examples/*/calculator
examples/*/counter
examples/*/webgpu-cube

# Cache
.guix/
Expand Down
46 changes: 39 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,27 @@ This document contains guidelines and rules for Claude when working on the Guix

## Pre-Commit Requirements

Before committing any changes, Claude must ensure the following checks pass:
Before committing any changes, Claude must ensure the following checks pass.

### 1. Code Formatting
### Using Mage (Recommended)

The easiest way to run all pre-commit checks is using Mage:

```bash
# Run all pre-commit checks (format, vet, test, build)
go run github.com/magefile/mage@latest

# Or if mage is installed locally
mage
```

This will automatically run all the checks below in the correct order.

### Manual Pre-Commit Checks

If you prefer to run checks manually:

#### 1. Code Formatting

All Go files must be formatted with `gofmt`:

Expand All @@ -16,15 +34,15 @@ gofmt -w .

This ensures consistent code style across the entire codebase.

### 2. Linting
#### 2. Linting

Run `go vet` to catch common Go mistakes:

```bash
go vet ./...
```

### 3. Testing
#### 3. Testing

Run all tests to ensure no regressions:

Expand All @@ -34,7 +52,7 @@ go test ./...

All tests must pass before committing.

### 4. Build Verification
#### 4. Build Verification

Verify the code compiles for both native and WASM targets:

Expand All @@ -46,9 +64,23 @@ go build ./...
GOOS=js GOARCH=wasm go build ./pkg/runtime/...
```

## Complete Pre-Commit Checklist
## Available Mage Targets

The following Mage targets are available:

- `mage` or `mage preCommit` - Run all pre-commit checks (default)
- `mage format` - Format all Go files
- `mage vet` - Run go vet
- `mage test` - Run all tests
- `mage build` - Build all packages
- `mage buildWasm` - Build WASM runtime
- `mage generate` - Regenerate all example code
- `mage clean` - Remove build artifacts
- `mage ci` - Run all CI checks

## Complete Pre-Commit Checklist (Manual)

Run these commands before every commit:
If not using Mage, run these commands before every commit:

```bash
# Format all Go files
Expand Down
Binary file added calculator
Binary file not shown.
Binary file added counter
Binary file not shown.
44 changes: 22 additions & 22 deletions examples/calculator/calculator_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions examples/counter/counter_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build js && wasm
// +build js,wasm

package main

import (
Expand Down
56 changes: 56 additions & 0 deletions examples/webgpu-cube/app.gx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package main

import "fmt"

func App() (Component) {
rotationX := 0.0
rotationY := 0.0
autoRotate := true
speed := 1.0
commands := make(chan ControlCommand, 10)
controlState := make(chan ControlState, 10)

go func() {
state := ControlState{AutoRotate: autoRotate, Speed: float32(speed)}
log(fmt.Sprintf("[App] Sending initial state: %s", state.String()))
controlState <- state
}()

go func() {
for cmd := range commands {
log(fmt.Sprintf("[App] Received command: %s", cmd.String()))

switch cmd.Type {
case "rotX":
rotationX += float64(cmd.Value)
case "rotY":
rotationY += float64(cmd.Value)
case "autoRotate":
autoRotate = !autoRotate
case "speed":
speed = float64(cmd.Value)
}

state := ControlState{AutoRotate: autoRotate, Speed: float32(speed)}
select {
case controlState <- state:
log(fmt.Sprintf("[App] Sent state update: %s", state.String()))
default:
log("[App] Channel full, skipping state update")
}
}
}()

Div(
Class("webgpu-container")
) {
Canvas(
ID("webgpu-canvas"),
Width(600),
Height(400)
) {
GPUScene(NewCubeScene(float32(rotationX), float32(rotationY)))
}
Controls(WithCommands(commands), WithState(controlState))
}
}
82 changes: 82 additions & 0 deletions examples/webgpu-cube/app_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading