Skip to content

Commit 972dc96

Browse files
authored
Remove deprecated Turbo.clearCache() function (#1471)
The deprecation was introduced in [87b0efb][], which was part of the [v7.2.0][] release. [87b0efb]: 87b0efb [v7.2.0]: https://github.com/hotwired/turbo/releases/tag/v7.2.0
1 parent 81b1b24 commit 972dc96

File tree

3 files changed

+0
-15
lines changed

3 files changed

+0
-15
lines changed

src/core/index.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,6 @@ export function renderStreamMessage(message) {
7777
session.renderStreamMessage(message)
7878
}
7979

80-
/**
81-
* Removes all entries from the Turbo Drive page cache.
82-
* Call this when state has changed on the server that may affect cached pages.
83-
*
84-
* @deprecated since version 7.2.0 in favor of `Turbo.cache.clear()`
85-
*/
86-
export function clearCache() {
87-
console.warn(
88-
"Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"
89-
)
90-
session.clearCache()
91-
}
92-
9380
/**
9481
* Sets the delay after which the progress bar will appear during navigation.
9582
*

src/tests/functional/import_tests.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ async function assertTurboInterface(page) {
2020
await assertTypeOf(page, "Turbo.connectStreamSource", "function")
2121
await assertTypeOf(page, "Turbo.disconnectStreamSource", "function")
2222
await assertTypeOf(page, "Turbo.renderStreamMessage", "function")
23-
await assertTypeOf(page, "Turbo.clearCache", "function")
2423
await assertTypeOf(page, "Turbo.setProgressBarDelay", "function")
2524
await assertTypeOf(page, "Turbo.setConfirmMethod", "function")
2625
await assertTypeOf(page, "Turbo.setFormMode", "function")

src/tests/unit/export_tests.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ test("Turbo interface", () => {
1010
assert.equal(typeof Turbo.connectStreamSource, "function")
1111
assert.equal(typeof Turbo.disconnectStreamSource, "function")
1212
assert.equal(typeof Turbo.renderStreamMessage, "function")
13-
assert.equal(typeof Turbo.clearCache, "function")
1413
assert.equal(typeof Turbo.setProgressBarDelay, "function")
1514
assert.equal(typeof Turbo.setConfirmMethod, "function")
1615
assert.equal(typeof Turbo.setFormMode, "function")

0 commit comments

Comments
 (0)