Requiring Single Page Applications for Interactive Web Apps is a Myth
The article clarifies misconceptions about multi-page applications (MPAs), highlighting their potential for interactivity and performance through modern technologies like HTMX, service workers, and improved browser capabilities.
Read original articleThe article discusses the misconceptions surrounding multi-page applications (MPAs) and their capabilities compared to single-page applications (SPAs). The author, Tony Alaribe, argues that it is possible to create high-quality, interactive web applications using MPAs, particularly with the help of HTMX and modern browser technologies. Common myths are addressed, such as the belief that MPAs are inherently slow, cannot operate offline, or require extensive JavaScript for interactivity. The author highlights advancements like service workers for caching, the Speculation Rules API for prefetching, and improved browser rendering techniques that enhance the performance and user experience of MPAs. Alaribe emphasizes that developers can leverage these tools to build responsive applications without relying solely on SPA frameworks. He also notes that many interactive features can be implemented using HTML and CSS, reducing the need for complex JavaScript. The conclusion encourages developers to explore the capabilities of modern browsers, suggesting that they can achieve a high level of interactivity and performance with MPAs.
- MPAs can provide excellent user experiences without relying on SPA frameworks.
- Service workers and caching can significantly improve MPA performance.
- Modern browsers support features that enhance interactivity and offline capabilities for MPAs.
- Many interactive elements can be created using just HTML and CSS, minimizing JavaScript usage.
- Developers are encouraged to utilize advancements in browser technology to build efficient web applications.
Related
New Web Development: Or, why Copilots and chatbots are bad for modern web dev
The analysis critiques Copilots, chatbots, and React for web development, citing slow sites, complex code, and high costs. It advocates for a shift to browser APIs, CSS, and HTML for better performance and lower expenses. Transition challenges include finding developers skilled in vanilla JavaScript. Organizations are urged to prioritize simplicity, efficiency, and core web technology training.
Ask HN: Is webdev getting complicated without results to show for it?
The article highlights increasing complexity in web development due to new technologies, noting that many modern websites lack significant functional improvements, with basic CRUD operations still prevalent despite aesthetic enhancements.
Less Htmx Is More
The author shares a two-year experience with htmx, advocating for plain HTML and regular links over hx-boost, emphasizing performance, user trust in multi-page websites, and simpler web solutions.
Building a Single-Page App with Htmx
Jake Lazaroff explores htmx for developing single-page applications, highlighting its client-side operation, offline capabilities, and IndexedDB for data retention, while noting challenges with service worker support in browsers.
Panic at the SPA
The article critiques the complexity and inefficiencies of React and Single Page Applications, highlighting performance issues, SEO compatibility concerns, and a lack of standardization in the JavaScript ecosystem.
Few years ago I built a shopping site MPA this way and the page transitions were almost not noticable.
I've wondered if going back to that paradigm would be more productive or not than using React et al.
Plenty of big sites like Amazon or Steam still are made this way. Not exactly PHP + jQuery but rendering HTML on the server and sprinkling some JS on top of it.
Has anyone gone back to working like that?
Omission of trailing part changes the meaning and makes it clickbaity.
You can do it, but you might paint yourself into a corner. For example, your manager might at some point say: please load X, while Y is animating; that will not work if the entire page is reloading. A SPA will give you more control and will also reduce the probability of having to rework entire parts of the code.
It's probably all good for something... But I would love to just make my web app out of what the browser itself can do, without a tech stack as high as a skyscraper for me to handle.
I know, this way the ecosystem can develop more rapidly (compared to waiting for improvements in the official web standards), and it's also fun to play with toys, and everyone can raise his/her value by learning more and more of these tools.
On the other hand, the web was imho in a better shape before all that began. From user perspective and from developer perspective.
I could be wrong... I'm not primarily a web developer at all...
You Can't Build Interactive Web Apps Except as Single Page Applications... And Other Myths
This is an essay contributed by Tony Alaribe, based on his talk at BigSkyDevCon this past year, discussing techniques to make a non-SPA based web application feel fast and slick. He mentioned some techniques that were new to me and I thought it was the best talk at the conference.
What we have is the natural way to do things with web stack (the way it's is mean to be used), and the "hacky way" (the way that let us do what we want to do, even when the web stack doesn't support it yet).
SPA is the hacky way today, but before it we had CGI, Java applets, Flash... And the web purists were always very vocal against the hacky way.
But the hacky way is what pushs the envelope of what the natural way can do. Every feature cited in the article that makes an MPA competitive with an SPA today only exists because of SPAs.
I'm on the side of preferencially use the web the way it's meant to use whenever it's possible, but I love to see what can be done when we are a little hacky, and it's awesome to see the web stack adapting to do these things in a less hacky way.
When choosing a tech stack, normally I’d also look for which one rots the slowest. Writing a SPA will typically mean that in the case of the libraries/frameworks there becoming untenable, at least you have an API that you can use when writing a new client.
I have this PrimeFaces/JSF project at work - it’s unpleasant to work with and feels brittle (especially when you have to update components, in addition to nested table row updates being pretty difficult). I’ve also helped migrate an AngularJS project to Vue, the former was less pleasant to use than the latter but the migration itself was also unpleasant, especially when you wanted to get close to 1:1 the functionality. I like how Angular feels more batteries included than the other options, but I’ve seen some overabstracted codebases. React seems like it has the largest ecosystem but the codebases seem to rot pretty quickly (lots of separate libraries for the typical project, lots of updates, things sometimes break). The likes of Laravel and Rails let you be pretty productive but also have pretty tight coupling to the rest of the codebase, same as with PrimeFaces/JSF. I’ve also seen attempts at putting as much logic in the DB as possible and using the back end as more or less only the view layer, it was blazing fast but debugging was a nightmare.
Honestly, just pick whatever technology you think will make the people working with the project in 5 years the least miserable. For me, often that is something for a SPA, a RESTful web API, some boring back end technology that connects to a relational database (sometimes SQLite, sometimes PostgreSQL, sometimes MariaDB; hopefully not Oracle). Whatever you do, try not to end up in circumstances where you can only run a front end with Node.js 10 or where you can't update your Spring or ASP.NET version due to there being breaking changes in your coupled front end technology.
I wouldn't change it for the world, but I've been told multiple times I'm very much in the minority.
I made the switch and the community it stronger than ever for vuejs and react
WebAssembly is pretty great. Here's an example: https://bandysc.github.io/AvaloniaVisualBasic6/
There might be some technical advantages you can argue but there’s an undeniable economic advantage to not needing to make a bunch of disparate choices and wire things up in a way that you hope will not bit you in the ass later.
Related
New Web Development: Or, why Copilots and chatbots are bad for modern web dev
The analysis critiques Copilots, chatbots, and React for web development, citing slow sites, complex code, and high costs. It advocates for a shift to browser APIs, CSS, and HTML for better performance and lower expenses. Transition challenges include finding developers skilled in vanilla JavaScript. Organizations are urged to prioritize simplicity, efficiency, and core web technology training.
Ask HN: Is webdev getting complicated without results to show for it?
The article highlights increasing complexity in web development due to new technologies, noting that many modern websites lack significant functional improvements, with basic CRUD operations still prevalent despite aesthetic enhancements.
Less Htmx Is More
The author shares a two-year experience with htmx, advocating for plain HTML and regular links over hx-boost, emphasizing performance, user trust in multi-page websites, and simpler web solutions.
Building a Single-Page App with Htmx
Jake Lazaroff explores htmx for developing single-page applications, highlighting its client-side operation, offline capabilities, and IndexedDB for data retention, while noting challenges with service worker support in browsers.
Panic at the SPA
The article critiques the complexity and inefficiencies of React and Single Page Applications, highlighting performance issues, SEO compatibility concerns, and a lack of standardization in the JavaScript ecosystem.