Select segment React keys through browser module variants
Use a single createSegmentKey import for layouts and the head. The default implementation uses structural keys on the server, while a .browser.ts variant re-exports the existing concrete router key function. For /products/[slug], the server retains slug|d across prerender and resume, while the browser uses slug|shoe|d so navigation still resets the appropriate subtree.
Compute the layout state key once and reuse it for template, Activity, and dev boundaries. Remove inline server/browser key selection and the separate per-entry React key. Preserve query-only state reuse and browser head keys, and regenerate both Webpack and Turbopack browser-variant alias lists.
Verified with 63 existing unit tests and 43 existing Webpack integration tests across dev and production, including fallback-shell resume/hydration, head search params, back/forward state, template remounting, and standalone/edge output. Full JS build, TypeScript, ESLint, Prettier, and generated Rust formatting pass. Turbopack integration remains unverified locally because the available native binding does not match this checkout; it also needs the regenerated alias list compiled into it.