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.gxChecks canonical source formatting.
bus gx lint --format json file.gxReports source diagnostics without writing output.
bus gx compile file.gx --output file.goWrites compiled Go roots for the package.

The compiled output is described in Generated Go.