gomponents
htmlgo
gomponents | htmlgo | |
---|---|---|
8 | 3 | |
715 | 119 | |
5.6% | - | |
5.9 | 0.0 | |
3 days ago | almost 4 years ago | |
Go | Go | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
gomponents
-
Templ: A language for writing HTML user interfaces in Go
I'm really happy you like it. :) And thank you for your comment, I really appreciate newcomer viewpoints especially.
Have a look at the `Classes` helper component already available: https://github.com/maragudk/gomponents/blob/main/components/...
Yeah, I'm not a total fan of the runtime panics, but it was a tradeoff where I chose in favour of API simplicity and readability. In practice, it works out well, because you catch any typos at development time.
I've had elements and attributes in separate packages before, but then you can't dot-import both packages and not have name clashes, and have to either prefix elements or attributes with the package name, which makes the code much less readable. Again, a tradeoff. :)
-
Template Engine Recommendation
Gomponents:
-
HTML Templates | Why would you use them over react?
I now always use https://github.com/maragudk/gomponents for frontend components (I'm the author of that library) together with HTMX (https://github.com/maragudk/gomponents-htmx), and it's just so much more fun and fast to work with.
-
How to render html children inside nested templates
However, there is an alternative to achieve React-ish components in Go using this package: https://github.com/maragudk/gomponents
-
Daz: Composable HTML components in golang
reminds me of https://github.com/maragudk/gomponents
-
How painful is SSR with Go, really?
I’ve also started just rendering views from the Go backend. It’s so nice and simple when you don’t need an SPA (like in your case). I didn’t like the syntax of html/template though, so I started a small view component library. Maybe it would be useful to you too, wrote about it here: https://www.maragu.dk/blog/gomponents-declarative-view-components-in-go/
-
How I build web frontends in Go
Are you speaking of something like: gomponents? I can see what it has to offer. I tried it for half an hour but did not feel that well about it.
htmlgo
-
Templ: A language for writing HTML user interfaces in Go
Here are a couple:
https://github.com/julvo/htmlgo
https://github.com/rohanthewiz/element
I'm sure there are many more.
The thing about these is that performance is often not as good as when using templates, especially when the templates are compiled to native code. Quicktemplate [1] is still the leader here IMO, and I don't think the OP project brings much that couldn't be done pretty easily with QT.
[1] https://github.com/valyala/quicktemplate
-
That people produce HTML with string templates is telling us something
I just switched my project from open-coded SQL to goqu; inspired by this article, I searched for "golang html builder" and got this project:
https://github.com/julvo/htmlgo
Which definitely looks interesting.
-
Chaining methods in go with struct inheritance
Good suggestion. This is similar to htmlgo which is another library I looked at to get ideas https://github.com/julvo/htmlgo
What are some alternatives?
hyperscript - Create HyperText with JavaScript.
literal-html - Simple and unsafe HTML/XML templates for TypeScript, using tagged template literals
go-admin - A golang framework helps gopher to build a data visualization and admin panel in ten minutes
nano - 🎯 SSR first, lightweight 1kB JSX library.
vecty - Vecty lets you build responsive and dynamic web frontends in Go using WebAssembly, competing with modern web frameworks like React & VueJS.
vtpl - Vtpl is a php template engine that ensures proper separations of concerns, the frontend logic is separated from presentation. The goal is to keep the html unchanged for better maintainability for both backend and frontend developers
goview - Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application.
dream-html - Generate HTML markup from your OCaml Dream backend server
vugu - Vugu: A modern UI library for Go+WebAssembly (experimental)
gf - GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang.
templ - A language for writing HTML user interfaces in Go.
flog - Pre-Markdown static site generator based on UNIX tools and XSL