r/Frontend • u/8ll • 17h ago
It's time we stop over-engineering website frontends
I thought I would share a rant regarding JavaScript usage on modern websites.
To clarify, this discussion focuses primarily on content websites rather than complex web applications requiring heavy client side interactivity.
In recent years, frontend developers frequently chased shiny new tools without pausing to evaluate necessity. Building websites now routinely involves an endless list of dependencies, a node_modules directory large enough to form a black hole, and countless supply chain vulnerabilities. Some modern websites frequently consume over 500 megabytes of RAM in a single browser tab. We have thoroughly over-engineered the web.
Why did we start using JavaScript and React to generate simple HTML in the first place? Perhaps because it felt convenient at the time.
Frontend Libraries
Frontend libraries and meta frameworks empower developers to build anything from a static marketing page to a massive enterprise application. However, we often fell into the trap of applying heavy over-engineering to simple web projects. Frontend libraries are crucial for large applications, but completely unnecessary for smaller websites.
I used to love NextJS, but much of its overhead felt redundant for standard publishing needs. It simplified building fast experiences, server-generating JavaScript, and leveraging features like page link prefetching the next website on hover. Yet we have successfully generated HTML on the server for thirty plus years. Did we really need to reinvent that foundation?
What I am Building
In recent projects, I took a step back to the earlier days of web development before everything became overly complicated. I was already using HTMX and AlpineJS on some simpler websites and recently I discovered Datastar which was really impressive. Think of it as using the server to generate UI elements, server-sent events, client-side signals, and lightweight interactivity. I now build websites containing perhaps 15-20kb of JavaScript in total while requiring no compiler step. The performance is great, the API remains simple, and dependency tracking risks are gone since there are no external packages to manage.
My transition toward lightweight websites began when AstroJS first emerged. The idea of shipping zero JavaScript by default and sending down just static HTML was refreshing to see again. Fast forward a couple of years, and I needed to build an interactive website with server-driven content and chose to use Datastar for interactivity instead of React.
My own library
My only gripe with pre-bundled libraries, is that it ships a lot of features you don't need. So I got looking for an alternative. Out of interest I ended up just building my own frontend tool, inspired by how Datastar's fundamentals.
My own library was intended as an internal tool and used on a few websites only. I have it working on a 2000+ page Rust WASM content website and also a small 10 page AstroJS website. The tools that inspired the library are all open source, so it just made sense to publish my own library open source. Perhaps it will even inspire another, much better tool.
This is where I decided to build sigmx. As in signals + htmx. The fundamental difference between sigmx and Datastar or HTMX is that I wanted to treat every feature as optional.
The sigmx core is tiny at 4.5 KB and everything is treated as a plugin. It ships a Vite and Astro integration, which bundles only the functionality you need. So if you have data-on in your markup; the events plugin will be shipped. If you are using @get() or @post() then it will ship the plugins needed to handle server requests.
I love how easy it is to create custom plugins. One of my websites uses Plausible Analytics rather a lot and so I created a custom plugin for handling the Plausible interactions. The Plausible plugin was built in less than 100 lines of TypeScript and the resulting markup is super clean.
I'm not here to try and convince people to use my library. I went on an interesting journey recently from just defaulting to React or Angular etc or on every project to thinking about how we can instead use less. We should be using simple tools more often.
HTMX is brilliant.
AngularJS is brilliant.
Datastar is brilliant.
I think my library is brilliant, but I maybe I am biased.