Revisiting Web History from web 1.0 to RSC and HTMX
Tags: abotwrotethis
Published: 2023-07-10 05:36:01

Recently, I have been following HTMX talks and realized that while discussing the history of the web, we tend to simplify the evolution timeline, often omitting critical aspects. Let's delve deeper into the web's evolution journey from the beginning up to where HTMX and other web technologies currently stand.

## Understanding Web According to HTMX
HTMX explains the history of the web in a simple sequence:
1. Web 1.0 existed with just HTML and no JS.
2. Web 2.0 came along with Single Page Applications (SPAs) and JSON communication for everything.
3. HTMX marked a return to the form.

However, as someone who has experienced the evolution of the web first hand, my recollection differs slightly.

## My Recollection of the Web Evolution

### The Dawn of Web Apps
In my view, turning websites into applications began before CSS and JS had their footprints in web development. Around 1996-1997, we saw the emergence of ActiveX and Java applets, just a few years after CSS and JS were born.

In the 2000s, technologies such as Flash, Silverlight, and XMLHttpRequest came to the fore. It's interesting to note that it was called XMLHttpRequest and not JSON HTTP Request, suggesting it was primarily designed to exchange HTML or XML. All this happened during the web 1.0 era, highlighting the app vs. website divide even then.

### The Era of Web 2.0
The drastic shift came around 2005, marking the start of the web 2.0 era. Platforms like Drupal, WordPress, and others were heavily used. They utilized JavaScript (JS) and embraced AJAX or AJAJ, but the focus remained on using what already worked, i.e., good old HTML from web 1.0. This era gave birth to jQuery, catering to developers who were hesitant to learn JS and preferred to stick to server-side languages.

However, 2005 was also the year when ActiveX died out, and the 2007 iPhone famously didn't support Flash. This change led to a massive demand for creating web apps that relied solely on HTML, CSS, and JS.

### The Evolution of JavaScript
Over time, the question that plagued developers was: "Can I re-create existing Flash apps using only HTML, CSS, and JS?" This trend was a step in the right direction, despite the growing pressure to utilize users' CPU and memory resources.

However, browser capabilities hadn't caught up yet. HTML5, CSS3, and ES5 weren't available, and JS was still considered unreliable. It's interesting to note that browsers like IE8 and even Chrome 1 didn't support `JSON.parse`.

### The 2010s - A Turning Point
The years 2010-2012 were pivotal as browsers finally started catching up with emerging web technologies. HTML5, CSS3, and ES5 (along with JSON.parse) became commonplace. The History API emerged, allowing URL modifications without reloading the page. 

Around this time, a host of new technologies and frameworks began to surface. For instance, Angular, Ember, Backbone, and Knockout were introduced. With the rise of these technologies, the term Single Page Application (SPA) gained popularity.

### Web Transformation in 2015
Fast forward to 2015, traditional web frameworks such as Drupal, WordPress, Django, and Rails had their time in the limelight. However, as mobile apps gained popularity, web traffic started shifting, with 50% coming from mobile devices. In response, Google introduced progressive web apps (PWA), Accelerated Mobile Pages (AMP), and Lighthouse, while promising to index SPA-style web apps.

This period also saw the rise of a new generation of frameworks like React, Gatsby, Next.js, and others. 

### The Era of Overprescribed JS, JSON, and API
From 2015 onwards, we've seen a persistent focus on JS, JSON, and APIs. Around 2020, traditional server frameworks finally started to adapt to the "HTML is now for apps" world. This was when we saw the rise of Blazor, Phoenix LiveView, Laravel Livewire, and of course, HTMX!

## What’s Next?

Reflecting on the history of the web, we can observe two parallel streams of evolution: traditional websites with server-side logic and just a sprinkling of JS, and the more complex side starting with applets and aiming to provide an app-like experience.

What seems to be the ongoing battle is finding a way to maintain the simplicity of traditional MPAs while delivering a user experience akin to SPAs. In this regard, both HTMX and React Server Components are arguing their case to be the best possible emulation of the MPA.

Regardless of how you perceive "traditional web," what's fascinating is that HTML continues to stand tall, even with the decline of `/cgi-bin/hello.cgi` Perl scripts. The concept of delivering an app over HTML remains alive and kicking, even in the face of competition from native apps.

In the end, it is a reminder that the evolution of the web is continuous, filled with turning points and paradigm shifts. But amidst all these changes, the essence of web development, which lies in creating rich and seamless user experiences, remains unchanged.