Add SegmentStore for per-segment async local storage - #97218
Draft
acdlite wants to merge 1 commit into
Draft
Conversation
Part of a series of refactors to prepare for encoding params as Server References. No outward behavioral changes yet, just refactoring. Adds a per-request, per-segment storage mechanism: every route segment has its own SegmentStore, keyed by its LoaderTree node — conceptually, as if every route module exported its own store. The stores hang off the WorkUnitStore, so the state they hold is request-scoped. This will primarily be for storing objects related to params. They need to be accessible via the module system so that React can map a Server Reference back to its corresponding segment (eventually, once we land this feature). The first thing we migrate to being tracked on the SegmentStore is the vary params accumulator. In subsequent steps, we'll move search params and params, too.
Contributor
Stats from current PR🔴 4 regressions
📊 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 (22 files)Files with changes:
View diffsapp-page-exp..ntime.dev.jsfailed to diffapp-page-exp..time.prod.jsDiff too large to display app-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsDiff too large to display app-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsDiff too large to display app-page.runtime.dev.jsfailed to diffapp-page.runtime.prod.jsfailed to diffapp-route-ex..ntime.dev.jsDiff too large to display app-route-ex..time.prod.jsDiff too large to display app-route-tu..ntime.dev.jsDiff too large to display app-route-tu..time.prod.jsDiff too large to display app-route-tu..ntime.dev.jsDiff too large to display app-route-tu..time.prod.jsDiff too large to display app-route.runtime.dev.jsDiff too large to display app-route.ru..time.prod.jsDiff too large to display pages-api.ru..time.prod.jsDiff too large to display pages.runtime.prod.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display 📎 Tarball URLCommit: e47a496 |
Contributor
Tests PassedCommit: e47a496 |
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.
Part of a series of refactors to prepare for encoding params as Server References. No outward behavioral changes yet, just refactoring.
Adds a per-request, per-segment storage mechanism: every route segment has its own SegmentStore, keyed by its LoaderTree node — conceptually, as if every route module exported its own store. The stores hang off the WorkUnitStore, so the state they hold is request-scoped.
This will primarily be for storing objects related to params. They need to be accessible via the module system so that React can map a Server Reference back to its corresponding segment (eventually, once we land this feature).
The first thing we migrate to being tracked on the SegmentStore is the vary params accumulator. In subsequent steps, we'll move search params and params, too.