Skip to content

Fix upgrade-check false positive for hx-history-elt#3889

Merged
1cg merged 1 commit into
bigskysoftware:four-devfrom
marciomazza:fix/upgrade-check-hx-history-elt
Jul 13, 2026
Merged

Fix upgrade-check false positive for hx-history-elt#3889
1cg merged 1 commit into
bigskysoftware:four-devfrom
marciomazza:fix/upgrade-check-hx-history-elt

Conversation

@marciomazza

Copy link
Copy Markdown
Contributor

The upgrade-check tool is incorrectly flagging hx-history-elt as a removed attribute, when it was actually restored in v4 core.

Problem

The REMOVED_ATTRS dictionary in src/scripts/upgrade-check.py contained:

"hx-history-elt": "removed",

This caused the upgrade-check tool to warn users that hx-history-elt should be removed from their HTML, even though it's a valid, working attribute in htmx v4.

Evidence

hx-history-elt was restored to v4 core in commit 2b39a899 (PR #3773):

  • "Add back hx-history-elt and improve history cache extension"

The attribute is actively used in src/htmx.js:1636:

let historyElt = document.querySelector(this.__prefixSelector('[hx-history-elt]')) || document.body;

And documented in CHANGELOG.md:

Restored hx-history-elt from htmx 2 and improved the hx-history-cache extension.

Fix

Removed hx-history-elt from the REMOVED_ATTRS dictionary in src/scripts/upgrade-check.py.

Note: dist/scripts/upgrade-check.py is a build copy and isn't updated here, per guidelines; should be regenerated on release.

Testing

The upgrade-check tool will no longer flag hx-history-elt as removed, allowing users to keep this valid attribute in their HTML.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

hx-history-elt was restored in v4 core (commit 2b39a89, bigskysoftware#3773),
so the upgrade-check tool was incorrectly flagging it as removed.
@1cg

1cg commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Thank you!

@1cg 1cg merged commit 0412408 into bigskysoftware:four-dev Jul 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants