GX Framework
Source files
A .gx file stays inside a Go package and lets you author component
markup in the same place you define the component types and helper functions.
What a source file carries
GX keeps imports, types, functions, and control flow in ordinary Go form. The markup lowers into generated Go in the same package, so the authored file and the compiled root stay close together in review.
package notesui
import "github.com/busdk/bus-gx/pkg/gx"
func NoteTitle(title string) gx.Node {
return <h2 class="note-title">{title}</h2>
}
Tooling flow
bus gx fmt --check file.gx | Checks canonical source formatting. |
|---|---|
bus gx lint --format json file.gx | Reports source diagnostics without writing output. |
bus gx compile file.gx --output file.go | Writes compiled Go roots for the package. |
The compiled output is described in Generated Go.