next.js
90861b0f - feat(server): expose requestMeta router helpers and merge fallback context (#91235)

Commit
9 days ago
feat(server): expose requestMeta router helpers and merge fallback context (#91235) ### What? This PR exposes adapter-facing router helpers on `requestMeta` for Node.js entrypoints and updates route modules to merge those request-scoped values with the existing router server context fallback. It also documents the new adapter contract in the `adapterPath` docs. ### Why? When adapters invoke the Node.js handler directly, some router helpers are needed by route handlers but currently only exist behind internal globals. Passing them through `requestMeta` makes those helpers available through the public handler options and still preserves the existing fallback context for the current `relativeProjectDir`. ### How? - add typed `requestMeta` fields for `hostname`, `revalidate`, and `render404` - add a `RouteModule` helper that reads the existing router server context and overlays request-scoped values from `requestMeta` - switch the route-module callsites that read router server context to use the merged result - document how adapters can pass these helpers when calling `handler(req, res, { requestMeta })`
Author
Parents
Loading