Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable htmx's history support, ensure caching takes htmx into account #2360

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

longhotsummer
Copy link
Contributor

@longhotsummer longhotsummer commented Feb 13, 2025

this fixes related issues:

  1. htmx was using its own caching engine to refresh the full page contents when we provided hx-push-url in a response (eg. the work listing page). this caused our scripts to run twice, since htmx stores the full in the cache and re-loads it, without calling the server.
  2. turning htmx history off with hx-history="false" means that it won't try to store anything in the cache, instead doing an AJAX request.
  3. BUT, our server code thinks that's a partial page load, and so doesn't return a full response. So we turn off ajax htmx history off too.
  4. finally, ensure we vary caches on the hx-request and hx-target attributes.

closes #2359

this fixes related issues:

1. htmx was using its own caching enging to refresh the full page contents when we
   provided hx-push-url in a response (eg. the work listing page). this
   caused our scripts to run twice, since htmx stores the full <body> in
   the cache and re-loads it, without calling the server.
2. turning htmx history off with hx-history="false" means that it won't
   try to store anything in the cache, instead doing an AJAX request.
3. BUT, our server code thinks that's a partial page load, and so
   doesn't return a full response. So we turn off ajax htmx history off
   too.
4. finally, ensure we vary caches on the hx-request and hx-target
   attributes.

closes #2359
@longhotsummer
Copy link
Contributor Author

See https://htmx.org/docs/#history for some details.

Copy link

github-actions bot commented Feb 13, 2025

Test Results

579 tests  ±0   579 ✅ ±0   4m 27s ⏱️ -1s
 60 suites ±0     0 💤 ±0 
 60 files   ±0     0 ❌ ±0 

Results for commit 42ec739. ± Comparison against base commit cb9a05a.

♻️ This comment has been updated with latest results.

@longhotsummer longhotsummer merged commit 2e151dd into master Feb 14, 2025
6 checks passed
@longhotsummer longhotsummer deleted the htmx branch February 14, 2025 12:36
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.

SyntaxError: Identifier 'BluebellParser' has already been declared
2 participants