Bump turbo-rails for Turbo.offline.clearCache()

Simplify the clear-offline-cache controller to use the new
Turbo.offline.clearCache() API instead of messaging the service
worker directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Rosa Gutierrez
2026-02-20 11:45:06 +01:00
parent 1c2de6ca79
commit de6d70cc2e
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ GIT
GIT GIT
remote: https://github.com/hotwired/turbo-rails.git remote: https://github.com/hotwired/turbo-rails.git
revision: ca62e8bdad88d01914d512ad24424e0670f239c9 revision: 4104a353cfe728232dc0eed6d54c77466a9849f2
branch: offline-cache branch: offline-cache
specs: specs:
turbo-rails (2.0.23) turbo-rails (2.0.23)
+1 -1
View File
@@ -62,7 +62,7 @@ GIT
GIT GIT
remote: https://github.com/hotwired/turbo-rails.git remote: https://github.com/hotwired/turbo-rails.git
revision: ca62e8bdad88d01914d512ad24424e0670f239c9 revision: 4104a353cfe728232dc0eed6d54c77466a9849f2
branch: offline-cache branch: offline-cache
specs: specs:
turbo-rails (2.0.23) turbo-rails (2.0.23)
@@ -1,8 +1,8 @@
import { Controller } from "@hotwired/stimulus" import { Controller } from "@hotwired/stimulus"
import { Turbo } from "@hotwired/turbo-rails"
export default class extends Controller { export default class extends Controller {
async clearCache() { clearCache() {
const registration = await navigator.serviceWorker?.ready Turbo.offline.clearCache()
registration?.active?.postMessage({ action: "clearCache" })
} }
} }