Documentation
¶
Overview ¶
Package compiler provides a compiler for GoSPA Single File Components (.gospa).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompileOptions ¶
type CompileOptions struct {
Type ComponentType
IslandID string
Name string
PkgName string
Hydrate bool
ServerOnly bool
}
CompileOptions configures the compilation of a .gospa component.
type ComponentType ¶
type ComponentType string
ComponentType represents the type of a compiled component.
const ( ComponentTypeIsland ComponentType = "island" ComponentTypePage ComponentType = "page" ComponentTypeLayout ComponentType = "layout" ComponentTypeStatic ComponentType = "static" ComponentTypeServer ComponentType = "server" )
Component type constants.
type GospaCompiler ¶
type GospaCompiler struct{}
GospaCompiler handles the compilation of .gospa files.
func (*GospaCompiler) Compile ¶
func (c *GospaCompiler) Compile(opts CompileOptions, input string) (templ, ts string, err error)
Compile compiles a .gospa component into Templ and TypeScript.
func (*GospaCompiler) CompileLegacy ¶
func (c *GospaCompiler) CompileLegacy(goName, islandID, input, pkgName string) (templ, ts string, err error)
CompileLegacy preserves the old island-only API.
Click to show internal directories.
Click to hide internal directories.