(map #(discard %) opinions)

Actually, we don't need to talk about JavaScript

In a sub-section of a previous post, while elaborating my feelings on JavaScript, I made a note in a one-off paragraph that I think went undersold:

Nowadays, all you need is a language that can speak HTTP (literally all of them). If you can write your application as a server-side render, you don’t even need JavaScript–you can just code away in your favorite language and spit back HTML. If you need a little bit more interactivity, you could bump yourself to the exciting new HTMX project.

…and I probably should’ve just stopped there instead of rambling on for 5 more paragraphs (and a bulleted list), because it turns out that applications with “a little bit more interactivity” is actually most applications.

In my defense, at the time I was in the middle of two separate React projects, using ClojureScript for both of them, and I had more-or-less accepted that “compiling to JS” was “how things had to be”. I think there’s something in programmers; when we hear “you aren’t gonna need it”, most of us have the extreme opposite reaction and engineer a solution in which we will “need” it.

And I think that’s how most well-meaning new developers and project managers fall down the React rabbit hole. You see one page refresh you don’t love and, all of the sudden, you need a JS framework. Nevermind that you’re a 2-3 person team writing a barely-non-trivial CRUD app–what you need is more complexity.

It took some convincing (mostly of myself), but we did finally move away from React. Last year I mentioned HTMX as an afterthought–now it powers all of the (very few) dynamic components to our shipped(!) web application. We eliminated a theoretical entire half of our codebase, before it was even written, without dropping any features. That’s a pretty big get, I’d say.

So I offer this little experience to other side-project-seeking developers out there–you probably don’t need React. Or any JS framework. You can do a lot more with a lot little, and the constant internet chatter about the “state of JS” is just noise to you and your tiny team. Focus on the signal.

Think before you npm init :)