Reactive GoX example
Run make reactive from the repository root. The application combines reactive counters/batching, a controlled Unicode name input, a memo-backed conditional branch and keyed editable rows with add/remove/reorder controls.
Edit view.gox for the main layout, button, row and details components. app.go owns signal state, native window lifecycle and ui.For/Show factories. main.go starts the standalone host.
make gox-tools # install the checksum-pinned generator locally
make fmt-reactive # format .gox, generate .x.go and gofmt it
make generate-reactive # regenerate after a template edit
make check-reactive-generated # verify source format and generated Go
make reactive # build/run using checked-in generated Go
view.x.go is generated by GoX v0.3.3 and checked in; do not edit it manually. Normal Go/native builds need no GoX compiler. Generator installation needs network access once and uses .cache/gox/ afterward. go generate ./examples/reactiveapp runs the same generation/Go formatting steps after installing the tool.
The maintained directives live in generate.go. Both Make generation targets and the isolated checker execute go generate; the checker copies the directives and source rather than maintaining a separate compiler command. make generate-gox and make check-gox-generated include the smaller GoX counter too.
Use nativegox.Text(func() string { ... }) for reactive text and pass string signals directly to input value attributes. Plain GoX expressions run when a component is constructed. Conditional branches and keyed rows are built inside their supplied ownership scopes, preserving cleanup and native input identity when state changes.
The root template increments its build counter in its render-time setup block. The native scenario verifies one actual template execution, isolated bindings, batched updates, memo equality, branch cleanup and retained input ID/focus/selection after a visible row reorder.