Skip to content

W0105: A hand-written use of uigen ​

Package github.com/vuka-lang/ui/v2/uigen is what the compiler writes for a .vuka.html file: a state's reads (uigen.Not(open)), its writes (uigen.Toggle(ui.JS, open)), a struct's tracked server state (uigen.Assign[int]). It is public so generated code builds with go build, but its names follow the compiler, and code written by hand belongs in the .vuka.html form. Generated files (// Code generated … DO NOT EDIT.) aren't reported.

Wrong ​

go
// menu.go
func (m *Menu) toggle() ui.Commands { return uigen.Toggle(ui.JS, m.open) }
html
<!-- menu.vuka.html -->
<script lang="go">
package app

type Menu struct {
	open ui.State[bool]
}
</script>

<button onClick={open = !open}>Menu</button>

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.