Stop being the product.
Become the owner.
or
sign uplog in

The Complexity Delusion: Why I abandoned Next.js for a…

The Complexity Delusion: Why I abandoned Next.js for a 20MB Rust binary with HTMX

I have spent the last few years totally immersed in the React and Next.js ecosystem. I believed, like many others, that this was the pinnacle of modern web development. That the brutal complexity of hydration, client vs server boundaries, and massive bundlers was just the necessary cost of building "enterprise-grade" applications.

Yesterday I built a conceptual framework from scratch mimicking the folder ergonomics of Next.js, but completely replacing the Node ecosystem with Rust, HTMX, Tailwind, and Alpine.js. The outcome made me question everything the modern web industry has been selling us.

I want to open a debate about what I consider to be the biggest problem in web development right now.

# The trap of accidental complexity

If we look at it objectively, almost every major "innovation" in the React ecosystem over the last few years is a band-aid for a self-inflicted wound caused by the SPA architecture:

1. We decided to build the DOM with JS on the client, ignoring the very nature of the web (Hypermedia).
2. That broke SEO and initial load times.
3. As a solution, we invented Server-Side Rendering (SSR). We send HTML, and then download megabytes of JS to "hydrate" that HTML.
4. That hydration created state synchronization issues between client and server, leading to the infamous Hydration Errors.
5. To fix the state mapping problems and massive bundle sizes, we introduced React Server Components (RSC) and boundary directives like "use client" and "use server".

We ended up with a highly fragile, two-headed architecture where code tries to exist in two dimensions simultaneously, usually requiring proprietary infrastructure (Edge networks, Vercel) just to run decently without latency. They standardize this and call it "Developer Experience".

# The RATH model (Rust, Axum, Tailwind, HTMX, Alpine)

I decided to create a pure stack. I kept the file-system routing that makes Next.js comfortable, but excised all the heavy JavaScript and NPM dependencies.

This is what I discovered by returning to the original hypermedia design of the web, powered by a compiled language like Rust:

1. The Server dictates absolute truth: HTMX allows any HTML element to issue mutations against the server and update itself with HTML fragments. There is no JSON serialization. There is no state sync. If there is no duplicated state, years of potential UI bugs are instantly removed.
2. Single Binary Deployment: There is no node\_modules folder nor third-party dependency update paranoia. The entire application, including routes, strongly typed templates, and logic, compiles into an immutable 20MB binary. Deployment is literally copying over SSH and starting a basic Linux service. Runtime RAM usage rarely exceeds 15MB.
3. Real Security vs Marketing Security: Next.js inherits NPM supply chain risks and runtime evaluation flaws. With Rust and crates like SQLx, SQL queries are validated at compile-time; if the SQL syntax has a single flaw, the code simply will not compile. The templating engine inhibits XSS by default, requiring explicit escaping, all while the Borrow Checker prevents memory leaks.

# Are they selling us the solution to the problem they created?

Any ephemeral interactivity that purely matters to the user's viewport (a dropdown menu, dark mode toggle, an alert) is resolved strictly locally with Alpine.js without recycling the component tree or issuing network calls. For vital business logic, the browser is perfectly capable of rendering async HTML at speeds that expose the sluggishness of a Virtual DOM.

I would love to hear your perspectives. Have we normalized an excessively bloated tech stack thinking it is the only "modern" way to build web software? Do you think hypermedia frameworks backed by strongly typed compiled languages will dominate serious enterprise web development again?
#dev #technology #programming
earnings
1,000 mlx total
$0  total
engagement
2 views
0 reactions

0 comments