Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[next] Ensure all static routes have static streaming lambda path #11259

Merged

Conversation

wyattjoh
Copy link
Member

@wyattjoh wyattjoh commented Mar 12, 2024

When there's a match for a prerender, the dynamic query parameters will not be provided via the x-now-route-matches. This ensures that when generating any static route that the static streaming lambda path is used if it's provided, ensuring that when a page is generated via generateStaticParams:

// app/blog/[slug]/page.tsx

type Props = {
  params: {
    slug: string
  }
}

export function generateStaticParams() {
  return [{ slug: "one" }, { slug: "two" }, { slug: "three" }]
}

export default function BlogPage({ slug }: Props) {
  // ...
}

That we use the specific routes (/blog/one, /blog/two, and /blog/three) for the partial prerendering streaming path instead of the paramatarized pathname (/blog/[slug]) as the rewrites won't be matched once a match for a prerender has been found.

This additionally updates the tests to ensure that the correct pathname is observed (this was previously silently failing).

Copy link

changeset-bot bot commented Mar 12, 2024

🦋 Changeset detected

Latest commit: 163d151

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

@wyattjoh
Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @wyattjoh and the rest of your teammates on Graphite Graphite

@wyattjoh wyattjoh changed the title fix: ensure all static routes have filled route for experimentalStreamingLambdaPath [next] Ensure all static routes have static streaming lambda path Mar 12, 2024
@wyattjoh wyattjoh force-pushed the wyattjohnson/next-2210-rewrites-not-working-as-expected branch from a35c6b2 to d1c1921 Compare March 12, 2024 04:37
@wyattjoh wyattjoh force-pushed the wyattjohnson/next-2210-rewrites-not-working-as-expected branch from d1c1921 to b4854a5 Compare March 12, 2024 04:39
@wyattjoh wyattjoh force-pushed the wyattjohnson/next-2210-rewrites-not-working-as-expected branch from b4854a5 to 923399c Compare March 12, 2024 23:55
@wyattjoh wyattjoh marked this pull request as ready for review March 13, 2024 13:36
@wyattjoh wyattjoh force-pushed the wyattjohnson/next-2210-rewrites-not-working-as-expected branch from 923399c to 163d151 Compare March 14, 2024 16:34
@wyattjoh wyattjoh added the pr: automerge Automatically merge the PR when checks pass label Mar 14, 2024
@wyattjoh wyattjoh merged commit 4bca0c6 into main Mar 14, 2024
114 checks passed
@wyattjoh wyattjoh deleted the wyattjohnson/next-2210-rewrites-not-working-as-expected branch March 14, 2024 18:37
EndangeredMassa pushed a commit that referenced this pull request Mar 15, 2024
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/build-utils@7.9.1

### Patch Changes

- Export `getSupportedNodeVersion`
([#11277](#11277))

## vercel@33.6.1

### Patch Changes

- Don't send `projectSettings.nodeVersion` for unsupported versions
([#11277](#11277))

- Updated dependencies
\[[`4bca0c6d0`](4bca0c6),
[`a67ad4b5a`](a67ad4b),
[`11218a179`](11218a1),
[`64b97bf4b`](64b97bf)]:
    -   @vercel/next@4.1.6
    -   @vercel/remix-builder@2.1.4
    -   @vercel/build-utils@7.9.1
    -   @vercel/static-build@2.4.4
    -   @vercel/node@3.0.24

## @vercel/client@13.1.7

### Patch Changes

- Updated dependencies
\[[`11218a179`](11218a1)]:
    -   @vercel/build-utils@7.9.1

## @vercel/gatsby-plugin-vercel-builder@2.0.22

### Patch Changes

- Updated dependencies
\[[`11218a179`](11218a1)]:
    -   @vercel/build-utils@7.9.1

## @vercel/next@4.1.6

### Patch Changes

- Ensure that static PPR pages have static streaming lambda paths.
([#11259](#11259))

## @vercel/node@3.0.24

### Patch Changes

- Updated dependencies
\[[`11218a179`](11218a1)]:
    -   @vercel/build-utils@7.9.1

## @vercel/remix-builder@2.1.4

### Patch Changes

- Disable `prepareCache()` npm install for Remix + Vite
([#11281](#11281))

## @vercel/static-build@2.4.4

### Patch Changes

- [framework-fixtures]: Bump the core group in
/packages/static-build/test/fixtures/angular-v17 with 15 updates
([#11274](#11274))

-   Updated dependencies \[]:
    -   @vercel/gatsby-plugin-vercel-builder@2.0.22

## @vercel-internals/types@1.0.27

### Patch Changes

- Updated dependencies
\[[`11218a179`](11218a1)]:
    -   @vercel/build-utils@7.9.1

Co-authored-by: github-actions[bot] <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
pr: automerge Automatically merge the PR when checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants