Skip to content

Commit

Permalink
Merge branch 'canary' into raphaelcosta-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk authored Feb 19, 2025
2 parents f30a0aa + 52284fe commit 04e2a28
Show file tree
Hide file tree
Showing 1,118 changed files with 73,870 additions and 24,188 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
"jest/no-conditional-expect": "off",
"jest/valid-title": "off",
"jest/no-interpolation-in-snapshots": "off",
"jest/no-export": "off"
"jest/no-export": "off",
"jest/no-standalone-expect": [
"error",
{ "additionalTestBlockFunctions": ["retry"] }
]
}
},
{ "files": ["**/__tests__/**"], "env": { "jest": true } },
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ body:
- 'dynamicIO'
- 'Dynamic Routes'
- 'Error Handling'
- 'Error Overlay'
- 'Lazy Loading'
- 'Font (next/font)'
- 'Form (next/form)'
Expand Down
4,086 changes: 4,016 additions & 70 deletions .github/actions/upload-turboyet-data/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/actions/upload-turboyet-data/dist/index.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

88 changes: 53 additions & 35 deletions .github/actions/upload-turboyet-data/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,47 +134,65 @@ async function collectResults(manifestFile) {
}
}

async function collectAndUpload(kv, { jsonPrefix, kvPrefix }) {
const developmentResult = await collectResults(
`test/${jsonPrefix}dev-tests-manifest.json`
)
const productionResult = await collectResults(
`test/${jsonPrefix}build-tests-manifest.json`
)
const developmentExamplesResult = await collectExamplesResult(
`test/${jsonPrefix}dev-examples-manifest.json`
)

console.log('TEST RESULT DEVELOPMENT')
console.log(developmentResult.testRun)

console.log('TEST RESULT PRODUCTION')
console.log(productionResult.testRun)

console.log('EXAMPLES RESULT')
console.log(developmentExamplesResult.status)

await kv.rpush(`${kvPrefix}test-runs`, developmentResult.testRun)
await kv.rpush(`${kvPrefix}test-runs-production`, productionResult.testRun)
await kv.rpush(`${kvPrefix}examples-runs`, developmentExamplesResult.status)
console.log('SUCCESSFULLY SAVED RUNS')

await kv.set(`${kvPrefix}passing-tests`, developmentResult.passingTests)
await kv.set(
`${kvPrefix}passing-tests-production`,
productionResult.passingTests
)
console.log('SUCCESSFULLY SAVED PASSING')

await kv.set(`${kvPrefix}failing-tests`, developmentResult.failingTests)
await kv.set(
`${kvPrefix}failing-tests-production`,
productionResult.failingTests
)
console.log('SUCCESSFULLY SAVED FAILING')

await kv.set(`${kvPrefix}examples-data`, developmentExamplesResult.data)
console.log('SUCCESSFULLY SAVED EXAMPLES')
}

async function main() {
try {
const developmentResult = await collectResults(
'test/turbopack-dev-tests-manifest.json'
)
const productionResult = await collectResults(
'test/turbopack-build-tests-manifest.json'
)
const developmentExamplesResult = await collectExamplesResult(
'test/turbopack-dev-examples-manifest.json'
)

const kv = createClient({
url: process.env.TURBOYET_KV_REST_API_URL,
token: process.env.TURBOYET_KV_REST_API_TOKEN,
})

console.log('TEST RESULT DEVELOPMENT')
console.log(developmentResult.testRun)

console.log('TEST RESULT PRODUCTION')
console.log(productionResult.testRun)

console.log('EXAMPLES RESULT')
console.log(developmentExamplesResult.status)

await kv.rpush('test-runs', developmentResult.testRun)
await kv.rpush('test-runs-production', productionResult.testRun)
await kv.rpush('examples-runs', developmentExamplesResult.status)
console.log('SUCCESSFULLY SAVED RUNS')

await kv.set('passing-tests', developmentResult.passingTests)
await kv.set('passing-tests-production', productionResult.passingTests)
console.log('SUCCESSFULLY SAVED PASSING')

await kv.set('failing-tests', developmentResult.failingTests)
await kv.set('failing-tests-production', productionResult.failingTests)
console.log('SUCCESSFULLY SAVED FAILING')

await kv.set('examples-data', developmentExamplesResult.data)
console.log('SUCCESSFULLY SAVED EXAMPLES')
console.log('### UPLOADING TURBOPACK DATA')
await collectAndUpload(kv, {
jsonPrefix: 'turbopack-',
kvPrefix: '',
})
console.log('### UPLOADING RSPACK DATA')
await collectAndUpload(kv, {
jsonPrefix: 'rspack-',
kvPrefix: 'rspack-',
})
} catch (error) {
console.log(error)
}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
NODE_LTS_VERSION: 20
CARGO_PROFILE_RELEASE_LTO: 'true'
TURBO_TEAM: 'vercel'
TURBO_REMOTE_ONLY: 'true'
TURBO_CACHE: 'remote:rw'

jobs:
deploy-target:
Expand Down Expand Up @@ -343,7 +343,7 @@ jobs:

- name: Build in docker
if: ${{ matrix.settings.docker && steps.build-exists.outputs.BUILD_EXISTS == 'no' }}
run: docker run -v "/var/run/docker.sock":"/var/run/docker.sock" -e RUST_BACKTRACE -e NAPI_CLI_VERSION -e CARGO_TERM_COLOR -e CARGO_INCREMENTAL -e CARGO_PROFILE_RELEASE_LTO -e CARGO_REGISTRIES_CRATES_IO_PROTOCOL -e TURBO_API -e TURBO_TEAM -e TURBO_TOKEN -e TURBO_VERSION -e TURBO_REMOTE_ONLY -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build --entrypoint=bash ${{ matrix.settings.docker }} -c "${{ matrix.settings.build }}"
run: docker run -v "/var/run/docker.sock":"/var/run/docker.sock" -e RUST_BACKTRACE -e NAPI_CLI_VERSION -e CARGO_TERM_COLOR -e CARGO_INCREMENTAL -e CARGO_PROFILE_RELEASE_LTO -e CARGO_REGISTRIES_CRATES_IO_PROTOCOL -e TURBO_API -e TURBO_TEAM -e TURBO_TOKEN -e TURBO_VERSION -e TURBO_CACHE="remote:rw" -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build --entrypoint=bash ${{ matrix.settings.docker }} -c "${{ matrix.settings.build }}"

- name: cache build
if: ${{ matrix.settings.docker && steps.build-exists.outputs.BUILD_EXISTS == 'no' }}
Expand Down
49 changes: 4 additions & 45 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
RUST_BACKTRACE: 0

TURBO_TEAM: 'vercel'
TURBO_REMOTE_ONLY: 'true'
TURBO_CACHE: 'remote:rw'
NEXT_TELEMETRY_DISABLED: 1
# we build a dev binary for use in CI so skip downloading
# canary next-swc binaries in the monorepo
Expand Down Expand Up @@ -581,7 +581,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
with:
nodeVersion: 18.18.2
afterBuild: __NEXT_EXPERIMENTAL_PPR=true __NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" node run-tests.js --timings -c ${TEST_CONCURRENCY} --type integration
afterBuild: __NEXT_EXPERIMENTAL_PPR=true __NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY=false NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" node run-tests.js --timings -c ${TEST_CONCURRENCY} --type integration
stepName: 'test-ppr-integration'
secrets: inherit

Expand All @@ -596,7 +596,7 @@ jobs:
group: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6]
uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: __NEXT_EXPERIMENTAL_PPR=true __NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" NEXT_TEST_MODE=dev node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type development
afterBuild: __NEXT_EXPERIMENTAL_PPR=true __NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY=false NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" NEXT_TEST_MODE=dev node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type development
stepName: 'test-ppr-dev-${{ matrix.group }}'
secrets: inherit

Expand All @@ -611,51 +611,10 @@ jobs:
group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7]
uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: __NEXT_EXPERIMENTAL_PPR=true __NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type production
afterBuild: __NEXT_EXPERIMENTAL_PPR=true __NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY=false NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type production
stepName: 'test-ppr-prod-${{ matrix.group }}'
secrets: inherit

report-test-results-to-datadog:
needs:
[
'changes',
'test-unit',
'test-dev',
'test-prod',
'test-integration',
'test-ppr-dev',
'test-ppr-prod',
'test-ppr-integration',
'test-turbopack-dev',
'test-turbopack-integration',
'test-turbopack-production',
'test-turbopack-production-integration',
]
if: ${{ always() && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork }}

runs-on: ubuntu-latest
name: report test results to datadog
steps:
- name: Download test report artifacts
id: download-test-reports
uses: actions/download-artifact@v4
with:
pattern: test-reports-*
path: test
merge-multiple: true

- name: Upload test report to datadog
run: |
if [ -d ./test/test-junit-report ]; then
# Add a `test.type` tag to distinguish between turbopack and next.js runs
DD_ENV=ci npx @datadog/datadog-ci@2.23.1 junit upload --tags test.type:nextjs --service nextjs ./test/test-junit-report
fi
if [ -d ./test/turbopack-test-junit-report ]; then
# Add a `test.type` tag to distinguish between turbopack and next.js runs
DD_ENV=ci npx @datadog/datadog-ci@2.23.1 junit upload --tags test.type:turbopack --service nextjs ./test/turbopack-test-junit-report
fi
tests-pass:
needs:
[
Expand Down
34 changes: 21 additions & 13 deletions .github/workflows/build_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ env:
RUST_BACKTRACE: 0

TURBO_TEAM: 'vercel'
TURBO_REMOTE_ONLY: 'true'
TURBO_CACHE: 'remote:rw'
NEXT_TELEMETRY_DISABLED: 1
# allow not skipping install-native postinstall script if we don't have a binary available already
NEXT_SKIP_NATIVE_POSTINSTALL: ${{ inputs.skipNativeInstall == 'yes' && '1' || '' }}
Expand Down Expand Up @@ -243,19 +243,27 @@ jobs:
name: webpack bundle analysis stats-${{ steps.var.outputs.input_step_key }}
path: packages/next/dist/compiled/next-server/report.*.html

- name: Upload test report artifacts
uses: actions/upload-artifact@v4
if: ${{ inputs.afterBuild && always() }}
with:
name: test-reports-${{ steps.var.outputs.input_step_key }}
path: |
test/test-junit-report
test/turbopack-test-junit-report
test/rspack-test-junit-report
if-no-files-found: ignore
- name: Upload test report to datadog
if: ${{ inputs.afterBuild && always() && !github.event.pull_request.head.repo.fork }}
run: |
# Add a `test.type` tag to distinguish between turbopack and next.js runs
# Add a `nextjs.test_session.name` tag to help identify the job
if [ -d ./test/test-junit-report ]; then
npx @datadog/datadog-ci@2.45.1 junit upload \
--service nextjs \
--tags test.type:nextjs \
--tags test_session.name:"${{ inputs.stepName }}" \
./test/test-junit-report
fi
if [ -d ./test/turbopack-test-junit-report ]; then
npx @datadog/datadog-ci@2.45.1 junit upload \
--service nextjs \
--tags test.type:turbopack \
--tags test_session.name:"${{ inputs.stepName }}" \
./test/turbopack-test-junit-report
fi
# upload playwright snapshots from failed tests
- name: Upload test report artifacts
- name: Upload Playwright Snapshots
uses: actions/upload-artifact@v4
if: ${{ inputs.afterBuild && always() }}
with:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/issue_stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
days-before-pr-stale: -1
remove-issue-stale-when-updated: true
stale-issue-label: 'stale'
labels-to-add-when-unstale: 'not stale'
stale-issue-message: 'This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.'
close-issue-message: 'This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!'
operations-per-run: 300 # 1 operation per 100 issues, the rest is to label/comment/close
Expand All @@ -36,6 +37,9 @@ jobs:
days-before-issue-stale: 1
days-before-pr-close: -1
days-before-pr-stale: -1
remove-issue-stale-when-updated: true
stale-issue-label: 'stale'
labels-to-add-when-unstale: 'not stale'
operations-per-run: 300 # 1 operation per 100 issues, the rest is to label/comment/close
- uses: actions/stale@v9
id: stale-simple-repro
Expand All @@ -48,6 +52,9 @@ jobs:
days-before-issue-stale: 1
days-before-pr-close: -1
days-before-pr-stale: -1
remove-issue-stale-when-updated: true
stale-issue-label: 'stale'
labels-to-add-when-unstale: 'not stale'
operations-per-run: 300 # 1 operation per 100 issues, the rest is to label/comment/close
- uses: actions/stale@v9
id: stale-no-canary
Expand All @@ -60,4 +67,7 @@ jobs:
days-before-issue-stale: 1
days-before-pr-close: -1
days-before-pr-stale: -1
remove-issue-stale-when-updated: true
stale-issue-label: 'stale'
labels-to-add-when-unstale: 'not stale'
operations-per-run: 300 # 1 operation per 100 issues, the rest is to label/comment/close
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
TEST_CONCURRENCY: 6

TURBO_TEAM: 'vercel'
TURBO_REMOTE_ONLY: 'true'
TURBO_CACHE: 'remote:rw'
NEXT_TELEMETRY_DISABLED: 1
# we build a dev binary for use in CI so skip downloading
# canary next-swc binaries in the monorepo
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/rspack-update-tests-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
BRANCH_NAME: rspack-manifest
SCRIPT: test/build-rspack-dev-tests-manifest.js
PR_TITLE: Update Rspack development test manifest
PR_BODY: This auto-generated PR updates the development integration test manifest used when testing Rspack.
PR_TITLE: Update bundler development test manifest
PR_BODY: This auto-generated PR updates the development integration test manifest used when testing alternative bundlers.
update_build_manifest:
name: Update and upload Rspack production test manifest
if: github.repository_owner == 'vercel'
Expand Down Expand Up @@ -78,5 +78,5 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
BRANCH_NAME: rspack-manifest
SCRIPT: test/build-rspack-build-tests-manifest.js
PR_TITLE: Update Rspack production test manifest
PR_BODY: This auto-generated PR updates the production integration test manifest used when testing Rspack.
PR_TITLE: Update bundler production test manifest
PR_BODY: This auto-generated PR updates the production integration test manifest used when testing alternative bundlers.
5 changes: 3 additions & 2 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ jobs:
runs-on: ubuntu-latest
if: >-
${{
github.event_name != 'issue_comment' ||
(github.event_name == 'issue_comment' && !contains(github.event.issue.labels.*.name, 'stale'))
(github.event_name != 'issue_comment' ||
(github.event_name == 'issue_comment' && !contains(github.event.issue.labels.*.name, 'stale'))) &&
github.event.issue.type.name != 'Documentation'
}}
steps:
- uses: balazsorban44/nissuer@1.10.0
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/turbopack-update-tests-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ jobs:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true

- run: corepack enable
- name: Setup corepack
run: |
npm i -g corepack@0.31
corepack enable
- name: Install dependencies
shell: bash
Expand Down
21 changes: 11 additions & 10 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,21 @@ bench/nested-deps/components/**/*
**/.tina/__generated__/**
test/lib/amp-validator-wasm.js
test/production/pages-dir/production/fixture/amp-validator-wasm.js
test/e2e/app-dir/server-source-maps/fixtures/default/internal-pkg/ignored.js
test/e2e/app-dir/server-source-maps/fixtures/default/internal-pkg/sourcemapped.js
test/e2e/app-dir/server-source-maps/fixtures/default/external-pkg/sourcemapped.js
test/e2e/async-modules/amp-validator-wasm.js

# turbopack crates
turbopack/crates/*/js/src/compiled
turbopack/crates/turbopack/bench.json
turbopack/crates/turbopack/tests
turbopack/crates/turbopack-ecmascript/tests/analyzer/graph
turbopack/crates/turbopack-ecmascript/tests/tree-shaker
turbopack/crates/next-transform-strip-page-exports/tests
turbopack/crates/next-transform-dynamic/tests
turbopack/crates/turbopack-tests/tests/execution/turbopack/basic/error/input/broken.js
turbopack/crates/turbopack-tests/tests/**/output*
/turbopack/crates/*/js/src/compiled
/turbopack/crates/turbopack/bench.json
/turbopack/crates/turbopack/tests
/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph
/turbopack/crates/turbopack-ecmascript/tests/tree-shaker
/turbopack/crates/next-transform-strip-page-exports/tests
/turbopack/crates/next-transform-dynamic/tests
/turbopack/crates/turbopack-tests/tests/execution/turbopack/basic/error/input/broken.js
/turbopack/crates/turbopack-tests/tests/**/output*

# temporarily disable prettier for the turbopack directory
turbopack/
/turbopack/
Loading

0 comments on commit 04e2a28

Please sign in to comment.