2 ms·
The title is literally an SPA Alternative. Should the title then not be updated to an SPA framework, since it isn't an alternative. That is like saying Microsof
by encryptluks2 4y ago
The title is literally an SPA Alternative. Should the title then not be updated to an SPA framework, since it isn't an alternative. That is like saying Microsoft Word is an alternative to word processors.
- recursivedoubts 4y agoBut it isn't an SPA framework, it's a generalization of HTML as an alternative to SPA-style frameworks. It's very different conceptually, as different as mobile apps and web 1.0 apps at the network architecture level. I understand that this approach will not appeal to a lot of folks, but on the other hand that's because it is so different than what most of the industry is doing. I hope I understand your criticism correctly here.
- encryptluks2 4y agoThe 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
- woojoo666 4y agoI took the title to mean that HTMX is an SPA alternative, as in, an alternative way to write SPAs that is unlike the common approach. But as other commenters mentioned, HTMX seems to also focus on multi-page applications