this post was submitted on 03 Feb 2024
488 points (94.2% liked)

Programmer Humor

32051 readers
1618 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] rwhitisissle@lemmy.ml 15 points 7 months ago (2 children)

HTMX is great and is the only frontend development tool I don't absolutely loathe. It enables lightweight SPA development, and provides a very simple and efficient mechanism for doing HTML over the wire.

[–] BedSharkPal@lemmy.ca 3 points 7 months ago (1 children)

Not sure I would call HTMX a SPA framework though? Like it all's easy async content fetching for sure, but it's usually done across a MPA?

[–] rwhitisissle@lemmy.ml -1 points 7 months ago (1 children)

Where did I call it a framework?

[–] BedSharkPal@lemmy.ca 0 points 7 months ago (1 children)

Sure, wrong term. I think my point still stands though. A SPA is *generally *"rehydrated" DOM elements from JSON data pulled from an API though. Where as HTMX is more akin to classic AJAX style page dynamism.

[–] rwhitisissle@lemmy.ml 0 points 7 months ago* (last edited 7 months ago) (1 children)

A SPA is *generally *“rehydrated” DOM elements from JSON data pulled from an API though. Where as HTMX is more akin to classic AJAX style page dynamism.

You'll forgive me if I say this is an instance of splitting hairs and having a particular definition for something that includes extra qualities separate from what those terms are actually describing for most people. Also, things like, I dunno, React, are going to extensively use ajax to accomplish what they do. It's literally just asynchronous javascript. It's like someone saying "my vehicle of choice is a motorcycle" and then someone else saying "A motorcycle isn't really a vehicle. It's a transportation device with wheels. A car is a vehicle." They are both vehicles. They both have wheels. The wheels are ajax. A page made with htmx and a page made with React are both SPAs.

[–] BedSharkPal@lemmy.ca 1 points 7 months ago (1 children)

My point is just that I think to most people, HTMX doesn't create what is classically considered to be a SPA any more than older MPA's that called utilized AJAX would be. There's a reason those old-style pages aren't really considered SPA's. Is it splitting hairs? Absolutely.

[–] rwhitisissle@lemmy.ml 0 points 7 months ago

I think we're gonna have to agree to disagree on definitions. To me, and I believe, to most people, an SPA refers to a UI/UX design pattern that can be implemented with any number of underlying techniques. I would also say that the Wikipedia page for SPAs (on the assumption that wikipedia is a valid tool for establishing consensus for definitions) supports my definition:

A single-page application (SPA) is a web application or website that interacts with the user by dynamically rewriting the current web page with new data from the web server, instead of the default method of a web browser loading entire new pages.

There are various techniques available that enable the browser to retain a single page even when the application requires server communication.

And it goes on to list frameworks, AJAX, Websockets, etc.