Skip to content

Conversation

@austinderek
Copy link
Owner

What?

Add support for generating prefetch segment data routes for pages with fallback root parameters.

Why?

When routes have fallback root parameters but no segment paths, the prefetch system wasn't generating the necessary rewrite rules. This caused client-side navigation to fail for these routes because the /_tree requests couldn't be properly rewritten to the prefetch RSC route.

How?

  • Add hasFallbackRootParams flag and prefetchSegmentDataRoutes to ManifestRoute type
  • Generate inverse prefetch segment data routes for /_tree path when routes have fallback root params
  • Set flag to simplify route regex matching for these routes

Related Pull Request: vercel/vercel#13653


🔄 This is a mirror of upstream PR #82282

- Add hasFallbackRootParams flag to ManifestRoute type
- Add prefetchSegmentDataRoutes property to ManifestRoute type
- Import buildInversePrefetchSegmentDataRoute function
- Handle routes with fallback root params in build process
- Generate inverse prefetch segment data routes for /_tree requests
@staging
Copy link

staging bot commented Aug 1, 2025

✅ This pull request was succesfully scanned and it was determined that it does not contain any changes that present immediate security concerns. If you would still like for it to be reviewed by an expert from our reviewer community, you can submit it manually via the HackerOne PullRequest dashboard.

⏱️ Latest scan covered changes up to commit 3a75a65 (latest)

@austinderek austinderek closed this Aug 1, 2025
@austinderek austinderek deleted the feat/prefetch-segment-data-fallback-params branch August 1, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants