Repository navigation
refactor(router): S9 follow-ups: plain walker names, differential coverage, dead RouterContext fields (rango-t162) - #1279
Merged
Conversation
…elds (rango-t162) RouterContext declared four optional fields that nothing sets or reads: resolveAllSegmentsGenerator, collectSegmentsFromGenerator, resolveAllSegmentsWithRevalidationGenerator and collectWithMarkers. They are leftovers of a generator-based pipeline that predates the single segment walker. A search of the whole repo (source, tests, docs, skills, e2e apps, examples) finds them only in their own declarations. resolveAllSegmentsWithRevalidationGenerator goes too: its plain name after the walker rename would be resolveAllSegmentsGenerator. Type-only change on an @internal type; no behaviour change.
…alker's functions (rango-t162) The revalidating walker is the only segment walker since S9 deleted the fresh one, so the suffix no longer names one of two variants. Plain names, one mechanical rename: resolveAllSegmentsWithRevalidation -> resolveAllSegments resolveSegmentWithRevalidation -> resolveSegment resolveEntryHandlerWithRevalidation -> resolveEntryHandler resolveOrphanLayoutWithRevalidation -> resolveOrphanLayout resolveParallelSegmentsWithRevalidation -> resolveParallelSegments resolveLoadersOnlyWithRevalidation -> resolveLoadersOnly The RouterContext fields resolveAllSegmentsWithRevalidation and resolveLoadersOnlyWithRevalidation (an @internal type) follow, with every caller, test, bench, doc and skill; docs/archive keeps the names it was written against. No plain name was in use; none of the names is exported from a public entry point or @rangojs/router/testing. The segment-resolution middleware's flow diagram now shows one walker with a FRESH or a partial pass, and the three docstrings that said "with revalidation" describe what each function resolves. No behaviour change.
…the walker differential (rango-t162) S9 kept several full-match behaviours as explicit FRESH branches of the walker, but the differential compared segments only, so dropping any of them passed. Each walk now records what it reports beside its segments: the handler perf metrics (track()), the rango.handler spans (observeSegmentHandler), the streamed-Response warnings (warnOnStreamedResponse) and every other console.warn. Each case pins how the FRESH and the partial pass differ there, under named exceptions: - slot handler metered, slot handler span: a FRESH slot handler is metered and runs in its span; a partial pass does neither. - slot Response warning: a partial pass warns on a streamed slot's Response; FRESH does not. - orphan handler metered: FRESH meters an orphan layout's handler. - static hit metered: a partial pass meters a route's static hit as a handler run; FRESH does not. - void layout: FRESH keeps a void layout handler's undefined component; a partial pass normalizes it to null. A route whose handler the partial pass never runs (under an intercept, a build-time loader error) is metered and spanned by FRESH only, filed under the existing exception. Three routes join the fixture, after the existing ones so no short code moves: a void layout, a Static() route and a slot that returns a Response under loading(). The Static() route hits the real static store through a __STATIC_MANIFEST entry; only the Flight runtime, which does not run in this config, is stubbed (the shared pluginRscMock, decoding JSON). Each branch, forced to the partial pass's behaviour, fails the suite (6, 6, 2, 6, 2 and 2 tests); the suite before this change passes all six.
This was referenced Oct 24, 2026
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.
devcorner: rango-t162 · session rango-s375
Summary
Three S9 follow-ups, one commit each, in this order, no behaviour change:
refactor(router): four deadRouterContextfields are removed (ticket item 3, first so the rename has no collision).refactor(router): the segment walker's functions lose theWithRevalidationsuffix (item 1).test(router): the walker differential pins the FRESH branches it could not see: handler metering and spans for slots and orphans, the slot streamed-Response warning, the static-hit metering and the void-layoutundefined(item 2).Problem statement
S9 (#1244) made the revalidating walker the only segment walker, so the suffix on
resolveAllSegmentsWithRevalidationand its siblings now reads as one of two variants that no longer exist. S9 also kept several full-match behaviours as explicitpass.client === FRESHbranches, butwalker-differential.test.tscompared segments only: deleting any of the reporting branches, or the void-layout branch, left the suite green.RouterContextstill declared generator-based resolution fields from before the single walker that nothing sets or reads.Nothing consumer-visible changes.
RouterContextis type-exported from the@internal@rangojs/router/__internalsubpath; its fieldsresolveAllSegmentsWithRevalidationandresolveLoadersOnlyWithRevalidationbecomeresolveAllSegmentsandresolveLoadersOnly, and the optional fieldsresolveAllSegmentsGenerator,collectSegmentsFromGenerator,resolveAllSegmentsWithRevalidationGeneratorandcollectWithMarkersare removed. No repo app imports them.Before / after (internal shape)
resolveAllSegmentsWithRevalidationresolveAllSegmentsresolveSegmentWithRevalidationresolveSegmentresolveEntryHandlerWithRevalidationresolveEntryHandlerresolveOrphanLayoutWithRevalidationresolveOrphanLayoutresolveParallelSegmentsWithRevalidationresolveParallelSegmentsresolveLoadersOnlyWithRevalidationresolveLoadersOnlyRouterContext.resolveAllSegmentsWithRevalidation/.resolveLoadersOnlyWithRevalidationRouterContext.resolveAllSegments/.resolveLoadersOnlyRouterContext.resolveAllSegmentsGenerator,.collectSegmentsFromGenerator,.resolveAllSegmentsWithRevalidationGenerator,.collectWithMarkersNo plain name was in use before the rename (
git grep -wover the repo matched onlydocs/archive/cf-cache-store.md, which describes the deleted fresh walker under the same names; the archive keeps the names it was written against). None of the six functions is exported from a public entry point or@rangojs/router/testing.The differential now records, per walk, what the walk reports beside its segments, and pins how the two passes differ there:
Code-change summary
src/router/router-context.ts: four dead optional fields removed (commit 1).resolveAllSegmentsWithRevalidationGeneratorgoes with them because its plain name would beresolveAllSegmentsGenerator, the other dead field.src/router/segment-resolution/revalidation.ts, the barrelsrc/router/segment-resolution.ts,segment-wrappers.ts,router.ts,router-context.ts,prerender-match.ts,match-middleware/{segment-resolution,cache-lookup,background-revalidation}.ts, comments in eight more source files (one an e2e test-app route file), 34 unit, RSC and bench test files, comments in 2 e2e suites, 11 docs and 2 skills. The segment-resolution middleware's flow diagram now shows one walker with a FRESH or a partial pass, and the three docstrings that said "with revalidation" describe what each function resolves.src/router/segment-resolution/__tests__/walker-differential.test.ts(commit 3): each walk runs with the DSL store's metrics on, a span runner on the request context andconsole.warncaptured. New named exceptions:void layout(segments) and, underCase.recorded,slot handler metered,slot handler span,slot Response warning,orphan handler metered,static hit metered. A route whose handler the partial pass never runs (under an intercept, a build-time loader error) is filed under the existingskipped under intercept/build-time loaders. Three fixture routes are appended after the existing ones, so no short code moves: a void layout, aStatic()route and a slot returning aResponseunderloading(). TheStatic()route hits the real static store through a__STATIC_MANIFESTentry; only the Flight runtime, which does not run in the unit config, is stubbed (the sharedpluginRscMock, decoding JSON). Everyconsole.warna walk prints is compared between the passes, the Response warning under its own name.Test plan
walker-differential.test.ts: 48/48 (was 42; 3 new cases on both manifest partitions).Red against each mutation (the FRESH branch forced to the partial pass's behaviour in
revalidation.ts, reverted after), green after:Touched unit files after the rename: 28 files / 672 tests; RSC 2 files / 11 tests.
Gate on the final head (lint, format, typecheck, build, the CI lint
check:*scripts includingcheck:internals,check:docs-api,check:doc-links,check:skills, the skills catalog, route-gen,node --test tools, bundle guards): all pass. Unit: router 567 files / 9374 passed (5 skipped, 6 todo), mini 25, vite-rsc-demo 27, cloudflare-basic 90, shared-e2e 20. RSC: router 95 files / 1150 passed (3 expected fail), cloudflare-basic 39, mini 3, vite-rsc-demo 1.e2e
semantic-matrix(AGENTS.md segment-resolution row): dev 42/42, production 45/45. The dependency projects ran too: smoke 20/20, withsmoke (production) › SSR renders home pageflaky (its first attempt failed in the fixture on a pnpm deps-status error,e2e/fixture.ts:89, and it passed on retry).No other e2e: the change renames, removes unused types and adds unit assertions.
Practices
--deny-warningsand oxfmt clean; oxfmt reflowed four files after the rename shortened lines (one docs table among them).RouterContextfields found two more never set or read (resolveAllSegmentsWithRevalidationGenerator,collectWithMarkers); all four removed. The rename leaves noWithRevalidationidentifier outsidedocs/archive.reorg/stack. Fixed: the differential stubbedconsole.warnbut compared only the Response warning (every warning is compared now); the rename had rewritten an archived design doc into call shapes that never existed (reverted). Left: five findings that are the pinned FRESH/partial divergences themselves (slot metering and spans, the slot Response warning, orphan metering, static-hit metering, a void layout's null on a partial pass, which the client reads as "keep the cached copy"). Each is a behaviour change outside this ticket, recorded on rango-t162 as a finding for follow-up.docs/design/*,packages/rangojs-router/docs/**,skills/cache-guide,skills/ppr);feature-map.mdfollows the rename;feature-file-map.mdnames none of them.check-docs-api,check-doc-links,check-skillsand the skills catalog pass.Notes
git merge-treeagainst the open branches:reorg/t182-intercept-record-targetmerges clean.reorg/t176-late-next-holderconflicts inpackages/rangojs-router/docs/internal/feature-map.md(the "Derived render passes" line), the same conflict it has withreorg/stackitself; this branch's one line there (theresolveOrphanLayoutrename) merges clean. Neither branch adds a use of an old name.