offline navigations: register pass-through worker (3/10)#93625
Draft
feedthejim wants to merge 1 commit intofeedthejim/offline-navigations-manifestfrom
Draft
offline navigations: register pass-through worker (3/10)#93625feedthejim wants to merge 1 commit intofeedthejim/offline-navigations-manifestfrom
feedthejim wants to merge 1 commit intofeedthejim/offline-navigations-manifestfrom
Conversation
This was referenced May 8, 2026
Contributor
Failing test suitesCommit: 5b339ab | About building and testing Next.js
Expand output● after() in static pages › runs after during build |
This was referenced May 8, 2026
19163ff to
ff6adf4
Compare
72b9f6c to
ea2f115
Compare
ff6adf4 to
a7a800c
Compare
ea2f115 to
cc2d61a
Compare
a7a800c to
08e8b61
Compare
cc2d61a to
c997fd8
Compare
08e8b61 to
55a94f7
Compare
This was referenced May 8, 2026
This was referenced May 8, 2026
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: 8ac906e |
55a94f7 to
7a5e5e9
Compare
c997fd8 to
97a5c4a
Compare
b7f8165 to
2de7db3
Compare
97a5c4a to
7297652
Compare
2de7db3 to
07b14fe
Compare
07b14fe to
694e1e4
Compare
fe9e691 to
3a6dc55
Compare
This was referenced May 10, 2026
694e1e4 to
cef4b74
Compare
a7c6088 to
26fc34b
Compare
26fc34b to
8ac906e
Compare
6345adc to
865d623
Compare
8ac906e to
75c9392
Compare
75c9392 to
5b339ab
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 3 of 10. It registers the generated service worker, but keeps it pass-through.
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 introduces the generated service worker artifact and client-side registration path behind
experimental.offlineNavigations. The worker is available at a framework-managed static path and is registered from the app entrypoint when the flag is enabled.The worker does not handle requests in this PR. This keeps the review focused on scope, URL generation, registration timing, and disabled-build behavior. The generated worker source is authored as compact named fragments instead of one large template string, while the emitted worker stays small and newline-free.
What Works After This PR
Enabled production apps register an offline navigation service worker. Disabled apps do not register or emit it.
What Does Not Work Yet
The service worker does not cache fallback assets, serve fallback documents, or participate in router replay yet.
Reviewer Focus
Please focus on the registration boundary, service worker scope, static serving path, generated worker source shape, and whether disabled builds avoid exposing the worker.
Proof in This PR
Service worker registration and emitted script assertions are covered by:
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.tsThe test also asserts the pass-through worker output remains newline-free and under its byte budget.
Deferred Coverage
Fallback and static asset caching starts in PR 4. Offline document fallback serving starts in PR 5. Client router persistence and replay start in PRs 6-8.
Docs Status
The user-facing guide and config reference land in PR 10.