Skip to content

[next]: ensure static data routes are used#14770

Merged
ztanner merged 2 commits intomainfrom
ztanner/static-data-routes
Jan 29, 2026
Merged

[next]: ensure static data routes are used#14770
ztanner merged 2 commits intomainfrom
ztanner/static-data-routes

Conversation

@ztanner
Copy link
Copy Markdown
Member

@ztanner ztanner commented Jan 28, 2026

In legacy versions of PPR, the prefetchDataRoute entries would be populated with .prefetch.rsc values containing static RSC payloads. This regressed in cache components, and the only static RSC payloads were in the .segments directory. However, when Next.js triggers a regular RSC request (non-prefetch), either because the prefetch hadn't completed yet or prefetch={false} was configured, we'd route to the empty fallback and trigger a function invocation.

Normally just setting prefetchDataRoute in Next.js would have been sufficient, but with Cache Components, all .rsc outputs contain both a prefetchDataRoute and a dataRoute. Prior to this change, the builder would have created a fallback file containing the payload specified by prefetchDataRoute, but in the PPR dynamic branch it was overwriting that entry with a “dynamic RSC” prerender that has no fallback, which effectively turned the static .rsc into an empty fallback on Vercel. Without this, the new Next signal is ignored and static navigations still trigger dynamic renders on Vercel.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 28, 2026

🦋 Changeset detected

Latest commit: 03a5784

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 Patch
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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 28, 2026

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-p5wfcyku3.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-p5wfcyku3.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 28, 2026

🧪 Unit Test Strategy

Comparing: 9d1e38e03a5784 (view diff)

Strategy: Affected packages only

✅ Only testing packages that have been modified or depend on modified packages.

Affected packages - 2 (5%)
  1. @vercel/next
  2. vercel
Unaffected packages - 39 (95%)
  1. @vercel-internals/get-package-json
  2. @vercel/backends
  3. @vercel/build-utils
  4. @vercel/cervel
  5. @vercel/cli-auth
  6. @vercel/client
  7. @vercel/config
  8. @vercel/detect-agent
  9. @vercel/edge
  10. @vercel/elysia
  11. @vercel/error-utils
  12. @vercel/express
  13. @vercel/fastify
  14. @vercel/firewall
  15. @vercel/frameworks
  16. @vercel/fs-detectors
  17. @vercel/functions
  18. @vercel/gatsby-plugin-vercel-builder
  19. @vercel/go
  20. @vercel/h3
  21. @vercel/hono
  22. @vercel/hydrogen
  23. @vercel/introspection
  24. @vercel/koa
  25. @vercel/nestjs
  26. @vercel/node
  27. @vercel/oidc
  28. @vercel/oidc-aws-credentials-provider
  29. @vercel/python
  30. @vercel/python-analysis
  31. @vercel/redwood
  32. @vercel/related-projects
  33. @vercel/remix-builder
  34. @vercel/routing-utils
  35. @vercel/ruby
  36. @vercel/rust
  37. @vercel/static-build
  38. @vercel/static-config
  39. examples

Results

  • Unit tests: Only affected packages will run unit tests
  • E2E tests: Handled separately (Version Packages PRs or run-e2e-tests label)
  • Type checks: Only affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

@ztanner ztanner force-pushed the ztanner/static-data-routes branch from 06486bb to 03a5784 Compare January 29, 2026 14:19
@ztanner ztanner marked this pull request as ready for review January 29, 2026 14:50
@ztanner ztanner requested review from a team, huozhi, ijjk and timneutkens as code owners January 29, 2026 14:50
@ztanner ztanner merged commit 1bc969a into main Jan 29, 2026
236 of 238 checks passed
@ztanner ztanner deleted the ztanner/static-data-routes branch January 29, 2026 19:20
ztanner pushed a commit that referenced this pull request Jan 29, 2026
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@50.9.4

### Patch Changes

- Updated dependencies
\[[`c0a87e350e67b67e1b8a3610cde16a7d86f931fd`](c0a87e3),
[`1bc969a200180c5828212c43861c7548dbd3e51c`](1bc969a)]:
    -   @vercel/next@4.15.19

## @vercel/next@4.15.19

### Patch Changes

- Revert "[next] Remove 404.html prerenders from functions"
([#14793](#14793))

- ensure static .rsc outputs are served as fallbacks
([#14770](#14770))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
ztanner added a commit to vercel/next.js that referenced this pull request Jan 29, 2026
This restores fast navigations to fully static PPR routes in Cache
Components, even when prefetch hasn’t completed or `prefetch={false}` is
used. In legacy versions of PPR, the `prefetchDataRoute` entries would
be populated with `.prefetch.rsc` values containing static RSC payloads.
This regressed in cache components, and the only static RSC payloads
were in the `.segments` directory. However, when Next.js triggers a
regular RSC request (non-prefetch), either because the prefetch hadn't
completed yet or `prefetch={false}` was configured, we'd route to the
empty fallback and trigger a function invocation.

This restores old behavior of emitting a `.rsc` file for a fully static
route. This information technically also exists in the `.segments`
directory, but it's split into parts, and it's now routed to unless
explicitly done so via the `next-router-segment-prefetch` header. In
addition to emitting the route, this also ensures we set
`prefetchDataRoute` to point to this. This is how the Vercel adapter
knows the file to serve.

An e2e regression test now asserts that `prefetch={false}` navigation
does not wait for a dynamic render. The deploy test will be unblocked
once vercel/vercel#14770 lands.
adriancooney pushed a commit that referenced this pull request Jan 30, 2026
In legacy versions of PPR, the `prefetchDataRoute` entries would be
populated with `.prefetch.rsc` values containing static RSC payloads.
This regressed in cache components, and the only static RSC payloads
were in the `.segments` directory. However, when Next.js triggers a
regular RSC request (non-prefetch), either because the prefetch hadn't
completed yet or `prefetch={false}` was configured, we'd route to the
empty fallback and trigger a function invocation.

Normally just setting `prefetchDataRoute` in Next.js would have been
sufficient, but with Cache Components, all `.rsc` outputs contain both a
`prefetchDataRoute` and a `dataRoute`. Prior to this change, the builder
would have created a fallback file containing the payload specified by
`prefetchDataRoute`, but in the PPR dynamic branch it was overwriting
that entry with a “dynamic RSC” prerender that has no fallback, which
effectively turned the static `.rsc` into an empty fallback on Vercel.
Without this, the new Next signal is ignored and static navigations
still trigger dynamic renders on Vercel.
adriancooney pushed a commit that referenced this pull request Jan 30, 2026
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@50.9.4

### Patch Changes

- Updated dependencies
\[[`c0a87e350e67b67e1b8a3610cde16a7d86f931fd`](c0a87e3),
[`1bc969a200180c5828212c43861c7548dbd3e51c`](1bc969a)]:
    -   @vercel/next@4.15.19

## @vercel/next@4.15.19

### Patch Changes

- Revert "[next] Remove 404.html prerenders from functions"
([#14793](#14793))

- ensure static .rsc outputs are served as fallbacks
([#14770](#14770))

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants