Repository navigation
Conversation
check_inheritance flagged an inheritable attribute whenever any descendant made a request, even when that descendant (or one of its ancestors below the flagged element) set its own value for the same attribute. Such an element never saw the ancestor's value in htmx 2, so adding :inherited would change nothing for it. Walk descendants recursively and stop at any element that sets the attribute itself, with or without a modifier. hx-vals and hx-headers are exempt because htmx 2 merged them from every ancestor. Fixes bigskysoftware#4001
The hx-boost branch of check_inheritance still walked every descendant, so <a hx-boost="false"> inside a boosted container was reported as needing :inherited even though it opts out of boosting in htmx 2. Use the same override-aware walk as the other attributes. Move the tests under test/ so build:scripts does not copy them into dist/scripts and the npm package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
upgrade-check said an inheritable attribute needed
:inheritedeven when the descendant making the request sets its own value, so in htmx 2 it never saw the ancestor's anyway. The inheritance walk now stops at any element that sets the attribute itself, includinghx-boost="false". hx-vals and hx-headers still get flagged since htmx 2 merged them from ancestors.Corresponding issue:
Fixes #4001
Testing
Added
test/scripts/test_upgrade_check.py, run withpython3 test/scripts/test_upgrade_check.py. 4 of its 7 tests fail without the fix. It isn't wired into CI; I can add a step to the content job if you want it. Findings ontest/manual/upgrade/are unchanged andnpm run testpasses.Checklist
masterfor website changes,devforsource changes)
approved via an issue
npm run test) and verified that it succeeded