Skip to content

E0323: Bad defer: tag ​

@ui.Defer("group") (or the tag defer: of earlier releases) leaves a field out of the first render; the loader of its group, the method marked @ui.Loads("group"), sends it after. A group is a Go name. A deferred field is the server's to load, so the component can't set it (@ui.Bind) and the URL can't fill it (@ui.URL). Reported by vuka vet, the editor, and at boot, and by vukavet.

Wrong ​

vuka
type Dashboard struct {
	ui.Live
	Stats []Stat @ui.Defer("the stats")
	Q     string @ui.Bind @ui.Defer("q")
}
vuka
type Dashboard struct {
	ui.Live
	Stats []Stat @ui.Defer("stats")
	Q     string @ui.Bind
}

@ui.Loads("stats")
func (d *Dashboard) loadStats(ctx context.Context) error { … }

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.