Skip to content

Commit

Permalink
Merge branch 'main' into austinmerrick/bump-nft
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed May 10, 2024
2 parents ae771f4 + bc95d76 commit 25fdf1f
Show file tree
Hide file tree
Showing 147 changed files with 984 additions and 356 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-windows-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vercel/next': patch
---

skip action rewrites for RSC requests
2 changes: 2 additions & 0 deletions .changeset/few-ads-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/ninety-timers-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 5 additions & 0 deletions .changeset/sour-scissors-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

---

ci: add Node.js v18 tests
124 changes: 124 additions & 0 deletions .github/workflows/test-18.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Tests Node.js v18

on:
push:
branches:
- main
tags:
- '!*'
pull_request:

env:
NODE_VERSION: '18'
TURBO_REMOTE_ONLY: 'true'
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
setup:
name: Find Changes
runs-on: ubuntu-latest
outputs:
tests: ${{ steps['set-tests'].outputs['tests'] }}
dplUrl: ${{ steps.waitForTarball.outputs.url }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: install pnpm@8.3.1
run: npm i -g pnpm@8.3.1
- run: pnpm install
- id: set-tests
run: |
TESTS_ARRAY=$(node utils/chunk-tests-18.js $SCRIPT_NAME)
echo "Files to test:"
echo "$TESTS_ARRAY"
echo "tests=$TESTS_ARRAY" >> $GITHUB_OUTPUT
- uses: patrickedqvist/wait-for-vercel-preview@bfdff514ff78a669f2536e9f4dd4ef5813a704a2
id: waitForTarball
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 360
check_interval: 5
test:
timeout-minutes: 120
runs-on: ${{ matrix.runner }}
name: ${{matrix.scriptName}} (${{matrix.packageName}}, ${{matrix.chunkNumber}}, ${{ matrix.runner }})
if: ${{ needs.setup.outputs['tests'] != '[]' }}
needs:
- setup
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.setup.outputs['tests']) }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.nodeVersion || env.NODE_VERSION }}

# yarn 1.22.21 introduced a Corepack bug when running tests.
# this can be removed once https://github.com/yarnpkg/yarn/issues/9015 is resolved
- name: install yarn@1.22.19
run: npm i -g yarn@1.22.19

- name: install pnpm@8.3.1
run: npm i -g pnpm@8.3.1

- run: pnpm install

- name: Build ${{matrix.packageName}} and all its dependencies
run: node utils/gen.js && node_modules/.bin/turbo run build --cache-dir=".turbo" --log-order=stream --scope=${{matrix.packageName}} --include-dependencies --no-deps
env:
FORCE_COLOR: '1'
- name: Test ${{matrix.packageName}}
run: node utils/gen.js && node_modules/.bin/turbo run ${{matrix.testScript}} --summarize --cache-dir=".turbo" --log-order=stream --scope=${{matrix.packageName}} --no-deps -- ${{ join(matrix.testPaths, ' ') }}
shell: bash
env:
JEST_JUNIT_OUTPUT_FILE: ${{github.workspace}}/.junit-reports/${{matrix.scriptName}}-${{matrix.packageName}}-${{matrix.chunkNumber}}-${{ matrix.runner }}.xml
VERCEL_CLI_VERSION: ${{ needs.setup.outputs.dplUrl }}/tarballs/vercel.tgz
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
FORCE_COLOR: '1'
- name: 'Determine Turbo HIT or MISS'
if: ${{ !cancelled() }}
id: turbo-summary
shell: bash
run: |
TURBO_MISS_COUNT=`node utils/determine-turbo-hit-or-miss.js`
echo "MISS COUNT: $TURBO_MISS_COUNT"
echo "misses=$TURBO_MISS_COUNT" >> $GITHUB_OUTPUT
- name: 'Upload Test Report to Datadog'
if: ${{ steps['turbo-summary'].outputs.misses != '0' && !cancelled() }}
run: 'npx @datadog/datadog-ci@2.18.1 junit upload --service vercel-cli .junit-reports'
env:
DATADOG_API_KEY: ${{secrets.DATADOG_API_KEY_CLI}}
DD_ENV: ci

summary:
name: Summary
runs-on: ubuntu-latest
timeout-minutes: 5
if: always()
needs:
- test
steps:
- name: Check All
run: |-
for status in ${{ join(needs.*.result, ' ') }}
do
if [ "$status" != "success" ] && [ "$status" != "skipped" ]
then
echo "Some checks failed"
exit 1
fi
done
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Tests Node.js v16

on:
push:
Expand Down
12 changes: 6 additions & 6 deletions examples/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"typecheck": "tsc"
},
"dependencies": {
"@remix-run/node": "^2.8.0",
"@remix-run/react": "^2.8.0",
"@remix-run/server-runtime": "^2.8.0",
"@remix-run/node": "^2.9.2",
"@remix-run/react": "^2.9.2",
"@remix-run/server-runtime": "^2.9.2",
"@vercel/analytics": "^1.2.2",
"@vercel/remix": "^2.8.0",
"@vercel/remix": "2.9.2-patch.2",
"isbot": "^4",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^2.8.0",
"@remix-run/eslint-config": "^2.8.0",
"@remix-run/dev": "^2.9.2",
"@remix-run/eslint-config": "^2.9.2",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"eslint": "^8.38.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# vercel

## 34.1.10

### Patch Changes

- Updated dependencies [[`119f80e96`](https://github.com/vercel/vercel/commit/119f80e9611a7a5a755aa689502dcdab323194aa), [`11584b0e9`](https://github.com/vercel/vercel/commit/11584b0e9b55f312f34d0d6467ab498e472ac9df), [`3023122d4`](https://github.com/vercel/vercel/commit/3023122d4e0dd292340d9e9e61ef232baf6e610d), [`0e774b6be`](https://github.com/vercel/vercel/commit/0e774b6be0c832213a64124e1f4fc6d150e87d9f)]:
- @vercel/next@4.2.9
- @vercel/static-build@2.5.4

## 34.1.9

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "34.1.9",
"version": "34.1.10",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
Expand Down Expand Up @@ -36,13 +36,13 @@
"@vercel/fun": "1.1.0",
"@vercel/go": "3.1.1",
"@vercel/hydrogen": "1.0.2",
"@vercel/next": "4.2.8",
"@vercel/next": "4.2.9",
"@vercel/node": "3.1.0",
"@vercel/python": "4.2.0",
"@vercel/redwood": "2.0.8",
"@vercel/remix-builder": "2.1.5",
"@vercel/ruby": "2.1.0",
"@vercel/static-build": "2.5.3",
"@vercel/static-build": "2.5.4",
"chokidar": "3.3.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/integration-3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ test('fail to deploy a Lambda with an incorrect value for maxDuration', async ()

expect(output.exitCode, formatOutput(output)).toBe(1);
expect(output.stderr).toMatch(
/maxDuration must be between 1 second and 10 seconds/gm
/maxDuration must be between \d+ second and \d+ seconds/gm
);
});

Expand Down
6 changes: 6 additions & 0 deletions packages/functions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @vercel/functions

## 1.0.2

### Patch Changes

- Convert package to CommonJS ([#11569](https://github.com/vercel/vercel/pull/11569))

## 1.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/functions/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* }
* ```
*/
export const waitUntil: (promise: Promise<unknown>) => void;
export function waitUntil(promise: Promise<unknown>): void;
2 changes: 1 addition & 1 deletion packages/functions/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global globalThis */

export const waitUntil = promise => {
exports.waitUntil = promise => {
if (
promise === null ||
typeof promise !== 'object' ||
Expand Down
2 changes: 1 addition & 1 deletion packages/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@vercel/functions",
"description": "Runtime functions to be used with your Vercel Functions",
"homepage": "https://vercel.com",
"version": "1.0.1",
"version": "1.0.2",
"types": "index.d.ts",
"main": "index.js",
"repository": {
Expand Down
10 changes: 10 additions & 0 deletions packages/next/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @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))

## 4.2.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vercel/next",
"version": "4.2.8",
"version": "4.2.9",
"license": "Apache-2.0",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
Expand Down
24 changes: 20 additions & 4 deletions packages/next/src/server-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ export async function serverBuild({
}

const experimental = {
ppr: requiredServerFilesManifest.config.experimental?.ppr === true,
ppr:
requiredServerFilesManifest.config.experimental?.ppr === true ||
requiredServerFilesManifest.config.experimental?.ppr === 'incremental',
};

let appRscPrefetches: UnwrapPromise<ReturnType<typeof glob>> = {};
Expand All @@ -228,8 +230,6 @@ export async function serverBuild({
if (appPathRoutesManifest) {
appDir = path.join(pagesDir, '../app');
appBuildTraces = await glob('**/*.js.nft.json', appDir);

// TODO: maybe?
appRscPrefetches = experimental.ppr
? {}
: await glob(`**/*${RSC_PREFETCH_SUFFIX}`, appDir);
Expand Down Expand Up @@ -1601,6 +1601,10 @@ export async function serverBuild({
edgeFunctions[`${pathname}${RSC_PREFETCH_SUFFIX}`] =
edgeFunctions[pathname];
}

if (hasActionOutputSupport) {
edgeFunctions[`${pathname}.action`] = edgeFunctions[pathname];
}
}
}
}
Expand Down Expand Up @@ -1952,14 +1956,20 @@ export async function serverBuild({
// Also includes separate handling for index routes which should match to /index.action.
// This follows the same pattern as the rewrites for .rsc files.
{
src: `^${path.posix.join('/', entryDirectory, '/')}`,
src: `^${path.posix.join('/', entryDirectory, '/?')}`,
dest: path.posix.join('/', entryDirectory, '/index.action'),
has: [
{
type: 'header',
key: 'next-action',
},
],
missing: [
{
type: 'header',
key: rscHeader,
},
],
continue: true,
override: true,
},
Expand All @@ -1976,6 +1986,12 @@ export async function serverBuild({
key: 'next-action',
},
],
missing: [
{
type: 'header',
key: rscHeader,
},
],
continue: true,
override: true,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use client';

import { useState } from 'react';
import { increment } from '../../../../actions';

export default function Page() {
const [count, setCount] = useState(0);
async function updateCount() {
const newCount = await increment(count);
setCount(newCount);
}

return (
<form action={updateCount}>
<div id="count">{count}</div>
<button>Submit</button>
</form>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const dynamic = 'force-dynamic';

export default function Layout({ children }) {
return children;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use client';

import { useState } from 'react';
import { increment } from '../../../../actions';

export default function Page() {
const [count, setCount] = useState(0);
async function updateCount() {
const newCount = await increment(count);
setCount(newCount);
}

return (
<form action={updateCount}>
<div id="count">{count}</div>
<button>Submit</button>
</form>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const dynamic = 'force-static';

export default function Layout({ children }) {
return children;
}
Loading

0 comments on commit 25fdf1f

Please sign in to comment.