Skip to content
Go

The 'GoTH' Evolution: templUI and the New Era of Type-Safe Go Web UIs

Published: Duration: 4:29
0:00 0:00

Transcript

Host: Alex Chan Guest: Marcus Thorne Host: Hey everyone, welcome back to Allur, your go-to spot for deep dives into the tech stacks that are actually making our lives as developers easier—or at least more interesting. I’m your host, Alex Chan. Host: To help me break this all down, I am so excited to welcome Marcus Thorne to the show. Marcus is a Principal Engineer who has spent years in the React ecosystem but has recently become one of the loudest voices for the GoTH stack. He’s been experimenting with templUI since the early commits. Marcus, thanks for joining us on Allur! Guest: Thanks so much for having me, Alex! It’s a literal dream to talk about this because, uh, I think I’ve finally stopped having nightmares about `npm install` taking twenty minutes. Host: Oh, I think we’ve all been there. The "black hole" of node_modules is a real place. So, Marcus, let's start with the basics for anyone who’s been living under a rock. What is the "GoTH" stack, and why are people suddenly obsessed with it? Guest: Right, so "GoTH" is Go, Templ, and HTMX. The "Aha!" moment for most people is when they realize that Go isn't just for microservices or CLI tools anymore. Go is the backend, obviously—fast, concurrent, reliable. But then you have Templ, which is a templating engine that actually compiles your HTML into Go code. That’s the secret sauce. And HTMX is the glue that gives you that "Single Page App" feel—AJAX, transitions, websockets—all without writing custom JavaScript. It’s a "Hypermedia Driven Application." Basically, the server stays the boss of everything. Host: It feels like a return to the "old ways" of server-side rendering, but with superpowers. But tell me about the friction. Before templUI came along, what was the struggle? I’ve built Go web apps before, and honestly... they usually looked like they were designed in 1998 unless I spent a month fighting with CSS. Guest: Exactly! That was the "Go tax." You had this incredible, type-safe backend, but then you’d reach the frontend and it was either "clunky vanilla CSS" or you’d give up and install React just to get a decent-looking modal or a dropdown. You were essentially forced back into the complexity you were trying to avoid. Host: I love that. I was looking at some templUI code earlier, and the thing that struck me was the "Locality of Behavior." Can you explain why that's such a big deal for our daily workflow? Guest: Oh, it's huge. In a traditional React-plus-Go-API setup, if you want to change how a button works, you’re jumping between three files in two different languages. You've got your Go handler, your TypeScript interface, and your React component. Host: That's a great way to put it—holding the app in your head. But let’s talk about the "T" in Templ: Type Safety. This is usually where I see people's eyes light up. How does the compiler help us on the UI side? Guest: This is the "peace of mind" feature. Since Templ compiles to Go, your HTML is literally checked by the Go compiler. If you have a `UserProfile` component that expects a `User` struct, and you try to pass it a string? The code won't even compile. Host: That sounds like magic compared to the "runtime surprise" party we usually have with JS. But what about performance? Are we sacrificing the "snappiness" of a modern SPA by going back to the server? Guest: It’s actually the opposite. We’ve been lied to a bit about SPA performance. With a heavy JS framework, the user has to download a massive bundle, the browser has to parse it, and then "hydrate" it before it’s even interactive. Host: And I guess the "JS Fatigue" is real for the developers, too. No Webpack, no Vite... Guest: Oh, man. My `package.json` is basically non-existent now. It’s just Tailwind and HTMX. The build process is just `templ generate` and `go build`. That’s it. It’s "boring" technology in the best possible way. It’s stable. I know that if I open this project in three years, it’s still going to compile. You can’t always say that about a Node-based project from three years ago! Host: So, if someone is listening and they’re thinking, "Okay, I’m sold, I want to try the GoTH stack," where should they start? Is templUI ready for prime time? Guest: It’s definitely ready to explore. If you’re building a SaaS, an internal tool, or a CRUD app, it’s a total dream. Check out the templUI docs—they’ve done a great job mimicking that shadcn "copy-paste" flexibility. You aren't locked into a massive library; you just take the components you need. Host: Marcus, this has been such an eye-opener. I think we’re seeing a real "return to sanity" in web development, and it’s exciting to see Go lead the charge. Guest: Thanks for having me, Alex. It was a blast! Host: And thanks to all of you for tuning into Allur. If you enjoyed this episode, subscribe on Spotify or Apple Podcasts, and leave us a review—it really helps. Until next time, keep building, keep simplifying, and I’ll catch you in the next one!