Repository navigation
docs: デモにタイルキャッシュ(Weiwudi の Service Worker)の節を足す - #163
Merged
Merged
Conversation
実 Service Worker での取得・中止・消去・再生成と、キャッシュ無しの経路、 Core が失敗を握りつぶす状況(進まない・中止の応答なし・消去されない)を試験する。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Weiwudi の Service Worker を Vite でまとめ、デモの /weiwudi-sw.js として配る(ライブラリのビルドには入れない) - 節「キャッシュ」: 状態・統計・全タイルの取得と中止・キャッシュの消去 - ?cache=0 または Service Worker を使えない環境ではキャッシュ無しで起動し、理由を節に出す - Core が取得・中止・消去の失敗を握りつぶすため、進まない取得や応答の無い中止を見張ってボタンを戻す Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 統計とサイズの読み取りを 3 秒で打ち切る(SW が詰まると Core の Promise は解決しない) - 消去の確認は読み取りの回数でなく経過時間(3 秒)で打ち切り、ボタンを必ず戻す - 地図を切り替えたら、総数を読み直すまで一括取得の可否を「分からない」に戻す - e2e: 読み取りが解決しない場合の試験を足し、試験名から設計内の番号を外す。中止の試験は cancel の呼び出しを測る Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kochizufan
marked this pull request as ready for review
November 9, 2026 05:54
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.
症状
デモがタイルキャッシュ系の API(
getMapTileCacheStatsAsync・fetchAllMapTileCacheAsync・cancelMapTileCacheAsync・clearMapTileCacheAsyncなど)を 1 つも見せていませんでした。直し方
/weiwudi-sw.jsとして配ります(入口はdemo/weiwudi-sw-entry.tsの 1 行。SW 本体の複製は追跡せず、依存の追加もありません。ライブラリのビルドには入りません)。enableCache: trueでMaplatAppを作ります。?cache=0、または Service Worker が使えない環境では、キャッシュ無しで起動して理由を節に出します。cache=0を付けて従来どおりの経路を通します(検査の中身は変更なし)。確かめ方
e2e/demo-cache.spec.ts(14 件): 実 Service Worker・盛岡の手元のタイルで取得・中止・消去・再生成、?cache=0・SW 無し・取得できない地図、page.clockと関数の差し替えで失敗の見え方を決定的に再現。vitest・typecheck・build(verify:common含む)・build:demoと e2e 全件を実行(e2e は 96 件中 95 件緑・1 件は単独実行で緑。下記)。補足
pnpm run dev→http://localhost:5175/?region=morioka→ 「全タイルを取得」→ 再読み込み → 「キャッシュを消す」。?cache=0と対比できます。outside-pois.spec.tsの「背面が GL(MapLibre)のとき」が 1 回だけ赤くなりました(デモも Service Worker も使わない/e2e/test.htmlの試験)。同じ試験は単独で 3 回、ファイルごと 1 回とも緑でした。🤖 Generated with Claude Code