Rendered at 20:39:28 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
nzoschke 22 hours ago [-]
Love Go + HTMX. I pair it with a-h/templ for a bit more type safety on the template, components and partials.
I just shared my whole toolkit too [1], I call it the "GUS stack" -- Go, Unix, SQLite. Inspired heavily by the exe.dev "GUTS" stack [2] but with HTMX instead of Typescript.
Some other Go components in the kit...
- cockroachdb/errors for errors with stack traces
- templ for type-safe HTML templates (with htmx for reactivity and tailwindcss for CSS)
- fuego for an OpenAPI spec generated from web handlers
- sqlc for type-safe code generated from SQL
- modernc.org/sqlite for a pure Go sqlite library
- goose for SQL and Go migrations
- dbos for durable workflows in SQLite
- rod for Chrome / CDP testing and automation
Feels so productive coding, agentic coding, and building and deploying binaries with this stack.
I'm bit sad that hyperscript[1] doesn't get the love it deserves when discussing HTMX.
Hyperscript fits perfectly in the Go + HTMX stack to do DOM manipulation without having to make a server round trip or having to write a separate JS function.
I get that not many are fan of such declarative programming, but when there's already HTML file we're working with; Hyperscript feels just like an extension of it.
I have been working on a Open Payment Host[2] which handles multiple payment gateways and was able to perform complex DOM manipulation with just Hyperscript.
There's security consequences to allowing inline JS, which hyperscript requires.
gkbrk 11 hours ago [-]
The same server that's responsible for sanitizing garbage JS out of user content is also responsible for sending the Content-Security headers. Why would you trust it with one, but not the other? If it's buggy garbage it will also send the wrong headers.
foldr 10 hours ago [-]
This is a pretty good argument in the case of software written by a small team of experienced engineers. In that scenario, if the engineers don't have the nous to avoid the kinds of HTML injection vulnerabilities that might allow an attacker to inject their own JS code, then, as you say, they are probably also making lots of other mistakes.
A CSP is more valuable in a larger organization, where the codebase is always at risk of being modified by the organization's worst engineer.
germandiago 12 hours ago [-]
How so? Final validation always goes in the server side.
foldr 11 hours ago [-]
It means that you have to use a less strict Content-Security-Policy, which increases your vulnerability to various client-side JS attacks.
Abishek_Muthian 6 hours ago [-]
Actually even with a strict CSP i.e. without unsafe-inline, hyperscript will work as it's declared as html attributes. But as the other commenters have pointed out, with proper server validation in place the risk from Hyperscript is not greater than any other JavaScript in the application.
foldr 6 hours ago [-]
Will it not need unsafe-eval, though? It still creates the potential for HTML injection to lead to execution of untrusted code. Execution of untrusted code is the real issue, regardless of exactly how that code ends up being evaluated and executed. Even if Hyperscript were to have its own interpreter (so that it didn't even need unsafe-eval), you'd still have the same fundamental vulnerability (unless you add nonces, or some such).
>the risk from Hyperscript is not greater than any other JavaScript in the application.
This is not really the case. If all of your client-side code is loaded via <script src="..."> tags from bundles on your server, and you have a CSP that blocks unsafe-eval or unsafe-inline, then you have a pretty good barrier against execution of untrusted code on your page.
Abishek_Muthian 4 hours ago [-]
AFAIK Hyperscript doesn't require `unsafe-eval`, when the optional features of htmx like `hx-on:*`, `hx-vals js:`, `hx-confirm js:` is used it required the `unsafe-eval` but now there's extension[1] to use even that without compromising on strict CSP through nonce.
That’s interesting, thanks. I agree that with all those extra protections enabled, there is no security issue.
nzoschke 22 hours ago [-]
Could rebrand to the HUGS stack -- HTMX (or hypertext), Unix, Go, SQLite
osigurdson 15 hours ago [-]
I'm unfamiliar with these stacks but including "U" / Unix seems odd. I suspect these run completely fine on Linux, Windows or macOS. Its almost like including an "E" in your stack for electricity.
rob74 13 hours ago [-]
Well, the good old LAMP stack (Linux-Apache-MySQL-PHP - this was the first of these acronyms as far as I'm aware of) included L for Linux so it would make a nicer acronym. Some people changed it to WAMP when running under Windows. But HWGS doesn't roll off the tongue nicely. Maybe HAGS (with "Apple" standing in for MacOS) would work?
ColonelPhantom 12 hours ago [-]
Or HOGS? HTMX-OS-Go-Sqlite. While having "OS" in there is kind of redundant, it does make for a nice and general acronym.
tapotatonumber9 9 hours ago [-]
GASH?
theherk 7 hours ago [-]
SHAG!
didip 20 hours ago [-]
I love HUGS a lot too. Currently building a next gen platform using strictly HUGS.
0xDEFACED 17 hours ago [-]
my vote is for GUSH
grahar64 17 hours ago [-]
I have seen this as the GoTH stack, Go Templ Htmx. Add sqlc to that gor GoTHs or GHosT stack.
Love this combo, once you buy into "go generate ./..." as a build step you get so much.
I also add goverter for converting between sqlc models and template objects and return values. Like 50% of the boilerplate is generated and it makes type safety so nice
sollniss 17 hours ago [-]
Lately I'm really liking jet[1] for typesafe SQL. It requires a live DB to generate the code, but I see that as a positive as well, since you are forced to apply migrations before writing code.
Huge fan of jet. It lets you just write SQL, but in your Go. I basically can’t imagine using anything else now.
Why is that better than writing plain SQL like in sqlc? My main reason was being able to dynamically construct queries and reuse different bits. Plain SQL statements simply don’t compose at all, and I don’t recall sqlc giving any solution to help with this.
hiAndrewQuinn 9 hours ago [-]
On the other end of things, for tiny responsive web apps that don't necessarily even need their own built in database, like e.g. real time API dashboards, I've been using my PAHG template a lot lately [1]. Pico.css, Alpine.js, Htmx, Go. There's no reason one couldn't hook this up to SQLite, of course.
I was wondering: would you be able to add an RSS feed to housecat blog I can subscribe to?
shimman 21 hours ago [-]
I tried to use templ but it felt more frustrating than ergonomic. Like at that point I'd rather just use react (and I hate react). Just sticking with basic std templates + HTMX sprinkling is good enough for my needs.
localhostinger 14 hours ago [-]
HTMX is great for a lot of things, but if you're working in a team, and your colleagues are not on board, it's tough. Lots of "this is not a serious technology" kind of arguments. All kinds of bugs simply initially blamed on the choice of using HTMX. Even if proven wrong afterwards, the damage is already done. And this was in the most excellent team I have worked in so far.
I'm happy that I got to experience this and I learned from it. Gotta choose your battles or something.
As for Go's html/template: I think it has one of the weirdest / most unnatural interfaces. I recently reread "A Philosophy of Software Design" and one of its key points is to keep interfaces simple and push complexity downwards, making it easier for others to use. Now why do I have to care about "cloning templates" every time I render some html template? Love the Go stdlib, but this thing feels unnecessary complex to me.
masfoobar 12 hours ago [-]
As much as I really like htmx -- this is a sad truth!
I tried to pitch htmx to my team last year and found an opportunity to create a simple webapp. One of the devs really struggled with htmx after years of muscle memory returning json and rendering in JS/JQuery. It was a lot of "I now have to do this.. how do I solve this problem?"
I think he would have struggled with any different approach whether we changed to angular, react, etc. htmx didn't really stand a chance.
The other dev, on the other hand, didn't even bother to try it.
All I heard from the team was Blazor this, blazor that.
Personally I think it's a shame. We are a small team and would be good to avoid javascript 95% of the time. We could just generate server side code/html which, imo, would create organised code base. Easy to test as well.
Any personal web projects I still use htmx and reached a decent flow with it. Completely simplifies web dev, imo.
I'm in an advisor position, and I tried very hard to mentor the team, explaining that learning this technology deepens your understanding of the browser. Whereas React etc isolates you from the actual environment you're working in - the browser.
On html/template, I like the security by default, and obviously it's built-in. But the dynamicness leaves too many open-ended questions unanswered. Templ is great, but the ergonomics leaves many things to be desired. After writing a few large production applications in it. I decided to create gsx: https://github.com/gsxhq/gsx
icedchai 7 hours ago [-]
I've worked with developers that don't even understand that the "form" tag exists and browser can send a request without any javascript. At some point in the early 2010's, perhaps even before, fundamental understanding disappeared. This makes it difficult to introduce alternative technologies like HTMX into a larger project.
dzonga 10 hours ago [-]
yeah with tools like HTMX - your environment shapes you.
if your teams is less than 3 people - you've less politics to fight. & chances are people are already capable - no resume padding. so you choose what's pragmatic & that choice ends up being HTMX.
for big teams - politics takes over. even though HTMX will be beneficial - might as well go with the 'safer' political choice which doesn't cause much contention ie one of the big JS frameworks.
sgt 8 hours ago [-]
I have also noticed teams don't seem to "get" htmx.
It is an unbelievably good tool though, and LLM's understand it very well (given some encouragement).
akazantsev 13 hours ago [-]
> Now why do I have to care about "cloning templates" every time I render some html template?
You do not have to. It's a self-sustained injury by the author. You can compile the templates once and just execute them.
The issue is that author wants to specify page titles in the main templates. If you pass titles as a context, you can split base.tmpl into BASE_BEGIN, BASE_END and use them in the final templates.
Yes, you will have to pass the title depending on the page template during the But his tactics will break anyway when you try to support different languages.
alexedwards 13 hours ago [-]
That's not the reason I use Clone() in this pattern. The main reason for the clone operation is convenience. The clone operation is on the already-parsed set of shared templates (base+partials in this example code). It provides the convenience of not having to specify the path to the base template and any paths to the partial templates needed by that page in the call to render().
There may also be a performance benefit too - I suspect that the Clone() operation is cheaper than re-parsing the base and any necessary partial templates in each render() call, but I've never benchmarked it, so I can't assert that with certainty.
realusername 9 hours ago [-]
I had the same thing but in reverse, it's impossible to convince my company that the React SPA simply doesn't scale despite all the problems we have with it.
They can see each problems one by one but can't put it in the same picture as it's "proven technology"
tg180 12 hours ago [-]
[dead]
xp84 22 hours ago [-]
I used HTMX on a recent project and really enjoyed it. As a person who knows how the Web worked before the invention of AngularJS and React, I deeply appreciate being able to build actual pages and minimize the amount of JS that has to exist. Vanilla JS works fine, but HTMX basically just substitutes for a lot of boilerplate that you'd otherwise have to create just to do the same event handler stuff over and over.
If you're curious, and you too aren't in love with the "Modern frontend" philosophy, I would recommend trying out HTMX. Of note, the first examples of HTMX on the HTMX site are really basic, but it's much more powerful with a bit more learning.
wasmperson 22 hours ago [-]
> If you're curious, and you too aren't in love with the "Modern frontend" philosophy
I'm also going to hesitantly mention sveltekit. From the outside it looks like yet another JS front-end framework but having been forced to use it recently I've learned it actually has great support for the more hypertext-focused design philosophy promoted by HTMX and friends.
masfoobar 10 hours ago [-]
100%
arch1e 15 hours ago [-]
As someone who tried to build a fairly large project with HTMX + Go, I can say it just wasn't there for me. Maybe it will get there eventually, but I'm not convinced.
For simple CRUD apps and admin dashboards, HTMX is great. But once you have lots of interconnected components, shared state, and complex interactions, managing everything quickly becomes difficult.
I originally chose HTMX because I really didn't enjoy working with React. Eventually I tried SvelteKit, and it completely changed my perspective. I still use Go for the backend, but SvelteKit in SPA mode for the frontend. It gives me a clean separation between the two while making complex UIs much easier to build and maintain.
What really sold me was that Svelte feels like a natural extension of HTML rather than a different language with JSX. State management is simple, the component model is intuitive, and the new `$state` syntax is especially nice.
mixmastamyk 2 hours ago [-]
The htmx site is clear about tradeoffs and that it is not suitable for that use case. Though you have to dig for the articles.
solatic 9 hours ago [-]
Just curious: the people behind HTMX have a frontend sibling project called Hyperscript, which handles stuff like frontend state: https://hyperscript.org/docs/reactivity/
Did you give it a try?
asdfsa32 8 hours ago [-]
At that point just use React.
solatic 3 hours ago [-]
I'm not convinced. Hyperscript's reactivity model is highly greppable, and it keeps the no-build approach to Web frontend interactivity. It's "just enough" in the same way that HTMX is.
React probably scales better for huge engineering divisions, but that isn't who the GOTH stack is aiming for anyway.
designerarvid 13 hours ago [-]
Isn’t the whole point of HTMX philosophy to question whether you need interconnected components with shared state? Most apps are doing crud on a database at the end of the day.
pepperoni_pizza 8 hours ago [-]
I think it very much depends on what you're doing. Would it make sense to build Google Docs in HTMX? Probably not. Does it make sense to roll out SPA + JSON API for something that is basically a reskinned Django Admin? Probably not.
intrasight 9 hours ago [-]
Yes. And additionally most "apps" are just static web sites with static components.
flaie 15 hours ago [-]
Currently almost all of my side projects, LLM assisted or not, are coded in Go + HTMX.
Opus and GPT are very good at it, it's fast to build and start, convenient to deploy and host, one binary. I like it very much.
Very good stack to iterate fast.
yawaramin 17 hours ago [-]
If you’re using htmx, I highly recommend an HTML generation technique in your backend that lets you easily componentize in the same way as you can with React. Eg, extracting common pieces of HTML markup into functions much like React components.
The reason is that htmx requires a certain amount of flexibility in the HTML generated by the backend. Eg, you need to be able to generate a certain piece of HTML markup and put a <title> tag immediately adjacent to it in some situations, and not in others. (Htmx updates the page title when it finds a <title> tag at the top level.)
This kind of flexibility is difficult with traditional string-based templating engines, but trivial with language-embedded HTML libraries.
If it’s Scala then ScalaTags. And so on, you get the picture. The point is that a language-embedded system allows you to use the full power of your language to build abstractions and components, which htmx really benefits from.
You can also use jsx on the backend. React has renderToStaticMarkup, but you probably want to use one of the jsx libraries written specifically for the backend.
yawaramin 7 hours ago [-]
You can use JSX but tagged template literals are supported out of the box by JS runtimes, so you wouldn’t need to add a build step.
androiddrew 22 hours ago [-]
I love Alex Edwards. His books and Learn go with tests were my first introduction to the language. Still recommend to this day.
I'm feel inspired to convert some old stuff to HTMX
bbg2401 22 hours ago [-]
Seconded on the Alex Edwards adoration. Anyone with the slightest interest in learning Go for web development should pick up both Let's Go and Let's Go Further. They are two of the most approachable, enjoyable and practical introductions to a programming language I've read.
smallerfish 21 hours ago [-]
I wrote a framework for my own use that uses Kotlin + HTMX - https://github.com/reubenfirmin/zoned. The goal was to see if I could create webapps that were fully typed, end to end. It uses Kotlinx.html, which provides a jsx-ish dsl for writing html.
I did the first 90% by hand, and have done the last 10% (and README) with Claude, just to get it out there.
overflowy 21 hours ago [-]
While I love both Go and Alex, my experience with HTMX has always ended up being disappointing.
I think the best way to put it, when I'm working with HTMX it feels like the complexity of the codebase is growing at a 2:1 rate compared to the app itself. I always end up with some weird edge case that I can not come out of without some weird hack.
I get why people dislike Node packages, HTMX feels like it's an overcompensating response to that. But the time you save by not having to wrestle with JSON is tripled when you try to make the app actually look or feel good. It takes me 2 minutes to slap together a Mantine template [1] and tap into some of the best UI components, then I can embed the built static assets and end up with the same single Go binary.
I understand the sentiment. Rails was my introduction to hypermedia and it was convenient and easy, so experiencing friction when building with Go/HTMX came as a surprise.
After a few attempts I learned that abstractions are important :D
Without a component builder and reversible router is indeed pretty painful (and Rails just ships with these things so you didn't have to worry about it).
The biggest benefit for me personally is that computation and data live in one place, which carries you very far. Also, machines like hypermedia: LLMs are great at using and testing hypermedia apps because they are self-contained and the cycle time is lower because you don't need to wait for JS.
And yes, no easy off the shelf component library makes starting harder.
abdullin 14 hours ago [-]
I’m struggling myself a bit with the components and routers in HTMX/go. Can you recommend any source code or reading on that topic?
It's relatively easy to generate your own nowadays, I mostly go through the Ruby on Rails guides and mix and match the pieces I want for go and turn them into libraries :)
michaelchisari 19 hours ago [-]
I've found that my whole design philosophy has to change to work with HTMX. That's not a dig, it may even be a good thing, but it's a significant shift. The designs become much more native to the web and much less inspired by mobile apps.
yawaramin 21 hours ago [-]
What's an example of a UI that you built with Mantine that you couldn't with htmx?
fhn 19 hours ago [-]
they never said "couldn't". they said "feels like the complexity"
yawaramin 17 hours ago [-]
Ok, what’s an example of the complexity growing at 2:1 rate with htmx but not with Mantine?
overflowy 12 hours ago [-]
Basically any data grid that implements multiple AND/OR filters at column level, sorting, reordering, infinite scrolling, virtualization for handling large amounts of data, etc. Also handling basic pending / error / retry states (things that I take for granted with React Query).
yawaramin 7 hours ago [-]
Yeah, a data grid is a good example of a complex hyper-interactive component. There are people out there who have made them with Web Components, which can be dropped in and used in htmx projects when used correctly.
Re: request states, handled very nicely out of the box by htmx with a little knowledge of attributes like hx-indicator and JS event handlers to handle htmx error events.
appplication 16 hours ago [-]
Agree, tbh. If I’m doing frontend I’m just using svelte nowadays. It’s quite nice.
artooro 21 hours ago [-]
Go + Datastar is simpler, I much prefer it.
devnull3 13 hours ago [-]
Yeah this combo fits as easily as a custom sized/fitted gloves would.
I would add a-h/templ for templates and it has Datastar support as well.
It is staggering how Datastar is not more popular.
nobleach 7 hours ago [-]
I think people see the "pricing" and are turned off. The base is completely free! Some of the ecosystem is not. The big selling point for me, is the size of the library. HTMX and Alpine are a bit larger. The downside for me is needing to have a template type that supports streaming. (Thymeleaf in Java vs JTE) My controllers also have imperative code to support the streaming. None of this is enough of a turnoff however. For my simple apps, I'm extremely happy with how simple both HTMX and Datastar make my logic. (I replaced a React front-end and got rid of the whole build step).
lazypenguin 20 hours ago [-]
I also prefer Datastar but the new features coming in HTMX4 closes the gap more. Happy to see the ecosystem converging on good patterns.
nchmy 20 hours ago [-]
But the point is that Datastar only exists because htmx rejected all of those ideas. Now it's becoming a cheap, more complex, less powerful, heavier copy of Datastar. Just use the genuine article.
lenkite 4 hours ago [-]
I would just go all the way to using https://unpoly.com/ if I wanted the full-bang whiz.
devnull3 14 hours ago [-]
Datastar has evolved into a suite of tools [1]. If anything the gap has widened.
Off-course these additional tools are not free [2].
[1] Rocket for WebComponents, Stellar for CSS
[2] Nothing wrong in charging but $349 is a tad too expensive for me. I will happily pay if it was in double digits.
pbjerkeseth 22 hours ago [-]
HTMX is excellent. We made it a long way at Convictional[1] with HTMX + AlpineJS, but the eventual transition of our product into lots of live collaborative surfaces had us feeling like we had pushed the envelope as far as we could under modern startup constraints. Unfortunately, frontier models have really hurt development with budding tech that doesn't have the training data presence of things like React.
https://data-star.dev is what you were yearning for, friend. It is more powerful, faster and smaller than htmx and alpine combined, and has all sorts of capabilities specifically for multi-player live reactivity.
JSR_FDED 19 hours ago [-]
Can confirm
dzonga 10 hours ago [-]
dope app.
sethops1 22 hours ago [-]
We use this[1] little package, which enables chaining together HTMX responses that can be based on an HTML template file, an HTML raw string, or plain text. All but the first being OOB targets. Real example:
I love the combination of Go and HTMX, but these types of articles usually only show the basics. Coming from a JavaScript frontend NPM ecosystem heavy background, I would love to see a write up for a production ready application. Show how you handle asset bundling and hashing. What are the best DX tools for running the local dev server with hot reloading. How do you manage the few JS libraries dependencies that you need. Do you still include a Node package manager or are you using CDN’s?
pjmlp 12 hours ago [-]
The interesting part of HTMX is how we are back into classical server side rendering frameworks with Ajax updates.
Back and forth the pendulum goes.
arjie 20 hours ago [-]
Huge fan of HTMX. Agent can reason about components well. Iteration is good and testing story is solid. Very happy with results. I use Rust/Go (prefer Go - safer package ecosystem - no build time code running) with HTMX.
latent22 19 hours ago [-]
there is a Additional HTMX configuration section and it is interesting that all 4 issues here have now been resolved by default in htmx4. History cache is now not included by default and you have to opt in to the new improved history extension. Attribute inheritance is now off by default and has a much better implicit inherit design. Indicator styles are no longer a manual injected style tag and now use constructable style sheets feature which is much cleaner and CSP safe. and default timeout is no 60s.
These are all existing common pain points that the new version allows us to address.
xutopia 7 hours ago [-]
For the life of me I can't comprehend how people today start new projects and default to using React. Rails Hotwire, Phoenix Liveview, HTMX are all vastly faster and easier to maintain. I keep hearing people say that if you want a really complex UI you need React but to those people I answer with 2 points.
1) Most of these people don't realize that if a component on the page is so complex you probably have usability issues.
2) React doesn't need to control the entirety of the page. You can contain your complex React components within a web page.
7 hours ago [-]
neeraga 19 hours ago [-]
I'm using HTMX with the Bun stack and somehow it is working great for us.
We are working on building an app builder that uses HTMX as an frontend technology, along with SQLite for the database and Bun for the backend.
codiku 8 hours ago [-]
Why doesn't htmx became ultra popular among devs ?
asdfsa32 8 hours ago [-]
Because it is good for a very narrow scope of things, once you go beyond that, it becomes a kludge to work with.
People hate on React but it is the product of 2 decades of various experiments. It is popular because it really works.
sgt 8 hours ago [-]
Been building a fairly medium to large sized web app in HTMX these last few months and if done correctly, it can be done fairly cleanly and it's best combined with templates of some kind (e.g. the templating in Golang or in Django).
evilduck 7 hours ago [-]
“If done correctly” applies to about everything though.
sgt 6 hours ago [-]
Problem is that a lot of people don't want to spend some minimum effort getting some fundamental understanding about the technology they are using. They just want to rush it to build something. It's been like that forever.
Oxodao 9 hours ago [-]
The videos do not work under Firefox (on windows at least), probably codec related but unfortunate
fmind-dev 14 hours ago [-]
I've switched from Python to Go + HTMX recently. It's a really nice combo, fast, efficient, and easy to maintain. HTMX should be part of the HTML spec.
phreack 19 hours ago [-]
I've always wondered, is there a way to visually preview the partials and whole pages? I'm used to modern niceties such as hot reload with Tailwind that I'd like to have with HTMX, which I'm looking for excuses to try.
yawaramin 17 hours ago [-]
I typically just write them as plain old HTML files while I develop them. Then once I like the look and feel of a component or page I just convert it into a template. And Visual Studio Code’s HTML Preview extension has a hot reload feature, it works perfectly.
auraham 11 hours ago [-]
I've been learning about React, Vue, and HTMX these days. As I understand, these tools aim to bring some level of interaction in a web application:
- Both React and Vue are all about reactivity: you have a variable, make it reactive by using something like ref() or useEffect(), and the framework will patch the DOM whenever that reactive variable changes. The idea is easy to understand but hard to implement. I agree with this podcast [1], where the author mentions that writing good React code is hard. I like Vue, but it is a bit overwhelming since it has many functions for creating reactive variables, like ref(), refs(), isRef(), unRef(), reactive(), toRefs(), computed(), etc [2].
- HTMX follows a similar idea: patching the DOM when an event occurs. Unlike React and Vue, HTMX does not rely on reactivity. Instead, it uses attributes like hx-get for requesting HTML fragments to the backend, patching the UI using those fragments. No watchers, no reactivity, just plain requests. This is (to some extend) suitable for dashboards, pagination, sorting tables, autocompletion. But if your application requires a higher level of interactivity, then React and Vue are a better option [2].
Then we have LiveView and Elixir, which I think is a better alternative/trade-off to these three tools:
- Similarly to React and Vue, LiveView has reactive variables (called assigns, you can think of it as a hashmap that holds the state of your application): every time the assigns changes, LiveView reloads the corresponding HTML fragment. This operation is efficient because LiveView knows which parts of the HTML fragment are static and which parts are dynamic. So when some variable changes, LiveView sends a tiny payload to the UI for updating the DOM.
- Also, LiveView follows an arguably simpler approach for reactivity, you only need to implement three functions: mount() to setup the initial state of the assigns, render() to prepare the HTML content, and handle_event() to handle events like button clicks or form submissions.
I think LiveView is so much easier to follow: if the assigns change, then the framework will update all the relevant HTML fragments. That's it. Also, we do not need to worry about adding third-party libraries for routing, state management, forms. Those are likely included in Phoenix.
There's no other tool for extracting wasps from stings in flight.
_superposition_ 21 hours ago [-]
And they claim naming things is hard...
hasanhaja 12 hours ago [-]
In a similar vein, I've been really enjoying the Go + Datastar combo with Templ.
Zababa 12 hours ago [-]
I've tried to like Go with HTMX, but the big issue was always Go templates. I feel like if there was something like JSX/TSX but for Go, it would be a way better dev experience, but right now it's mostly a pain. Templ tries to go in that direction, but a year or so ago editor integration and tooling weren't great.
mmusc 13 hours ago [-]
Another great combination is htmx and asp.net razor pages.
You can build and reuse components with partials and keeps things super simple and clean.
syngrog66 17 hours ago [-]
This is one of the stories I wonder how it made the HN front page. Whether an upvote ring or clicks-for-hire service used.
alexedwards 14 hours ago [-]
As the author of this post, I can answer this question with a very clear "no".
There is an interesting side point though. I've been blogging about Go since 2013 (generally writing similar articles to this one) and from 2013 to 2025 I think just one post made the front page of HN. In 2026, all 3 posts I've written have.
My theory is that there's now fewer people spending the time to write original content. With LLMs and AI-generated instant answers in search, the incentive to write these kind of deep-dive articles is way less than it used to be, so maybe there's both less competition and more appreciation for it? That's my working theory at the moment anyway.
franchb 12 hours ago [-]
[flagged]
typesafeJ 23 hours ago [-]
[dead]
ai_fry_ur_brain 16 hours ago [-]
[dead]
chenster 18 hours ago [-]
Every time I see a post on Htmlx made to frontpage, it gives me utter joy.
I just shared my whole toolkit too [1], I call it the "GUS stack" -- Go, Unix, SQLite. Inspired heavily by the exe.dev "GUTS" stack [2] but with HTMX instead of Typescript.
Some other Go components in the kit...
- cockroachdb/errors for errors with stack traces
- templ for type-safe HTML templates (with htmx for reactivity and tailwindcss for CSS)
- fuego for an OpenAPI spec generated from web handlers
- sqlc for type-safe code generated from SQL
- modernc.org/sqlite for a pure Go sqlite library
- goose for SQL and Go migrations
- dbos for durable workflows in SQLite
- rod for Chrome / CDP testing and automation
Feels so productive coding, agentic coding, and building and deploying binaries with this stack.
[1] https://housecat.com/blog/the-gus-stack-go-unix-sqlite
[2] https://exe.dev/docs/guts
Hyperscript fits perfectly in the Go + HTMX stack to do DOM manipulation without having to make a server round trip or having to write a separate JS function.
I get that not many are fan of such declarative programming, but when there's already HTML file we're working with; Hyperscript feels just like an extension of it.
I have been working on a Open Payment Host[2] which handles multiple payment gateways and was able to perform complex DOM manipulation with just Hyperscript.
[1] https://hyperscript.org/
[2] https://openpaymenthost.com/
A CSP is more valuable in a larger organization, where the codebase is always at risk of being modified by the organization's worst engineer.
>the risk from Hyperscript is not greater than any other JavaScript in the application.
This is not really the case. If all of your client-side code is loaded via <script src="..."> tags from bundles on your server, and you have a CSP that blocks unsafe-eval or unsafe-inline, then you have a pretty good barrier against execution of untrusted code on your page.
[1] https://four.htmx.org/extensions/hx-csp
I also add goverter for converting between sqlc models and template objects and return values. Like 50% of the boilerplate is generated and it makes type safety so nice
[1] https://github.com/go-jet/jet
Why is that better than writing plain SQL like in sqlc? My main reason was being able to dynamically construct queries and reuse different bits. Plain SQL statements simply don’t compose at all, and I don’t recall sqlc giving any solution to help with this.
[1] https://github.com/hiAndrewQuinn/pahg-template
I'm happy that I got to experience this and I learned from it. Gotta choose your battles or something.
As for Go's html/template: I think it has one of the weirdest / most unnatural interfaces. I recently reread "A Philosophy of Software Design" and one of its key points is to keep interfaces simple and push complexity downwards, making it easier for others to use. Now why do I have to care about "cloning templates" every time I render some html template? Love the Go stdlib, but this thing feels unnecessary complex to me.
I tried to pitch htmx to my team last year and found an opportunity to create a simple webapp. One of the devs really struggled with htmx after years of muscle memory returning json and rendering in JS/JQuery. It was a lot of "I now have to do this.. how do I solve this problem?"
I think he would have struggled with any different approach whether we changed to angular, react, etc. htmx didn't really stand a chance.
The other dev, on the other hand, didn't even bother to try it.
All I heard from the team was Blazor this, blazor that.
Personally I think it's a shame. We are a small team and would be good to avoid javascript 95% of the time. We could just generate server side code/html which, imo, would create organised code base. Easy to test as well.
Any personal web projects I still use htmx and reached a decent flow with it. Completely simplifies web dev, imo.
I'm in an advisor position, and I tried very hard to mentor the team, explaining that learning this technology deepens your understanding of the browser. Whereas React etc isolates you from the actual environment you're working in - the browser.
On html/template, I like the security by default, and obviously it's built-in. But the dynamicness leaves too many open-ended questions unanswered. Templ is great, but the ergonomics leaves many things to be desired. After writing a few large production applications in it. I decided to create gsx: https://github.com/gsxhq/gsx
if your teams is less than 3 people - you've less politics to fight. & chances are people are already capable - no resume padding. so you choose what's pragmatic & that choice ends up being HTMX.
for big teams - politics takes over. even though HTMX will be beneficial - might as well go with the 'safer' political choice which doesn't cause much contention ie one of the big JS frameworks.
It is an unbelievably good tool though, and LLM's understand it very well (given some encouragement).
You do not have to. It's a self-sustained injury by the author. You can compile the templates once and just execute them.
The issue is that author wants to specify page titles in the main templates. If you pass titles as a context, you can split base.tmpl into BASE_BEGIN, BASE_END and use them in the final templates.
Yes, you will have to pass the title depending on the page template during the But his tactics will break anyway when you try to support different languages.
There may also be a performance benefit too - I suspect that the Clone() operation is cheaper than re-parsing the base and any necessary partial templates in each render() call, but I've never benchmarked it, so I can't assert that with certainty.
They can see each problems one by one but can't put it in the same picture as it's "proven technology"
If you're curious, and you too aren't in love with the "Modern frontend" philosophy, I would recommend trying out HTMX. Of note, the first examples of HTMX on the HTMX site are really basic, but it's much more powerful with a bit more learning.
I'm also going to hesitantly mention sveltekit. From the outside it looks like yet another JS front-end framework but having been forced to use it recently I've learned it actually has great support for the more hypertext-focused design philosophy promoted by HTMX and friends.
For simple CRUD apps and admin dashboards, HTMX is great. But once you have lots of interconnected components, shared state, and complex interactions, managing everything quickly becomes difficult.
I originally chose HTMX because I really didn't enjoy working with React. Eventually I tried SvelteKit, and it completely changed my perspective. I still use Go for the backend, but SvelteKit in SPA mode for the frontend. It gives me a clean separation between the two while making complex UIs much easier to build and maintain.
What really sold me was that Svelte feels like a natural extension of HTML rather than a different language with JSX. State management is simple, the component model is intuitive, and the new `$state` syntax is especially nice.
Did you give it a try?
React probably scales better for huge engineering divisions, but that isn't who the GOTH stack is aiming for anyway.
Opus and GPT are very good at it, it's fast to build and start, convenient to deploy and host, one binary. I like it very much.
Very good stack to iterate fast.
The reason is that htmx requires a certain amount of flexibility in the HTML generated by the backend. Eg, you need to be able to generate a certain piece of HTML markup and put a <title> tag immediately adjacent to it in some situations, and not in others. (Htmx updates the page title when it finds a <title> tag at the top level.)
This kind of flexibility is difficult with traditional string-based templating engines, but trivial with language-embedded HTML libraries.
Eg, if your backend is in JS then a tagged template literal function like https://github.com/WebReflection/uhtml-ssr
If it’s a Go backend then a library like https://www.gomponents.com/
If it’s Scala then ScalaTags. And so on, you get the picture. The point is that a language-embedded system allows you to use the full power of your language to build abstractions and components, which htmx really benefits from.
implementation: https://github.com/mastrojs/mastro/blob/main/src/core/html.t...
docs: https://mastrojs.github.io/docs/html-components/
I'm feel inspired to convert some old stuff to HTMX
I did the first 90% by hand, and have done the last 10% (and README) with Claude, just to get it out there.
I think the best way to put it, when I'm working with HTMX it feels like the complexity of the codebase is growing at a 2:1 rate compared to the app itself. I always end up with some weird edge case that I can not come out of without some weird hack.
I get why people dislike Node packages, HTMX feels like it's an overcompensating response to that. But the time you save by not having to wrestle with JSON is tripled when you try to make the app actually look or feel good. It takes me 2 minutes to slap together a Mantine template [1] and tap into some of the best UI components, then I can embed the built static assets and end up with the same single Go binary.
[1] https://github.com/mantinedev/vite-min-template
After a few attempts I learned that abstractions are important :D
Without a component builder and reversible router is indeed pretty painful (and Rails just ships with these things so you didn't have to worry about it).
The biggest benefit for me personally is that computation and data live in one place, which carries you very far. Also, machines like hypermedia: LLMs are great at using and testing hypermedia apps because they are self-contained and the cycle time is lower because you don't need to wait for JS.
And yes, no easy off the shelf component library makes starting harder.
And my own version (I learned of vuego only after): https://htmlc.sh
Not a fan of html/template and tmpl myself, because HTML should be treated as tree and not as strings, but everybody has different preferences.
For routing I now use my own library in all projects: https://github.com/dhamidi/dispatch
It's relatively easy to generate your own nowadays, I mostly go through the Ruby on Rails guides and mix and match the pieces I want for go and turn them into libraries :)
Re: request states, handled very nicely out of the box by htmx with a little knowledge of attributes like hx-indicator and JS event handlers to handle htmx error events.
I would add a-h/templ for templates and it has Datastar support as well.
It is staggering how Datastar is not more popular.
Off-course these additional tools are not free [2].
[1] Rocket for WebComponents, Stellar for CSS
[2] Nothing wrong in charging but $349 is a tad too expensive for me. I will happily pay if it was in double digits.
[1] https://get.convictional.com/
Back and forth the pendulum goes.
These are all existing common pain points that the new version allows us to address.
1) Most of these people don't realize that if a component on the page is so complex you probably have usability issues.
2) React doesn't need to control the entirety of the page. You can contain your complex React components within a web page.
We are working on building an app builder that uses HTMX as an frontend technology, along with SQLite for the database and Bun for the backend.
People hate on React but it is the product of 2 decades of various experiments. It is popular because it really works.
- Both React and Vue are all about reactivity: you have a variable, make it reactive by using something like ref() or useEffect(), and the framework will patch the DOM whenever that reactive variable changes. The idea is easy to understand but hard to implement. I agree with this podcast [1], where the author mentions that writing good React code is hard. I like Vue, but it is a bit overwhelming since it has many functions for creating reactive variables, like ref(), refs(), isRef(), unRef(), reactive(), toRefs(), computed(), etc [2].
- HTMX follows a similar idea: patching the DOM when an event occurs. Unlike React and Vue, HTMX does not rely on reactivity. Instead, it uses attributes like hx-get for requesting HTML fragments to the backend, patching the UI using those fragments. No watchers, no reactivity, just plain requests. This is (to some extend) suitable for dashboards, pagination, sorting tables, autocompletion. But if your application requires a higher level of interactivity, then React and Vue are a better option [2].
Then we have LiveView and Elixir, which I think is a better alternative/trade-off to these three tools:
- Similarly to React and Vue, LiveView has reactive variables (called assigns, you can think of it as a hashmap that holds the state of your application): every time the assigns changes, LiveView reloads the corresponding HTML fragment. This operation is efficient because LiveView knows which parts of the HTML fragment are static and which parts are dynamic. So when some variable changes, LiveView sends a tiny payload to the UI for updating the DOM.
- Also, LiveView follows an arguably simpler approach for reactivity, you only need to implement three functions: mount() to setup the initial state of the assigns, render() to prepare the HTML content, and handle_event() to handle events like button clicks or form submissions.
I think LiveView is so much easier to follow: if the assigns change, then the framework will update all the relevant HTML fragments. That's it. Also, we do not need to worry about adding third-party libraries for routing, state management, forms. Those are likely included in Phoenix.
[1] https://www.youtube.com/live/pMwTR2KeuaU?si=AU7sqxVwTv4lRhV6...
[2] https://youtu.be/k1TrnzZaygo?si=kCpMvOgB0Egk5mDg&t=380
There is an interesting side point though. I've been blogging about Go since 2013 (generally writing similar articles to this one) and from 2013 to 2025 I think just one post made the front page of HN. In 2026, all 3 posts I've written have.
My theory is that there's now fewer people spending the time to write original content. With LLMs and AI-generated instant answers in search, the incentive to write these kind of deep-dive articles is way less than it used to be, so maybe there's both less competition and more appreciation for it? That's my working theory at the moment anyway.