Earlier quoted context omitted.
What is the benefit of writing Go to generate HTML? 1. With go-app func (h *hello) Render() app.UI { return app.Div().Body(app.Text(fmt.Sprintf("Hello %s", h.name))) } 2. Compared to using templ templ Hello(name string) { Hello, { name } } For me personally, the latter seems nicer - I can see at a glance the structure of the HTML - Completion on the HTML tags, attributes, etc - Completion on CSS (TailwindCSS LSP for…
In a previous version, I was using HTML, but it was written as strings. This allowed interaction with Go, but debugging was challenging since the Go compiler does not check the content inside strings, and no editor provides syntax highlighting for HTML embedded in a Go string. With the current approach, the compiler can validate the written code, making it easier to use other Go code and enabling auto-completion in e…
That looks really interesting. I'm curious, are there any performance drawbacks to updating DOM via WebAssembly or is it negligible? I.e. let's say you are building an editor of some kind. If the entire app is in Go, that means sending the keydown event to the WASM module and having it update HTML back. Is it not better (from performance perspective) to just use JavaScript all the way?