Frontend-only Frameworks
Paradigm lost
I’ve been making websites since 1999 when I was a fresh-faced 8th grader. The new millennium looked bright—in no small part due to the sense of unbound possibility instilled in me by the still nascent World Wide Web. It captivated me, and I built monuments to its beauty. Needless to say, the Web and I changed in the ensuing years. I was attentive to the changes in web design and development during the Web Standards Movement. After that I lost the plot. Or perhaps the industry lost the plot.
When it’s one guy versus an entire industry, it’s easy to reason to that the one guy is just a hack. After all, how could so many people be wrong? Imposter syndrome is a devious foe, but so is groupthink. For now I think it’s the industry that’s gone astray.
The rapid changes to JavaScript development have been dizzying. Developers invented ingenious solutions to common problems. They even invented solutions to the problems of developing such solutions. All of this has been great. But there’s one aspect of the modern JavaScript era I don’t embrace, and that is frontend frameworks, or more specifically the way folks use frontend frameworks.
Losing the plot
When I took my web design and development skills pro in 2008, my guides were the articles on A List Apart, and Andy Budd’s seminal book, CSS Mastery. To me, the ideas and methods proclaimed by these sources, were not just one way of building websites. They were the way, superior to the bad practices we previously wallowed in, and a rediscovery of the Web's original design paradigm. We found the plot. And I assumed that the bad practices would soon be relegated to antiquity. They weren’t.
Frontend frameworks arrived, and I ignored them. Why in 2010, would anybody rely on JavaScript for mission-critical features? After all, we all knew the benefits of progressive enhancement. Even in 2012, when the folks at Twitter got off the frontend crazy train in favor of more performant server-rendered HTML, the industry did not heed their example. They plowed ahead.
JavaScript all the way down
The ancient engineers who built the Tower of Babel didn’t have faulty tools, they had a faulty premise. Namely, they fancied themselves equal to God. What they constructed was ostensibly impressive, but fundamentally and fatally flawed. Modern Web developers are much the same, using JavaScript as a foundation, rather than an enhancement to a more performant, more accessible starting point. This architectural defect threatens to bring down the entire stack.
When the browser encounters a scripting error, the JavaScript parser stops and that portion of the code is ignored. If the site does not treat scripting as an enhancement, (it has only a frontend framework), the entire thing ceases to function. This is a single point of failure. Conversely, on a site where scripting is treated as an enhancement, broken JavaScript is no problem. Links still hoist the user to their intended destinations, buttons still submit data to the backend, etc.
Theoretically a frontend framework could sit atop a sensible foundation, by employing the methods of progressive enhancement, but such an application is rare. Frontend frameworks make HTML templating so easy, that they imply—or developers infer—that backend HTML would be redundant. To this degree, the ethos of the tool is responsible for the way it is used.
A proposal
If pairing a traditional backend with a modern frontend entails duplication I propose we solve that problem instead of considering it a dead end. We might be able to build stacks where we use the same JavaScript on the server as we do on the client. Solving HTML templating, for example, in the same way on both the client and server side seems imminently possible.
Another angle
In addition to my engineering criticisms of frontend-only sites, there’s a moral argument, and it has to do with accessibility. Part of the dream of the Web is universality—instant information access for everyone. When we don’t choose progressive enhancement, we shut the door on real people, and mock the spirit of the Web.
Finding the plot
As I’ve given them the cold shoulder, have frontend frameworks served me a dish of ice-cold revenge? If “the best revenge is massive success” I think the answer eludes us presently. Clearly there’s massive interest, if stars on Github mean anything, but is there success? The number of sites actually using a frontend framework remain low, and the space continues to evolve rapidly. Time will tell.
For now, I continue to believe that most sites should be built with traditional server-rendered HTML, and enhanced with enthusiasm using whatever JavaScript tools suit our purposes, frontend frameworks included. I continue to be inspired by the Web. I continue to hope in its vision of not only interconnected documents, but interconnected people. And with the wide-eyed wonder of an enthralled youth, I continue to aspire to making things worthy of the Web.