Skip to content

E0330: An island page under @web.Live isn't live ​

@web.Live on an @ui.Island struct (in Go, web.Routes.Live(path, NewT, ui.Island())) makes a live page backed by its component, which needs ui.Live embedded. Without it the page is stateless, and @web.Get (web.Routes.Get) routes it. Reported at boot, and by vukavet.

Wrong ​

vuka
@web.Live("/orders")
@ui.Island
type Orders struct {
	Rows []Order
}
go
type Orders struct {
	Rows []Order
}

func NewOrders() *Orders { return &Orders{} }

func init() { web.Routes.Live("/orders", NewOrders, ui.Island()) }
vuka
@web.Live("/orders")
@ui.Island
type Orders struct {
	ui.Live
	Rows []Order
}
go
type Orders struct {
	ui.Live
	Rows []Order
}

func NewOrders() *Orders { return &Orders{} }

func (o *Orders) Render() ui.Node { return ui.IslandPage(o) }

func init() { web.Routes.Live("/orders", NewOrders, ui.Island()) }

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.