Drupal 12 HTMX 4 Upgrade Returns to Review

Contributed Modules Face a Cross-Version Compatibility Boundary
The DropTimes hero graphic for a Drupal 12 and HTMX 4 compatibility story. The headline reads “One Upgrade, Two Compatibility Paths,” with supporting text explaining that HTMX 4 changes attributes, headers, events, and PHP APIs, requiring module maintainers to handle Drupal 11 and Drupal 12 differently. The graphic also includes the HTMX logo, the cover of the book “Hypermedia Systems,” and The DropTimes footer branding.

Core contributors have returned Drupal 12’s HTMX 4 upgrade patch to review after adding support for a feature missed during the latest compatibility pass. Shawn Duncan, principal software engineer and contributor to the integration, told The DropTimes that contributors from the Drupal and HTMX teams have been coordinating as prereleases are published. The issue remains tagged as a Drupal 12.0.0 beta blocker while contributors await the final HTMX 4.0 release.

The upgrade creates a compatibility boundary for modules that support both Drupal 11 and Drupal 12. The draft change record documents revised event names, explicit attribute inheritance, changes to the PHP Htmx class, and replacement of the HX-Trigger request header with HX-Source. It advises maintainers to use \Drupal\Component\Utility\DeprecationHelper because the HTMX 4 changes are not backward compatible.

The HTMX team is in a cycle of putting out release candidates for v.4 and is closely coordinating with us. As those candidates come out we re-check and adjust our integration as needed. We are expecting a full 4.0 release very soon and will be ready to commit after that last check.

–Shawn Duncan, principal software engineer

Contributors updated the branch to HTMX 4.0.0-beta6 and returned the issue to review on 24 July 2026. Duncan reported that all tests were passing on 26 July, but moved the issue back to needs work on 27 July after identifying missing support for hx-status. Later that day, he added the method and its test, reported passing tests, returned the issue to review, and updated the draft change record.

The HTMX 4 migration guide provides configuration options for restoring earlier behaviour, an HTMX 2 compatibility extension, and an upgrade checker for templates and JavaScript. In his technical overview, Duncan also highlights the move from XMLHttpRequest to the Fetch API, multiple response fragments through <hx-partial>, Idiomorph-based morphing swaps, and status-based handling through hx-status. These are HTMX 4 capabilities, but their presence in the library does not establish how broadly Drupal core will use them.

HTMX creator Carson Gross told The DropTimes in a LinkedIn message that he understood the integration to be proceeding smoothly. The upgrade forms part of Drupal’s gradual plan to replace its legacy AJAX system with HTMX. The HTMX library was added as a Drupal core dependency in Drupal 11.2, followed by supporting PHP and JavaScript integration in Drupal 11.3. Drupal currently maintains the existing AJAX API alongside the newer HTMX API while contributed and custom modules are converted.

Disclosure: This content is produced with the assistance of AI.

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please reach out to us at #thedroptimes channel on Drupal Slack and we will try to address the issue as best we can.

Upcoming Events

Latest Opportunities