Repository navigation
fix(router): align PPR lane comments, JSDoc and capture warnings with ssr:false - #871
Merged
Merged
Conversation
commit: |
… ssr:false
Only loader(Def, { ssr: false }) bakes at PPR capture since #813/#820. Update the capture diagnostics (bake cost, no usable shell, identity refusal, rejected loader, redirect/notFound refusal) and the cookies()/headers() capture error, which still advised loading() or nested promises. Share one PPR_LANE_HINT. Make resolveLoaderData the canonical statement of the lane rule and point other comments and docs at it. Fix stale JSDoc examples, resolve the #803 conflict leftover in feature-map.md, and register the /shell-cache/guard fixture loader with ssr: false so the identity guard is exercised again.
ivogt
force-pushed
the
docs/ppr-lane-rule-warnings
branch
from
September 23, 2026 11:19
c99fdb3 to
9126a95
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.
Problem
Since #813/#820, only
loader(Def, { ssr: false })bakes into a PPR shell at capture. Every other loader is live: masked at capture, fresh per request, and it needsloading()or an inline<Suspense>above its reader. The dev-time PPR diagnostics were never updated, so a consumer following them was led in the wrong direction:loading()no longer changes the lane, so the loader keeps baking.cookies()/headers()capture error: they suggested moving the read into a nested promise. That still trips the guard, because the promise body runs at capture.loading().docs/internal/feature-map.mdalso carried an unresolved merge-conflict block from feat(ppr): capture scheduling telemetry, bake-cost attribution, inert-store guard #803./shell-cache/guarde2e fixture registered itscookies()-reading loader withoutssr: false. After feat(router)!: loader ssr:false replaces stream:"navigation" #820 that loader is masked at capture, so the test stopped exercising the identity guard. It passed only through the no-boundary MISS.Before / after
The bake-cost warning (
src/rsc/shell-capture.ts):The identity refusal now says: drop
ssr: falseand read underloading()or an inline<Suspense>(a nested promise does not help: its body still runs at capture); in a handler, read in a live loader and consume it withuseLoader.Changes
resolveLoaderDataJSDoc (router/segment-resolution/loader-cache.ts) and in the/pprskill section "The loader lane rule".PPR_LANE_HINTinsrc/rsc/shell-capture-constants.ts, a leaf module, soserver/cookie-store.tsimports it without a cycle.VercelCacheStoreas tag-capable.errorBoundaryreceives only{ error };NamedRoutesexport;rsc-router/*becomes@rangojs/router/*;env/ctx;createLoadertakes one type parameter;cloudflare()needschildEnvironments;Prerenderis unsupported;condition/keyrelative to middleware;scopedReversetypes only local names.docs/internal/feature-map.mdhas the feat(ppr): capture scheduling telemetry, bake-cost attribution, inert-store guard #803 conflict block resolved (one PPR bullet and one PPR/SWR: stale shell snapshots are rejected on partial navigation, rerunning baked handlers and handles #773 bullet, facts checked against src).e2e/semantic-matrix.test.ts: PPR3 comment corrected. No assertion changes./shell-cache/guardfixture:loader(ShellIdentityLoader, { ssr: false }), so the identity guard fires again. The test still expects MISS, now for the documented reason.src/rsc/__tests__/shell-capture.test.ts: assertions follow the new message text and pin "The loader lane rule".No routing or behaviour logic changes. The text of seven diagnostics changes.
Test plan
oxlint --deny-warnings,check:skills,check:docs-api,check:doc-links,check:skills-catalog,check:e2e-bucketingpnpm run typecheck(not run locally)pnpm run test:unit:all:shell-capture.test.tsmessage assertions (not run locally)pnpm --filter @rangojs/router exec playwright test semantic-matrix(the diff touchessegment-resolution/comments)shell-cache"bake-lane loader reading cookies(): capture refused, stays MISS", dev and production. This now exercises the guard again.Notes
LoaderOptions, response-route/middleware reverse anddebugManifesttouch some of the same docs; they will be rebased onto this one./shell-cache/guardchange affects only the fixture's registration. The worker-side refusal warning stays pinned by the unit tests.