4 ms·
The issue I have is that you're taking the idea of an SPA, which is pretty loose: > An SPA (Single-page application) is a web app implementation that loads onl
by encryptluks2 4y ago
The issue I have is that you're taking the idea of an SPA, which is pretty loose:
> An SPA (Single-page application) is a web app implementation that loads only a single web document, and then updates the body content of that single document via JavaScript APIs...
Looking at the examples at htmx.org, this is exactly what it does. Just because some car manufacturers decide to put an engine in the front of the car doesn't mean that a car with an engine in the back isn't still a car.
- jaredcwhite 4y agoBut htmx doesn't update the body content of the document via JavaScript APIs. It updates them via HTML APIs. That is, the content coming over the wire from the backend is HTML, not JSON. If you're trying to claim that literally any web page which uses JavaScript in any capacity to update any DOM on the page ever suddenly means it's an SPA, that seems like _quite a stretch_.
- dragonwriter 4y ago> But htmx doesn't update the body content of the document via JavaScript APIs. Yes, it does. > It updates them via HTML APIs. It updates then by using JS code calling DOM APIs. Just like any other SPA. > the content coming over the wire from the backend is HTML, not JSON. The content coming over the wire being HTML, JSON, XML, or text/plain has no bearing on whether the JS framework inserting the result of processing it somewhere on a single pre-existing page is a SPA framework.
- recursivedoubts 4y agohtmx isn't single-page focused, it has features like hx-boost and hx-push-url that are there to explicitly allow the standard URL navigation mechanism of multi-page applications, with the same semantics and conceptual model, history support and so forth as much as possible it tries to stay within the original model of the web, and just generalize it