Generalize the build-time generator work-unit store name (#98891)
## Summary Rename the internal `GenerateStaticParamsStore` work-unit context to `BuildTimeGeneratorStore`, with discriminant `build-time-generator`. Carry the public export name in a required `functionName` field so shared error paths identify the generator that is actually running. This is a behavior-preserving preparatory refactor. `generateStaticParams` remains the only producer. Every consumer retains the same branch, so public-cache support, unavailable request APIs, inherited root parameters, and existing error messages are unchanged. The name describes a build-time generator's execution context rather than one function. For example, another generator that loads configuration through a cached helper should be able to reuse this context without introducing another work-unit variant throughout the framework. Function-specific contexts can be added later if their semantics actually diverge. For example, a generator that calls `headers()` needs an error naming that generator, not an error that always says `generateStaticParams`. The field is set explicitly rather than read from `Function.name`, which may change during bundling. Request APIs, private-cache rejection, revalidation, and rendering invariants use this name. Missing-root-param advice about parent gSP calls remains specific to gSP; other generators report that the value is unavailable in their own scope. This independent prerequisite for #97393 introduces no API or feature flag. The API-specific initializer and its error fixtures live in #97393, so this PR remains independently landable and behavior-preserving for existing gSP users. ## Verification - Existing `generate-static-params-errors`, `app-root-params-getters/generate-static-params`, and `generate-static-params-error` fixtures: all ten production Webpack tests pass, including unchanged error strings and parent root-param behavior. - Existing `use-cache/use-cache.test.ts` static-HTML assertion passes, exercising cached helpers called from gSP in both a page and route handler. - Full bootstrap and TypeScript declaration build pass. <!-- NEXT_JS_LLM -->
Showing
Please
register
or
sign in
to comment