offline navigations: generate fallback document artifacts (2/10)#93737
Draft
feedthejim wants to merge 1 commit intofeedthejim/offline-navigations-flag-canaryfrom
Draft
offline navigations: generate fallback document artifacts (2/10)#93737feedthejim wants to merge 1 commit intofeedthejim/offline-navigations-flag-canaryfrom
feedthejim wants to merge 1 commit intofeedthejim/offline-navigations-flag-canaryfrom
Conversation
This was referenced May 10, 2026
694e1e4 to
cef4b74
Compare
Contributor
Tests PassedCommit: 41d2265 |
cef4b74 to
6345adc
Compare
d9404d4 to
2d875f9
Compare
Contributor
Stats from current PR🔴 1 regression
📊 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 (3 files)Files with changes:
View diffspages-api.ru..time.prod.jsDiff too large to display pages.runtime.prod.jsDiff too large to display server.runtime.prod.jsDiff too large to display 📎 Tarball URLCommit: 6345adc |
2d875f9 to
a30807a
Compare
6345adc to
865d623
Compare
865d623 to
41d2265
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 2 of 10. It is the build-output slice for the fallback HTML document.
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 makes the build emit the fallback HTML document at the framework-managed offline navigation path. The document is intentionally small: it is a bootstrap entrypoint that later PRs can cache and serve when document requests fail.
The fallback document source is split into small render helpers for metadata scripts, bootstrap scripts, and final document assembly. The emitted HTML still stays minified. The empty document also shares the inline Flight bootstrap helper with the existing app-render inline Flight path, so the fallback shell does not hand-write a separate
self.__next_fbootstrap string.The slice also tightens the disabled-flag behavior so reviewers can see the build output contract before any client routing code lands.
What Works After This PR
With the flag enabled, the production build emits the fallback document. With the flag disabled, the build does not emit offline navigation artifacts.
What Does Not Work Yet
No service worker is registered yet, so the document is not cached or served at runtime. Soft and hard navigations to prefetched routes still behave normally online and still miss offline.
Reviewer Focus
Please focus on the fallback document path, the shared inline Flight bootstrap helper, disabled-build absence checks, and whether this is the minimum build output needed before the service worker and client router enter the stack.
Proof in This PR
The production suite asserts the emitted fallback document path, exact inline Flight bootstrap, disabled artifact absence, no route HTML in the fallback document, newline-free output, and the fallback HTML size budget:
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
Service worker registration and caching are deferred to PRs 3 and 4. Offline document fallback serving is deferred to PR 5. Router-cache replay is deferred to PR 8.
Docs Status
The user-facing guide and config reference land in PR 10, after the runtime behavior exists.