I’ve been using Gomponents with TailwindCSS and HTMX a lot lately and it’s a really pleasant experience once I got over the initial “who ever thought Gomponents is a good idea?!” phase that lasted two hours or so. #golang
@fallenhitokiri the warm fuzzy feeling when someone uses your project and likes it never gets old. :D I'm very happy you got over your initial WTF period (that a lot of people have) and stuck with it long enough to start enjoying it!
BTW, regarding the dot imports: I usually have all my HTML code in one package (ingeniously called “html”), and my aliases are just never exported outside the package, so the solution to your alias problem in that case would be simple: lowercase them. Then you just export the stuff you need in your HTTP handlers and/or tests, and you're good!
@fallenhitokiri haha, good observation. I also held off gomponents because of that WTF feeling, but that feeling wore off pretty much immediately.
@mogsie @fallenhitokiri perhaps I should make a new tagline for the project. "The WTF feeling goes away!” :D
@markus thank you for creating the lib!
I started out with everything in a html package and it worked nicely. The imports became a small inconvenience when I started to refactor most of the styled elements to a separate package to reuse them across internal projects. Kind of encoding the brand guidelines in it. :)
@fallenhitokiri Ah yes, of course. That hasn't really been a problem for me, because once I do that, the components typically become slightly higher level than the HTML building blocks, and they quite naturally get different names. But I can definitely see how that might not always be the case!
I hope you can live with the package name in that case. 😅 I've really become fond of the dot imports style.
(Fun fact: it was inspired by an episode of Go Time where they were discussing antipatterns in Go, dot imports being among them.)