offline navigations: persist cached router records (7/10)#93640
Draft
feedthejim wants to merge 1 commit intofeedthejim/offline-navigations-indexeddb-primitivesfrom
Draft
Conversation
Contributor
Tests PassedCommit: 3b4189c |
0d73dc5 to
add90ad
Compare
ae1a360 to
2602879
Compare
Contributor
Stats from current PR🔴 1 regression, 1 improvement
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (9 files)Files with changes:
View diffsapp-page-exp..ntime.dev.jsfailed to diffapp-page-exp..time.prod.jsfailed to diffapp-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsfailed to diffapp-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsfailed to diffapp-page.runtime.dev.jsfailed to diffapp-page.runtime.prod.jsfailed to diffserver.runtime.prod.jsDiff too large to display 📎 Tarball URLCommit: 6a7cdd4 |
add90ad to
a76c40f
Compare
2602879 to
561d5a1
Compare
a76c40f to
c3d4db1
Compare
561d5a1 to
52b901d
Compare
c3d4db1 to
e97223f
Compare
52b901d to
9413a83
Compare
9413a83 to
6c811a7
Compare
This was referenced May 8, 2026
This was referenced May 8, 2026
8b0c282 to
12d8027
Compare
c020b0a to
284bcf2
Compare
12d8027 to
0d3dba8
Compare
284bcf2 to
4f0c762
Compare
9cc3d21 to
c66e3d2
Compare
3912e67 to
0ac0ca3
Compare
This was referenced May 10, 2026
4a20107 to
9c58e11
Compare
6b46e75 to
bb45b28
Compare
9c58e11 to
e796c9e
Compare
bb45b28 to
f214891
Compare
677c608 to
0054034
Compare
f214891 to
6c47dfd
Compare
0054034 to
979db16
Compare
6a7cdd4 to
f71c4f2
Compare
979db16 to
620f0a1
Compare
f71c4f2 to
3b4189c
Compare
620f0a1 to
363e3e7
Compare
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.
Stack Position
This is PR 7 of 10. It persists cached navigation records from the existing client router.
Review guide:
https://gist.github.com/feedthejim/a10f757cf07c5550f731adf2fcf1077b
Full Stack
offline navigations: add gated build primitives (1/10)offline navigations: generate fallback document artifacts (2/10)offline navigations: register pass-through worker (3/10)offline navigations: cache fallback and current-build assets (4/10)offline navigations: serve fallback document offline (5/10)offline navigations: add router-cache persistence primitives (6/10)offline navigations: persist cached router records (7/10)offline navigations: bootstrap fallback from router records (8/10)offline navigations: support dynamic route patterns (9/10)offline navigations: add docs and examples (10/10)What This Changes
This wires the persistence primitive into the existing cached navigation router flow. Route, segment, and head records that the router already receives through normal prefetch/navigation paths can be mirrored into IndexedDB for the current build.
The important architectural point is that this does not invent a new offline route loader. It persists the same fulfilled route and segment inputs the Cache Components client router is already allowed to use: serialized vary paths for identity, stale time, cache version, route tree and metadata, segment fetch metadata, payload index, and RSC response body bytes.
What Works After This PR
The client can persist the router records needed by a future fallback boot.
What Does Not Work Yet
The fallback document still does not consume those records, so an offline hard reload will continue to miss until PR 8.
Reviewer Focus
Please focus on write placement, freshness/build scoping, RSC body capture, and whether the persistence hooks stay aligned with the normal cached navigation lifecycle.
Proof in This PR
Persistence behavior is exercised by the production offline navigation suite on the stack tip:
HEADLESS=true pnpm test-start-turbo test/production/app-dir/offline-navigations/offline-navigations.test.tsHEADLESS=true pnpm test-start-webpack test/production/app-dir/offline-navigations/offline-navigations.test.tsDeferred Coverage
PR 8 proves those persisted records are enough to recover a hard reload and that normal invalidation clears the offline copy.
Docs Status
The user-facing guide and config reference land in PR 10.