- tags
- Hypermedia
Notes
many developers ignore the hypermedia features of the browser, in favor of building their web applications entirely in JavaScript. Applications built in this manner have come to be called Single Page Applications (SPAs).
Hypermedia is a media, for example a text, that includes non-linear branching from one location in the media to another
the code in updateUI() needs to know about the internal structure and meaning of the data.
HTML is still used to build user interfaces, but the hypermedia aspect of the two major hypermedia controls, anchors and forms, are unused. Neither tag interacts with a server via their native hypermedia mechanism. Rather, they become user interface elements that drive local interactions with the in-memory domain model via JavaScript, which is then synchronized with the server using plain data JSON APIs.
The Single Page Application offers a far more interactive and immersive experience than the old, gronky, Web 1.0 hypermedia-based applications could.
extremely simple approach to building web applications.
extremely tolerant of content and API changes.
leverages tried and true features of web browsers
“JavaScript Fatigue.” This refers to a general sense of exhaustion with all the hoops that are necessary to jump through to get anything done in modern-day web applications.
as the interactivity and expressiveness of HTML has remained frozen, the demands of web users have continued to increase
It was the user experience that you could achieve in JavaScript, and that you couldn’t achieve in plain HTML, that drove the web development community to the JavaScript-based Single Page Application approach.
In practice, for many web applications today, we actually violate this constraint: it is common to establish a session cookie
This violation of the Statelessness REST architectural constraint has proven to be useful for building web applications and does not appear to have had a major impact on the overall flexibility the web.
perhaps the most important thing to understand about htmx: it expects the response to this AJAX request to be HTML.
htmx provides another attribute, hx-swap, that allows you to specify exactly how the content should be swapped into the DOM.
the overall feel of htmx is declarative rather than imperative. That keeps htmx-powered applications “feeling like” standard web 1.0 applications
breaking the JSON Data API out to its own set of URLs is the right choice.