Commit Graph

487 Commits

Author SHA1 Message Date
Zack Tanner
b735f37fd9 [next]: ensure unmatched rsc rewrites are routed to correct handler (#11688)
Same reasoning as:

- https://github.com/vercel/vercel/pull/11686

Split this into a separate PR so it can be tested/released separately.
2024-06-04 18:52:44 +00:00
Vercel Release Bot
d91f3afcbf Version Packages (#11689)
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@34.2.5

### Patch Changes

- Adds a route for the `.rsc` pathname as well when app has ppr enabled
but not all routes.
([#11681](https://github.com/vercel/vercel/pull/11681))

- Updated dependencies
\[[`7457767a7`](7457767a77),
[`4337ea065`](4337ea0654)]:
    -   @vercel/next@4.2.15

## @vercel/fs-detectors@5.2.4

### Patch Changes

- Add support for detecting Turborepo 2
([#11680](https://github.com/vercel/vercel/pull/11680))

## @vercel/next@4.2.15

### Patch Changes

- ensure unmatched action rewrites are routed to correct handler
([#11686](https://github.com/vercel/vercel/pull/11686))

- Adds a route for the `.rsc` pathname as well when app has ppr enabled
but not all routes.
([#11681](https://github.com/vercel/vercel/pull/11681))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-04 11:29:56 -07:00
Zack Tanner
7457767a77 [next]: ensure unmatched action rewrites are routed to correct handler (#11686)
User defined rewrites are "normalized" so that our internal rewrites are still properly handled. Before normalizing these rewrites, the Next.js builder will attempt to match server action requests to a`.action` variant. Then the user-defined rewrites flow through the afterFiles normalization ([this part](https://github.com/vercel/vercel/blob/fix/unmatched-action-rewrites/packages/next/src/server-build.ts#L254-L279)) so that when we add `.action` in the builder, we don't drop the suffix. 

But this normalization can lead to a malformed `dest`. e.g., if I had rewrite like this:

```js
{
  source: '/greedy-rewrite/static/:path*',
  destination: '/static/:path*',
}
```

The builder would go through this flow on an action request to `/greedy-rewrite/static`:

1. It'll attempt to match it to a `.action` output, so `/greedy-rewrite/static` -> `/greedy-rewrite/static.action`
2. The afterFiles normalization will take place, so the original `dest` of `/static/$1` will become `/static/$1$rscsuff`
3. $1 will be an empty string, because it doesn't match the existing capture group. So now `/greedy-rewrite/static.action` -> `/greedy-rewrite/static/.action`
4. `static/.action` is not a valid output, so it'll 404 and the action will break. 

Existing handling exists for `.rsc` outputs for a similar reason, but only on the index route. I added a similar fix for this in #11688.
2024-06-04 18:05:11 +00:00
Wyatt Johnson
4337ea0654 [ppr] Add missng .rsc route for non-ppr enabled pages (#11681)
When deploying partial prerendering (PPR), there may some pages that are
not enabled for PPR but still appear in the `prerender-manifest.json`.
Due to the branching of the client router, these routes also have to
have a `.rsc` as well as a `.prefetch.rsc` variants in order to prevent
404's. This change adds support for adding the extra route to the
prerender for pages that have PPR disabled.
2024-06-03 17:52:30 -07:00
Vercel Release Bot
a26cbd8199 Version Packages (#11674)
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/python@4.3.0

### Minor Changes

- support newer python versions
([#11675](https://github.com/vercel/vercel/pull/11675))

## @vercel/build-utils@8.2.1

### Patch Changes

- [node] update node@16 deprecation day
([#11671](https://github.com/vercel/vercel/pull/11671))

## vercel@34.2.4

### Patch Changes

- Updated dependencies
\[[`3eb9d8c89`](3eb9d8c892),
[`83741a0eb`](83741a0eb9)]:
    -   @vercel/python@4.3.0
    -   @vercel/build-utils@8.2.1
    -   @vercel/node@3.1.6
    -   @vercel/static-build@2.5.10

## @vercel/client@13.2.8

### Patch Changes

- Updated dependencies
\[[`83741a0eb`](83741a0eb9)]:
    -   @vercel/build-utils@8.2.1

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

### Patch Changes

- Updated dependencies
\[[`83741a0eb`](83741a0eb9)]:
    -   @vercel/build-utils@8.2.1

## @vercel/node@3.1.6

### Patch Changes

- Updated dependencies
\[[`83741a0eb`](83741a0eb9)]:
    -   @vercel/build-utils@8.2.1

## @vercel/static-build@2.5.10

### Patch Changes

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

## @vercel-internals/types@1.0.37

### Patch Changes

- Updated dependencies
\[[`83741a0eb`](83741a0eb9)]:
    -   @vercel/build-utils@8.2.1

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-30 14:00:25 -05:00
Vercel Release Bot
af29e9be49 Version Packages (#11648)
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@34.2.3

### Patch Changes

- Don't create streaming lambdas for pages router routes
([#11660](https://github.com/vercel/vercel/pull/11660))

- Updated dependencies
\[[`c9d53d4e3`](c9d53d4e3e),
[`5f561f8cf`](5f561f8cfa)]:
    -   @vercel/next@4.2.14

## @vercel/next@4.2.14

### Patch Changes

- Don't create streaming lambdas for pages router routes
([#11660](https://github.com/vercel/vercel/pull/11660))

- Ensure user rewrites still match to action outputs
([#11628](https://github.com/vercel/vercel/pull/11628))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-24 15:19:28 -07:00
Wyatt Johnson
c9d53d4e3e [next] Ensure only pages enable streaming (#11660)
This fixes a regression introduced by #11625 that enabled streaming for
routes on the pages router (these routes do not support streaming).
2024-05-24 15:15:32 -07:00
Zack Tanner
5f561f8cfa [next]: ensure user rewrites match to action outputs (#11628)
The builder normalizes user rewrites that target pages that have special outputs (`.rsc`, `.prefetch.rsc`). When we added support for `.action` outputs, we need to perform this same normalization to ensure that user rewrites still match. If the rewrite was a greedy match (eg `/:path*`) it'd be ok, but more specific rewrites would have the issue.
2024-05-23 19:06:25 +00:00
Vercel Release Bot
6529a9ab9c Version Packages (#11637)
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@34.2.2

### Patch Changes

- Fix related to erroring when a prefetch route is not provided but the
route is PPR enabled
([#11638](https://github.com/vercel/vercel/pull/11638))

- Updated dependencies
\[[`8e44ef5b9`](8e44ef5b9d),
[`61e6af374`](61e6af3740)]:
    -   @vercel/next@4.2.13

## @vercel/next@4.2.13

### Patch Changes

- Fix static case for detecting when a page supports PPR
([#11635](https://github.com/vercel/vercel/pull/11635))

- Fix related to erroring when a prefetch route is not provided but the
route is PPR enabled
([#11638](https://github.com/vercel/vercel/pull/11638))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-23 10:33:01 +02:00
Wyatt Johnson
61e6af3740 [ppr] Fix for error case involving prefetch data routes (#11638)
Only error when the prefetch data route is present but the route also
has PPR enabled.
2024-05-23 10:28:05 +02:00
Wyatt Johnson
8e44ef5b9d [ppr] Fix static case (#11635)
When PPR is enabled in incremental mode, the previous code used the page information to determine if there was a failure for generating the flight data. This has been moved to the app PPR setting instead.
2024-05-23 05:23:26 +00:00
Wyatt Johnson
fe9e27c459 chore: bump react version (#11636) 2024-05-23 05:14:10 +00:00
Vercel Release Bot
8a6dc204fd Version Packages (#11634)
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@34.2.1

### Patch Changes

- Support incremental PPR for large applications
([#11625](https://github.com/vercel/vercel/pull/11625))

- Updated dependencies
\[[`73e558913`](73e558913a)]:
    -   @vercel/next@4.2.12

## @vercel/next@4.2.12

### Patch Changes

- Support incremental PPR for large applications
([#11625](https://github.com/vercel/vercel/pull/11625))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-22 21:14:01 -07:00
Wyatt Johnson
73e558913a [ppr] Fix PPR detection for groups (#11625)
Previously, PPR was either all on, or all off. As we've added support for incremental adoption of PPR, the logic for determining if there's a grouping issue had to be adjusted.

This now only considers a group as supporting PPR if a route in the group supports PPR. As we also use this as a grouping key, this still ensures we won't have conflicts.
2024-05-23 04:06:12 +00:00
Wyatt Johnson
464cb26255 chore: bump react versions (#11632) 2024-05-22 19:45:03 -07:00
Zack Tanner
80e0bab0ec [next] Fix Next.js tests (#11610)
Syncs the experimental React dependency to avoid build errors. 

This was updated in:
- https://github.com/vercel/next.js/pull/65864
2024-05-17 22:24:53 +00:00
Vercel Release Bot
1eb76a3ae7 Version Packages (#11598)
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@8.2.0

### Minor Changes

- fix corepack detection for package manager version determination
([#11596](https://github.com/vercel/vercel/pull/11596))

### Patch Changes

- Fix triggering of ignored project settings node version warning
([#11550](https://github.com/vercel/vercel/pull/11550))

## vercel@34.2.0

### Minor Changes

- Stop sending system environment variables in dev
([#11526](https://github.com/vercel/vercel/pull/11526))

### Patch Changes

- Updated dependencies
\[[`d3c1267e2`](d3c1267e24),
[`ccd7eb1fb`](ccd7eb1fb7)]:
    -   @vercel/build-utils@8.2.0
    -   @vercel/node@3.1.5
    -   @vercel/static-build@2.5.9

## @vercel/client@13.2.7

### Patch Changes

- Updated dependencies
\[[`d3c1267e2`](d3c1267e24),
[`ccd7eb1fb`](ccd7eb1fb7)]:
    -   @vercel/build-utils@8.2.0

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

### Patch Changes

- Updated dependencies
\[[`d3c1267e2`](d3c1267e24),
[`ccd7eb1fb`](ccd7eb1fb7)]:
    -   @vercel/build-utils@8.2.0

## @vercel/node@3.1.5

### Patch Changes

- Updated dependencies
\[[`d3c1267e2`](d3c1267e24),
[`ccd7eb1fb`](ccd7eb1fb7)]:
    -   @vercel/build-utils@8.2.0

## @vercel/static-build@2.5.9

### Patch Changes

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

## @vercel-internals/types@1.0.36

### Patch Changes

- Updated dependencies
\[[`d3c1267e2`](d3c1267e24),
[`ccd7eb1fb`](ccd7eb1fb7)]:
    -   @vercel/build-utils@8.2.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-15 14:26:56 -05:00
Sean Massa
ccd7eb1fb7 fix corepack detection for package manager version determination (#11596)
The previous logic was checking for the env var `ENABLE_EXPERIMENTAL_COREPACK` to determine if corepack was being used by a project. However, this value only means that the build system should consider corepack, not that it's actively being used.

We need to check that flag AND the existence of a `packageManager` property in the project's `package.json`.
2024-05-15 19:25:01 +00:00
Vercel Release Bot
f78b315a50 Version Packages (#11595)
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@8.1.3

### Patch Changes

- [build-utils] log more around package manager detection
([#11594](https://github.com/vercel/vercel/pull/11594))

## vercel@34.1.14

### Patch Changes

- Updated dependencies
\[[`ad6945435`](ad69454352)]:
    -   @vercel/build-utils@8.1.3
    -   @vercel/node@3.1.4
    -   @vercel/static-build@2.5.8

## @vercel/client@13.2.6

### Patch Changes

- Updated dependencies
\[[`ad6945435`](ad69454352)]:
    -   @vercel/build-utils@8.1.3

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

### Patch Changes

- Updated dependencies
\[[`ad6945435`](ad69454352)]:
    -   @vercel/build-utils@8.1.3

## @vercel/node@3.1.4

### Patch Changes

- Updated dependencies
\[[`ad6945435`](ad69454352)]:
    -   @vercel/build-utils@8.1.3

## @vercel/static-build@2.5.8

### Patch Changes

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

## @vercel-internals/types@1.0.35

### Patch Changes

- Updated dependencies
\[[`ad6945435`](ad69454352)]:
    -   @vercel/build-utils@8.1.3

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-13 17:07:24 -05:00
Vercel Release Bot
14059906d3 Version Packages (#11593)
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@8.1.2

### Patch Changes

- add log to package manager version detection
([#11592](https://github.com/vercel/vercel/pull/11592))

## vercel@34.1.13

### Patch Changes

- Updated dependencies
\[[`1682ad43d`](1682ad43d0)]:
    -   @vercel/build-utils@8.1.2
    -   @vercel/node@3.1.3
    -   @vercel/static-build@2.5.7

## @vercel/client@13.2.5

### Patch Changes

- Updated dependencies
\[[`1682ad43d`](1682ad43d0)]:
    -   @vercel/build-utils@8.1.2

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

### Patch Changes

- Updated dependencies
\[[`1682ad43d`](1682ad43d0)]:
    -   @vercel/build-utils@8.1.2

## @vercel/node@3.1.3

### Patch Changes

- Updated dependencies
\[[`1682ad43d`](1682ad43d0)]:
    -   @vercel/build-utils@8.1.2

## @vercel/static-build@2.5.7

### Patch Changes

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

## @vercel-internals/types@1.0.34

### Patch Changes

- Updated dependencies
\[[`1682ad43d`](1682ad43d0)]:
    -   @vercel/build-utils@8.1.2

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-13 14:03:47 -05:00
Vercel Release Bot
423630a168 Version Packages (#11589)
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@8.1.1

### Patch Changes

- [build-utils] pnpm lockfile testing and fixing
([#11591](https://github.com/vercel/vercel/pull/11591))

## vercel@34.1.12

### Patch Changes

- Updated dependencies
\[[`67afc2608`](67afc26085),
[`2f7a6ed5f`](2f7a6ed5f9)]:
    -   @vercel/next@4.2.11
    -   @vercel/build-utils@8.1.1
    -   @vercel/node@3.1.2
    -   @vercel/static-build@2.5.6

## @vercel/client@13.2.4

### Patch Changes

- Updated dependencies
\[[`2f7a6ed5f`](2f7a6ed5f9)]:
    -   @vercel/build-utils@8.1.1

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

### Patch Changes

- Updated dependencies
\[[`2f7a6ed5f`](2f7a6ed5f9)]:
    -   @vercel/build-utils@8.1.1

## @vercel/next@4.2.11

### Patch Changes

- normalize source file locations for special metadata files
([#11579](https://github.com/vercel/vercel/pull/11579))

## @vercel/node@3.1.2

### Patch Changes

- Updated dependencies
\[[`2f7a6ed5f`](2f7a6ed5f9)]:
    -   @vercel/build-utils@8.1.1

## @vercel/static-build@2.5.6

### Patch Changes

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

## @vercel-internals/types@1.0.33

### Patch Changes

- Updated dependencies
\[[`2f7a6ed5f`](2f7a6ed5f9)]:
    -   @vercel/build-utils@8.1.1

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-13 13:18:24 -05:00
Zack Tanner
67afc26085 [next]: normalize source path for special app-dir metadata files (#11579)
When specifying a functions configuration in `vercel.json`, we attempt to find source files for all entrypoints.  This attempts to normalize those source paths for some special cases so that we don't show a build warning for completely normal usage.

- `/_not-found` is an entrypoint automatically inserted by Next.js -- if we don't find a source file for it, don't warn, as the user might not have added one
- special metadata files like `favicon.ico` and `opengraph-image.<ext>` will be bundled as `favicon.ico/route.js` but the source file will be the raw extension.
2024-05-13 16:04:16 +00:00
Vercel Release Bot
c224fb1d2e Version Packages (#11584)
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@8.1.0

### Minor Changes

- Update pnpm version detection logic
([#11445](https://github.com/vercel/vercel/pull/11445))
    Add support for pnpm 9

## vercel@34.1.11

### Patch Changes

- Updated dependencies
\[[`5014b1e82`](5014b1e82a),
[`18d1703d5`](18d1703d5b),
[`e87d4c14d`](e87d4c14d0),
[`bc5fd4115`](bc5fd41158)]:
    -   @vercel/build-utils@8.1.0
    -   @vercel/next@4.2.10
    -   @vercel/redwood@2.0.9
    -   @vercel/remix-builder@2.1.6
    -   @vercel/node@3.1.1
    -   @vercel/static-build@2.5.5

## @vercel/client@13.2.3

### Patch Changes

- Updated dependencies
\[[`5014b1e82`](5014b1e82a)]:
    -   @vercel/build-utils@8.1.0

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

### Patch Changes

- Updated dependencies
\[[`5014b1e82`](5014b1e82a)]:
    -   @vercel/build-utils@8.1.0

## @vercel/next@4.2.10

### Patch Changes

- skip action rewrites for RSC requests
([#11576](https://github.com/vercel/vercel/pull/11576))

- Bump `@vercel/nft@0.27.0`
([#11580](https://github.com/vercel/vercel/pull/11580))

## @vercel/node@3.1.1

### Patch Changes

- Bump `@vercel/nft@0.27.0`
([#11580](https://github.com/vercel/vercel/pull/11580))

- Updated dependencies
\[[`5014b1e82`](5014b1e82a)]:
    -   @vercel/build-utils@8.1.0

## @vercel/redwood@2.0.9

### Patch Changes

- Bump `@vercel/nft@0.27.0`
([#11580](https://github.com/vercel/vercel/pull/11580))

## @vercel/remix-builder@2.1.6

### Patch Changes

- Bump `@vercel/nft@0.27.0`
([#11580](https://github.com/vercel/vercel/pull/11580))

- Update `@remix-run/dev` fork to v2.9.2-patch.2
([#11582](https://github.com/vercel/vercel/pull/11582))

## @vercel/static-build@2.5.5

### Patch Changes

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

## @vercel-internals/types@1.0.32

### Patch Changes

- Updated dependencies
\[[`5014b1e82`](5014b1e82a)]:
    -   @vercel/build-utils@8.1.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-11 14:36:18 -05:00
Austin Merrick
e87d4c14d0 [node][next][redwood][remix] bump @vercel/nft@0.27.0 (#11580)
[@vercel/nft@0.27.0](https://github.com/vercel/nft/releases/tag/0.27.0) is necessary for parsing import assertions. Import assertions are causing [this issue](https://github.com/vercel/vercel/issues/11533).
2024-05-10 21:25:40 +00:00
Zack Tanner
18d1703d5b [next]: skip action rewrite if RSC header is present (#11576)
When rewriting requests that contain a `next-action` header to a `.action` output, we should do so only in the case where the RSC header isn't present. When a Next.js server action triggers a `redirect`, an intra-app RSC request will be made to that requested URL, with the `next-action` header still present. This means the intra-app request will be incorrectly rewritten, when we only intended to handle the actual action request.

This was patched in Next.js in the following PR:
- https://github.com/vercel/next.js/pull/65615

But it seems like a good idea to be resilient to this here as well.
2024-05-10 21:09:56 +00:00
Vercel Release Bot
f4ba9cdcf8 Version Packages (#11564)
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@34.1.10

### Patch Changes

- Updated dependencies
\[[`119f80e96`](119f80e961),
[`11584b0e9`](11584b0e9b),
[`3023122d4`](3023122d4e),
[`0e774b6be`](0e774b6be0)]:
    -   @vercel/next@4.2.9
    -   @vercel/static-build@2.5.4

## @vercel/next@4.2.9

### Patch Changes

- Support incremental partial prerendering
([#11560](https://github.com/vercel/vercel/pull/11560))

- ensure `.action` outputs are created for edge functions
([#11568](https://github.com/vercel/vercel/pull/11568))

-   ([#11566](https://github.com/vercel/vercel/pull/11566))

## @vercel/static-build@2.5.4

### Patch Changes

- Fix `Cannot read properties of null` error
([#11559](https://github.com/vercel/vercel/pull/11559))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-09 10:03:52 -07:00
Zack Tanner
11584b0e9b [next] ensure action outputs are created for edge functions (#11568)
Since we're rewriting `next-action` requests to `.action` outputs, we need to ensure that we also duplicate the edge function handler for it. 

This runs all of the existing Node runtime tests in the Edge runtime as well. However, there's a discrepancy in how `x-vercel-cache` is returned, so for now we instead validate that its responding with `x-edge-runtime`.
2024-05-09 01:39:08 +00:00
JJ Kasper
3023122d4e [next] Update react version in next fixtures (#11566)
We are locking the peerDependency to react v19 beta on canary so we need to update these fixtures to tolerate that. 

x-ref: [slack thread](https://vercel.slack.com/archives/C048KLPEEH1/p1715191372631389)
x-ref: https://github.com/vercel/next.js/pull/65058
2024-05-08 23:33:24 +00:00
Wyatt Johnson
119f80e961 [next] Support Incremental Partial Prerendering (#11560)
This fixes the logic that detects if partial prerendering (PPR) has been
enabled for a project. The new incremental adoption pathway allows
setting the `experimental.ppr = 'incremental'` which the previous code
did not support.
2024-05-08 08:13:39 -06:00
Vercel Release Bot
6476f4f786 Version Packages (#11551)
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/functions@1.0.0

### Major Changes

- Initial release
([#11553](https://github.com/vercel/vercel/pull/11553))

## @vercel/node@3.1.0

### Minor Changes

- Make waitUntil consistent for Node.js & Edge
([#11553](https://github.com/vercel/vercel/pull/11553))

## vercel@34.1.9

### Patch Changes

- Updated dependencies
\[[`5a532a5b9`](5a532a5b94),
[`50fc27ba5`](50fc27ba57),
[`c1d852295`](c1d8522950),
[`a5ea04154`](a5ea04154b)]:
    -   @vercel/next@4.2.8
    -   @vercel/node@3.1.0

## @vercel/next@4.2.8

### Patch Changes

- Fix missing initial RSC headers
([#11552](https://github.com/vercel/vercel/pull/11552))

- Remove .prefetch.rsc rewrites for non-PPR
([#11540](https://github.com/vercel/vercel/pull/11540))

- [next] rename middleware manifest env
([#11549](https://github.com/vercel/vercel/pull/11549))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-07 15:40:37 +02:00
JJ Kasper
5a532a5b94 [next] Fix missing initial RSC headers (#11552)
While investigating https://github.com/vercel/next.js/issues/59883 we noticed the RSC Prerender did not have all the expected headers like the HTML Prerender which caused unexpected revalidation behavior specifically on client-transition as some of these headers are used to detect if a revalidated tag is associated with specific outputs. 

x-ref: https://github.com/vercel/next.js/issues/59883
2024-05-07 07:43:00 +00:00
Jiachi Liu
c1d8522950 [next] rename middleware manifest env (#11549)
Rename `environment` property to `env` from middleware manifest added in
#11390.
Align with https://github.com/vercel/next.js/pull/64521

The `environments` property wasn't working properly before due to
unfinished next.js changes, it should work now after testing with next
build from https://github.com/vercel/next.js/pull/64521. We change it to
a better naming word `env`.
2024-05-06 21:32:07 +02:00
JJ Kasper
50fc27ba57 [next] Remove .prefetch.rsc rewrites for non-PPR (#11540)
Removes .prefetch.rsc rewrites rules for non-PPR, as Next.js doesn't emit any static prefetches otherwise
2024-05-06 18:17:22 +00:00
Vercel Release Bot
4b0716b556 Version Packages (#11524)
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@34.1.8

### Patch Changes

- Updated dependencies
\[[`52e435aa5`](52e435aa5d),
[`124846a3e`](124846a3e6),
[`dc974b679`](dc974b6797),
[`58c6755e0`](58c6755e0c)]:
    -   @vercel/next@4.2.7
    -   @vercel/static-build@2.5.3

## @vercel/next@4.2.7

### Patch Changes

- Fix missing .rsc outputs for pages prerenders
([#11503](https://github.com/vercel/vercel/pull/11503))

- Fix base path app index RSC handling
([#11528](https://github.com/vercel/vercel/pull/11528))

- Fix interception routes PPR route handling
([#11527](https://github.com/vercel/vercel/pull/11527))

## @vercel/static-build@2.5.3

### Patch Changes

- Support Ruby and Python static site generators in AL2023 build image
([#11529](https://github.com/vercel/vercel/pull/11529))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-03 10:01:03 -07:00
JJ Kasper
124846a3e6 [next] Fix base path app index RSC handling (#11528)
This ensures we properly name the outputs when a basePath is present for the `index` output as previously we weren't properly routing to the RSC output due to nested `index` naming/route conflict. This only was a noticeable issue with prerender/static index outputs with base path and app router since if the index route was dynamic it would still catch the RSC request and just handle it without the correct naming. 

Fixes: https://github.com/vercel/next.js/issues/64903
2024-05-02 21:07:58 +00:00
JJ Kasper
58c6755e0c [next] Fix interception routes PPR route handling (#11527)
This ensures we properly create `.prefetch.rsc` output aliases for non-prerender outputs when PPR is enabled so that we can properly route which handles the interception route case as that is always dynamic so was missing it's `.prefetch.rsc` output causing the prefetch request to 404 unexpectedly. 

x-ref: [slack thread](https://vercel.slack.com/archives/C070ZMMKVU7/p1714511126337289)
2024-05-01 22:40:04 +00:00
JJ Kasper
52e435aa5d Fix missing .rsc outputs for pages prerenders (#11503)
When generating the outputs for pages when app router is also present we weren't creating the placeholder `.rsc` outputs for all prerender outputs so when a `fallback: false` route was configured in the pages router that could fall through to an app route it causes issues with client-navigation behaving differently than a direct visit. 

This ensures we add the placeholder `.rsc` outputs for all prerenders so that `fallback: false` pages don't have this unexpected behavior.
2024-04-30 20:34:41 +00:00
Vercel Release Bot
303256343a Version Packages (#11523)
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@34.1.7

### Patch Changes

- Updated dependencies
\[[`3420ba015`](3420ba0153)]:
    -   @vercel/next@4.2.6

## @vercel/next@4.2.6

### Patch Changes

- [next] Update test fixture version
([#11514](https://github.com/vercel/vercel/pull/11514))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-30 13:09:58 -07:00
Vercel Release Bot
88f3a816d9 Version Packages (#11520)
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@34.1.6

### Patch Changes

- Updated dependencies
\[[`b1adaf76e`](b1adaf76ec),
[`3fb97d1d2`](3fb97d1d27)]:
    -   @vercel/next@4.2.5
    -   @vercel/static-build@2.5.2

## @vercel/next@4.2.5

### Patch Changes

- Only rewrite next-action requests to `.action` handlers
([#11504](https://github.com/vercel/vercel/pull/11504))

## @vercel/static-build@2.5.2

### Patch Changes

- Revert `SUPPORTED_RUBY_VERSION` change to fix Ruby site generators on
AL2 build image ([#11522](https://github.com/vercel/vercel/pull/11522))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-30 13:04:00 -07:00
JJ Kasper
3420ba0153 [next] Update test fixture version (#11514)
Noticed in https://github.com/vercel/vercel/pull/11503 that this test
fixture is incorrectly locked to a specific version when we don't want
it to be.
2024-04-30 13:03:36 -07:00
Zack Tanner
b1adaf76ec [next] Only rewrite next-action requests to .action handlers (#11504)
This only rewrites requests that contain a `next-action` header (explicitly indicating it's a server action). A side effect is that POST requests to a server action on a static route, without a next-action header, won't be marked as streaming (but will still execute normally). This is fine as only the handled action needs to stream. 

This relands .action handling behind a feature flag.
2024-04-30 18:32:54 +00:00
Vercel Release Bot
1bf04ba421 Version Packages (#11512)
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@8.0.0

### Major Changes

- Remove legacy `avoidTopLevelInstall` logic
([#11513](https://github.com/vercel/vercel/pull/11513))

### Patch Changes

- [build-utils] Add `VERCEL_PROJECT_PRODUCTION_URL` framework env var
prefix ([#11506](https://github.com/vercel/vercel/pull/11506))

## @vercel/ruby@2.1.0

### Minor Changes

- Add support for Ruby 3.3
([#11497](https://github.com/vercel/vercel/pull/11497))

- Remove legacy `avoidTopLevelInstall` logic
([#11513](https://github.com/vercel/vercel/pull/11513))

## vercel@34.1.5

### Patch Changes

- Updated dependencies
\[[`763a6d107`](763a6d1070),
[`15475c8a2`](15475c8a2c),
[`21f5e7375`](21f5e7375e)]:
    -   @vercel/ruby@2.1.0
    -   @vercel/build-utils@8.0.0
    -   @vercel/node@3.0.28
    -   @vercel/static-build@2.5.1

## @vercel/client@13.2.2

### Patch Changes

- Updated dependencies
\[[`15475c8a2`](15475c8a2c),
[`21f5e7375`](21f5e7375e)]:
    -   @vercel/build-utils@8.0.0

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

### Patch Changes

- Updated dependencies
\[[`15475c8a2`](15475c8a2c),
[`21f5e7375`](21f5e7375e)]:
    -   @vercel/build-utils@8.0.0

## @vercel/node@3.0.28

### Patch Changes

- Updated dependencies
\[[`15475c8a2`](15475c8a2c),
[`21f5e7375`](21f5e7375e)]:
    -   @vercel/build-utils@8.0.0

## @vercel/static-build@2.5.1

### Patch Changes

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

## @vercel-internals/types@1.0.31

### Patch Changes

- Updated dependencies
\[[`15475c8a2`](15475c8a2c),
[`21f5e7375`](21f5e7375e)]:
    -   @vercel/build-utils@8.0.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-30 09:26:54 -05:00
Vercel Release Bot
256d0fd463 Version Packages (#11511)
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@34.1.4

### Patch Changes

- Updated dependencies
\[[`5b7960337`](5b79603378)]:
    -   @vercel/next@4.2.4

## @vercel/next@4.2.4

### Patch Changes

- [next]&#x3A; Revert .action handling for dynamic routes
([#11509](https://github.com/vercel/vercel/pull/11509))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-29 10:29:48 -05:00
Zack Tanner
5b79603378 Revert "[next] Reland add .action handling for dynamic routes" (#11509)
Reverts vercel/vercel#11487.

This feature will be relanded behind a feature flag.
2024-04-29 10:26:15 -05:00
Vercel Release Bot
21b87d2ee6 Version Packages (#11489)
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@34.1.3

### Patch Changes

- Updated dependencies
\[[`5758838d0`](5758838d09)]:
    -   @vercel/next@4.2.3

## @vercel/next@4.2.3

### Patch Changes

- [next] Reland add .action handling for dynamic routes
([#11487](https://github.com/vercel/vercel/pull/11487))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-25 12:32:46 -05:00
JJ Kasper
5758838d09 [next] Reland add .action handling for dynamic routes (#11487)
This relands https://github.com/vercel/vercel/pull/11461 fixing the
routes increase by combining with the existing route so we don't hit the
routes limit like we did previously.

---------

Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2024-04-24 12:33:16 -07:00
Zack Tanner
9dab15dc88 [next] add tests for server actions (#11482)
There aren't currently any tests for server actions which have special handling in the builder. This adds tests to help avoid regressions in future Next.js builder work.
2024-04-24 18:10:51 +00:00
Vercel Release Bot
3980c60a3e Version Packages (#11471)
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/python@4.2.0

### Minor Changes

- Add support for Python 3.12
([#11478](https://github.com/vercel/vercel/pull/11478))

## vercel@34.1.2

### Patch Changes

- Updated dependencies
\[[`64bd6dd05`](64bd6dd057),
[`532885148`](532885148b),
[`adcfc365a`](adcfc365a7)]:
    -   @vercel/next@4.2.2
    -   @vercel/python@4.2.0

## @vercel/next@4.2.2

### Patch Changes

- [next] revert .action rewrites
([#11470](https://github.com/vercel/vercel/pull/11470))

- Next.js builds: support sectioned source maps
([#11453](https://github.com/vercel/vercel/pull/11453))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-24 10:54:30 -05:00
Will Binns-Smith
532885148b [next] support sectioned source maps (#11453)
Turbopack outputs sectioned source maps, but webpack’s `webpack-sources`
packages doesn’t support these. For performance reasons, it should, but
as an interim solution, flatten these sections maps for compatibility.

---------

Co-authored-by: Nathan Rajlich <n@n8.io>
2024-04-19 14:43:01 -07:00
Zack Tanner
64bd6dd057 Revert "[next] add .action handling for dynamic routes" (#11470)
Reverts vercel/vercel#11461 and #11454  while we revisit the approach to produce fewer rewrites.
2024-04-19 18:26:01 +00:00