The htmx team recently released an essay addressing the future of htmx. htmx wants to be a low-cost, high-value addition to the toolkits of web developers with a focus on stability and backward compatibility. Going forward, htmx will be developed with its existing users in mind. Websites built with htmx should be working for many years without changes.
The essay starts by reminding the reader of the ubiquity of jQuery and positing three reasons why jQuery is still used in 75% of public websites. First, jQuery could be added with a single, dependency-free link. Second, jQuery remained largely backward-compatible while it evolved. Third, jQuery is a library that, unlike frameworks, does not dictate the structure of an application.
Alex Petros discussed in his talk “Building The 100 Year Web Service” what would be candidate stacks for long-lived applications:
Petros asserted that the web platform provides higher durability guarantees for applications than desktop or mobile applications. The web runs on a large set of devices, has been backward-compatible since its inception, and does not gate application deployment behind an approval process.
The essay declares htmx intent to be an attractive candidate for long-lived applications by adopting an extremely stable API and implementation:
This means accepting and documenting the quirks of the current implementation.
Someone upgrading htmx (even from 1.x to 2.x) should expect things to continue working as before.
Where appropriate, we may add better configuration options, but we won’t change defaults.
We are going to be increasingly inclined to not accept new proposed features in the library core.
People shouldn’t feel pressure to upgrade htmx over time unless there are specific bugs that they want fixed, and they should feel comfortable that the htmx that they write in 2025 will look very similar to the htmx they write in 2035 and beyond.
In the talk, Petros discussed SQLite as a candidate database technology as it is highly backward-compatible, is supported everywhere, and has a very long lifespan. While Postgres may require an upgrade or migration every 5 years when a given release is no longer supported, SQLite has not required any upgrade since 2004. SQLite has made backward compatibility a core feature in order to not break existing deployments — at the cost of supporting bugs, documenting gotchas, and reporting on caveats and quirks of the stable versions. Petros provided the following quote from the SQLite technical documentation:
Primary keys can sometimes contain NULL
This is a bug, but by the time the problem was discovered there were [sic] so many databases in circulation that depended on the bug that the decision was made to support the buggy behavior moving forward.
Similarly, the team will consider new core htmx features when new browser features are available. Developers can rely on the htmx Extensions API to build non-core functionalities. A list of community extensions is available online.
Lastly, the htmx team intends to continue evangelizing hypermedia concepts (cf. hypermedia controls). The team advocates for the inclusion of those concepts into the HTML standard itself. In this ideal world, there will no longer be any extra htmx dependency as the core ideas would be baked into the platform. Interested readers can review the current Button Actions proposal. The proposal gives HTML buttons the action
attribute, allowing them to make HTTP requests.
One developer on Reddit mentioned that stability may be counter-cultural in the JavaScript world:
While I agree with this sentiment and way of designing software, it does leave a problem with the current way we manage dependencies in our software these days:
We tend to rate the “health” of a project based on the number of new releases within a given time span. So once software is “complete” as you tend to see in the Rust and Go ecosystems, it is to the untrained eye indistinguishable from abandonware.
If we are to normalize “complete” software we need new heuristics as to the health and stability of a project.
htmx is an open-source project under the BSD-2-clause license. htmx claims to provide AJAX, CSS Transitions, WebSockets, and Server-Sent Events directly in HTML, using attributes, so developers can build user interfaces with the simplicity and power of hypertext.