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) }Right
html
<!-- menu.vuka.html -->
<script lang="go">
package app
type Menu struct {
open ui.State[bool]
}
</script>
<button onClick={open = !open}>Menu</button>