Not Everything Has to Be a Single Page App

One thing about web developers is that we need to understand the medium that we work with. The web is built with pages and even the single page apps need to be sent and displayed in the browser as a web page. As more people are entering the field of web design and development, they come with the notion that React and single-page apps are the hammers for every nail.

There are applications that don’t need to be single-page apps and we should be OK with that. This is the web and no matter how performance your application is, there is latency because the data is communicated between your computer and the server. Also, everybody is used to the page load in the browser considering that this has been part of the web from the inception. Moreover, every time a person visits a website, there is loading required. If you visit a search engine to search for a keyword, the search engine results page (SERP) will give you a list of pages that are relevant to the keyword. Yet, when you visit those links, they will take time to load no matter what.

Please don’t take from this writing that you should not focus on performance. Performance is valid and part of the business to improve the user experience. Nevertheless, building SPA is not the only way to create websites and applications. In some cases, SPA takes way longer to load over multi-page apps because they have to load what is needed by the entire application first instead of what is needed by the page requested.

As I mentioned earlier, it is OK to create websites with simple HTML, CSS, and JavaScript. The thinking that everything needs to be component-oriented/based is wrong and most of the websites out there don’t need it. People learning modern web development should learn HTML, CSS, and JavaScript first before they jump into frameworks. The more people enter the field with React as their only tool, the more we are digging into the rabbit hole.

We are adding layers and layers of complexity so there is text rendered in the browser within a div tag. We have to step back and rethink what we are doing because instead of simplifying development, we are just discouraging new developers who just quit because they cannot keep up. Just to think that a bare-bones React app (Next.js) with some options like Tailwind and ESLint installs over 250MB while the entire Windows 95 could be installed for less than 100 MB. Thus, an entire operating system takes less than half of the space than a React application that you haven’t even started to add your code or business logic. Or think this way, every time you want to create a new project, you are installing two Windows 95 in your machine. Ridiculous!

In conclusion, think we got it wrong when we thought that everything had to be JavaScript or component-based. Simplicity and sanity of maintainable code are part of the developer experience as well. The good news is that I see some interesting libraries that combine traditional pages with modern approaches to web development like htmx, Alpine.js, and Unpoly that simplify the way we develop web applications by reducing the JavaScript that we need to code on the client side.

Teylor Feliz
Teylor Feliz

Teylor is a seasoned generalist that enjoys learning new things. He has over 20 years of experience wearing different hats that include software engineer, UX designer, full-stack developer, web designer, data analyst, database administrator, and others. He is the founder of Haketi, a small firm that provides services in design, development, and consulting.

Over the last ten years, he has taught hundreds of students at an undergraduate and graduate levels. He loves teaching and mentoring new designers and developers to navigate the rapid changing field of UX design and engineering.

Articles: 183