Skip to content

Conversation

wyattjoh
Copy link
Member

@wyattjoh wyattjoh commented Aug 1, 2025

Summary

This PR improves the handling of fallback root parameters by introducing a hasFallbackRootParams flag to simplify route regex generation and enhance prerender manifest processing.

Changes

  • Add hasFallbackRootParams flag to RoutesManifestRoute type for better type safety
  • Simplify route regex generation when hasFallbackRootParams is true by using a more direct .rsc suffix
  • Update prerender manifest handling for both fallback and blocking fallback routes
  • Improve conditional logic for fallback root params processing in the prerender route handler

Test plan

  • Verify existing tests pass
  • Test route generation with and without fallback root params
  • Validate prerender manifest structure includes new fields

Related Pull Request: vercel/next.js#82282

…tParams flag

- Add hasFallbackRootParams flag to RoutesManifestRoute type
- Simplify route regex generation when hasFallbackRootParams is true
- Update prerender manifest handling for fallback routes
- Improve conditional logic for fallback root params processing
@wyattjoh wyattjoh enabled auto-merge August 1, 2025 19:16
Copy link

changeset-bot bot commented Aug 1, 2025

🦋 Changeset detected

Latest commit: 1df01af

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@vercel/next Minor
vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

wyattjoh added a commit to vercel/next.js that referenced this pull request Aug 1, 2025
…es (#82282)

### 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
@wyattjoh wyattjoh added this pull request to the merge queue Aug 1, 2025
Merged via the queue into main with commit e9ef3b8 Aug 1, 2025
151 checks passed
@wyattjoh wyattjoh deleted the feat/improve-fallback-root-params-handling branch August 1, 2025 19:34
github-merge-queue bot pushed a commit that referenced this pull request Aug 2, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## vercel@44.7.0

### Minor Changes

- Make framework detection text prettier
([#13654](#13654))

### Patch Changes

- Improve non-debug error log for user fetch
([#13657](#13657))

- Updated dependencies
\[[`e9ef3b82c7093ac750173fc2a2d2747ba25f6c78`](e9ef3b8),
[`b1993ee3af72d12859bbc621744b687fbc968a1b`](b1993ee)]:
    -   @vercel/next@4.11.0
    -   @vercel/hono@0.0.8
    -   @vercel/node@5.3.10

## @vercel/next@4.11.0

### Minor Changes

- Improve fallback root params handling with hasFallbackRootParams flag
([#13653](#13653))

- Add hasFallbackRootParams flag to RoutesManifestRoute type for
simplified route regex generation
- Update route handling logic to conditionally apply fallback root
params processing
- Enhance prerender manifest structure with fallback root params support

## @vercel/frameworks@3.7.6

### Patch Changes

- Fix issue where .mjs files weren't transpiled properly for Hono
([#13658](#13658))

## @vercel/fs-detectors@5.4.12

### Patch Changes

- Updated dependencies
\[[`b1993ee3af72d12859bbc621744b687fbc968a1b`](b1993ee)]:
    -   @vercel/frameworks@3.7.6

## @vercel/hono@0.0.8

### Patch Changes

- Fix issue where .mjs files weren't transpiled properly for Hono
([#13658](#13658))

- Updated dependencies
\[[`b1993ee3af72d12859bbc621744b687fbc968a1b`](b1993ee)]:
    -   @vercel/node@5.3.10

## @vercel/node@5.3.10

### Patch Changes

- Fix issue where .mjs files weren't transpiled properly for Hono
([#13658](#13658))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants