Repository navigation
Reorganize client router modules - #97402
Merged
Merged
Conversation
Contributor
Tests PassedCommit: 0644176 |
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
Build Cache
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (10 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 diffpages-api.runtime.dev.jsDiff too large to display pages.runtime.dev.jsDiff too large to display 📎 Tarball URLCommit: 0644176 |
acdlite
marked this pull request as ready for review
August 15, 2026 05:37
acdlite
force-pushed
the
acdlite/reorganize-router-modules
branch
from
August 15, 2026 18:19
10a1c93 to
e8c7d8f
Compare
Pure structural refactor, no behavior changes. This continues some of the clean-up work I've been doing in the client router now that more of the implementation has settled, post-Segment Cache and Instant Navigations. I have two primary motivations here. The first is purely maintainability. The current module structure is a mess, and the naming is misleading when browsing the codebase for the first time. The second motivation is to prepare for an upcoming rewrite of the router queue. There will likely be two simultaneous implementations for a while as the new one settles, so it's extra important the interface into the router queue is well-defined. I want the fork between the two worlds to be as clean as possible. This is a similar approach to the one I took when rewriting the prefetching implementation. Some of the key name changes: - ppr-navigations.ts -> render-tree.ts. This module's responsibility is to create the tree that gets passed into React for rendering, currently called the CacheNode tree. I considered renaming it to cache-node.ts, but I kept it more generic because I have plans to refactor that type soon. - segment-cache/navigation.ts -> app-router-state.ts. This module's responsibility is to compute the next AppRouterState given inputs. It does perform network requests, but it's conceptually a "pure" operation. It doesn't deal with any of the router queueing logic. This is the most reducer-y of the code that still exists, and along with render-tree.ts, it will remain mostly shared between the old and new state machine implementations. - navigator.ts. This is a new module I created to act as the single entry point for router-level operations: push, replace, navigate, traverse, restore, refresh, hmrRefresh. This is the primary place where we'll fork the old and new queue implementations. It's also how we'll ensure the inactive implementation gets dead-code-eliminated properly while the two implementations live side-by-side.
acdlite
force-pushed
the
acdlite/reorganize-router-modules
branch
from
August 15, 2026 18:25
e8c7d8f to
0644176
Compare
gnoff
approved these changes
Aug 15, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Pure structural refactor, no behavior changes.
This continues some of the clean-up work I've been doing in the client router now that more of the implementation has settled, post-Segment Cache and Instant Navigations.
I have two primary motivations here. The first is purely maintainability. The current module structure is a mess, and the naming is misleading when browsing the codebase for the first time.
The second motivation is to prepare for an upcoming rewrite of the router queue. There will likely be two simultaneous implementations for a while as the new one settles, so it's extra important the interface into the router queue is well-defined. I want the fork between the two worlds to be as clean as possible. This is a similar approach to the one I took when rewriting the prefetching implementation.
Some of the key name changes: