htmx interview question · Most asked

What changed in htmx 4?

Create a free account to save this page, take notes and track your progress. Sign in

Summary

htmx 4.0 (August 2026) switched from XMLHttpRequest to fetch() with streaming, made inheritance explicit (:inherited), swaps 4xx/5xx responses by default (except 204/304) with hx-status for control, renamed events to htmx:phase:action (htmx:after:request), renamed hx-disable to hx-ignore and hx-disabled-elt to hx-disable, removed history snapshots in storage, and added a 60-second default timeout and morph swaps.

Longer Answer

htmx 2 remains supported indefinitely and stays npm's latest until some point in early 2027, so upgrading is optional. The official upgrade checker (npx [email protected] upgrade-check) finds the attributes and events to change. Extensions are now loaded with a script tag, without hx-ext.

Key Points

  • fetch() and streaming.
  • Explicit inheritance.
  • Error responses swapped; hx-status.
  • Renamed events and attributes.

Deep dive: htmx Tutorial: Upgrading to htmx 4

More most-asked htmx questions

← All htmx questions

Was this page helpful?