Skip to content

Commit

Permalink
Merge branch 'canary' into fix/issue-40334
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Sep 30, 2022
2 parents f3d0b05 + 05c2fe0 commit e8bfb70
Show file tree
Hide file tree
Showing 1,230 changed files with 60,177 additions and 8,162 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -4,6 +4,7 @@
* @timneutkens @ijjk @shuding @huozhi
/.github/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia @balazsorban44
/docs/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia @leerob @balazsorban44
/errors/ @balazsorban44
/examples/ @timneutkens @ijjk @shuding @leerob @steven-tey @balazsorban44

# SWC Build & Telemetry (@padmaia)
Expand Down
10 changes: 7 additions & 3 deletions .github/actions/next-stats-action/src/run/index.js
Expand Up @@ -253,9 +253,13 @@ async function linkPkgs(pkgDir = '', pkgPaths) {
await fs.writeFile(pkgJsonPath, JSON.stringify(pkgData, null, 2), 'utf8')

await fs.remove(yarnEnvValues.YARN_CACHE_FOLDER)
await exec(`cd ${pkgDir} && pnpm install`, false, {
env: yarnEnvValues,
})
await exec(
`cd ${pkgDir} && pnpm install --strict-peer-dependencies=false`,
false,
{
env: yarnEnvValues,
}
)
}

module.exports = runConfigs
8 changes: 4 additions & 4 deletions .github/pull_request_template.md
@@ -1,14 +1,14 @@
<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order to make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

Expand All @@ -17,9 +17,9 @@ Choose the right checklist for the change that you're making:
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
35 changes: 32 additions & 3 deletions .github/workflows/build_test_deploy.yml
Expand Up @@ -9,7 +9,7 @@ name: Build, test, and deploy
env:
NAPI_CLI_VERSION: 2.7.0
TURBO_VERSION: 1.3.2-canary.1
RUST_TOOLCHAIN: nightly-2022-06-12
RUST_TOOLCHAIN: nightly-2022-09-14
PNPM_VERSION: 7.2.1

jobs:
Expand Down Expand Up @@ -281,6 +281,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: node run-tests.js --type development --timings -g ${{ matrix.group }}/2
Expand Down Expand Up @@ -340,6 +341,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: node run-tests.js --type development --timings -g ${{ matrix.group }}/2
Expand Down Expand Up @@ -400,11 +402,30 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: NEXT_TEST_MODE=dev node run-tests.js --type e2e --timings -g ${{ matrix.group }}/3
- run: npx @replayio/playwright install chromium
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: node run-tests.js --type e2e --timings -g ${{ matrix.group }}/3
name: Run test/e2e (dev)
if: ${{needs.build.outputs.docsChange == 'nope'}}
env:
RECORD_REPLAY_METADATA_TEST_RUN_TITLE: testDevE2E / Group ${{ matrix.group }} / Node ${{ matrix.node }}
RECORD_ALL_CONTENT: 1
RECORD_REPLAY: 1
NEXT_TEST_MODE: dev
RECORD_REPLAY_TEST_METRICS: 1
RECORD_REPLAY_WEBHOOK_URL: ${{ secrets.RECORD_REPLAY_WEBHOOK_URL }}
# DEBUG: pw:browser*

- uses: replayio/action-upload@v0.4.5
if: always()
with:
api-key: rwk_iKsQnEoQwKd31WAJxgN9ARPFuAlyXlVrDH4uhYpRnti
public: true
filter: ${{ 'function($v) { $v.metadata.test.result = "failed" }' }}

- name: Upload test trace
if: always()
Expand Down Expand Up @@ -460,6 +481,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: NEXT_TEST_MODE=dev node run-tests.js --type e2e --timings -g ${{ matrix.group }}/3
Expand Down Expand Up @@ -519,6 +541,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: node run-tests.js --type production --timings -g ${{ matrix.group }}/2
Expand Down Expand Up @@ -568,6 +591,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: node run-tests.js --type production --timings -g ${{ matrix.group }}/2
Expand Down Expand Up @@ -618,6 +642,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: NEXT_TEST_MODE=start node run-tests.js --type e2e --timings -g ${{ matrix.group }}/3
Expand Down Expand Up @@ -668,6 +693,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: NEXT_TEST_MODE=start node run-tests.js --type e2e --timings -g ${{ matrix.group }}/3
Expand Down Expand Up @@ -739,6 +765,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/20
Expand Down Expand Up @@ -1008,7 +1035,7 @@ jobs:
- run: npm i -g pnpm@${PNPM_VERSION}
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: ./scripts/publish-native.js $GITHUB_REF
- run: ./scripts/publish-release.sh
- run: ./scripts/publish-release.js

testDeployE2E:
name: E2E (deploy)
Expand Down Expand Up @@ -1043,6 +1070,7 @@ jobs:
name: Install pnpm

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
timeout-minutes: 5
name: Install playwright dependencies

- run: RESET_VC_PROJECT=true node scripts/reset-vercel-project.mjs
Expand Down Expand Up @@ -1243,6 +1271,7 @@ jobs:
check-latest: true

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: node ./scripts/setup-wasm.mjs
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -45,4 +45,4 @@ test-timings.json

# Cache
*.tsbuildinfo
.swc/
.swc/
65 changes: 27 additions & 38 deletions .vscode/launch.json
Expand Up @@ -9,92 +9,81 @@
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "debug-react-exp", "dev", "test/e2e/app-dir/app"],
"runtimeExecutable": "pnpm",
"runtimeArgs": ["debug-react-exp", "dev", "test/e2e/app-dir/app"],
"skipFiles": ["<node_internals>/**"],
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"],
"port": 9229,
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
"NEXT_PRIVATE_LOCAL_WEBPACK": "1"
}
},
{
"name": "Launch app development",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "debug", "dev", "bench/nested-deps"],
"runtimeExecutable": "pnpm",
"runtimeArgs": ["debug", "dev", "examples/hello-world"],
"skipFiles": ["<node_internals>/**"],
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"],
"port": 9229,
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
"NEXT_PRIVATE_LOCAL_WEBPACK": "1"
}
},
{
"name": "Launch app build",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "debug", "build", "bench/nested-deps"],
"runtimeExecutable": "pnpm",
"runtimeArgs": ["debug", "build", "examples/hello-world"],
"skipFiles": ["<node_internals>/**"],
"port": 9229,
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"],
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
"NEXT_PRIVATE_LOCAL_WEBPACK": "1"
}
},
{
"name": "Launch app build trace jaeger",
"name": "Launch app production",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "clean-trace-jaeger"],
"runtimeExecutable": "pnpm",
"runtimeArgs": ["debug", "start", "examples/hello-world"],
"skipFiles": ["<node_internals>/**"],
"port": 9229,
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"],
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
"NEXT_PRIVATE_LOCAL_WEBPACK": "1"
}
},
{
"name": "Launch app production",
"name": "Launch current directory in development",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "debug", "start", "bench/nested-deps"],
"runtimeExecutable": "pnpm",
"runtimeArgs": ["debug", "dev", "${fileDirname}"],
"skipFiles": ["<node_internals>/**"],
"port": 9229,
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
"NEXT_PRIVATE_LOCAL_WEBPACK": "1"
}
},
{
"name": "Launch app build trace jaeger",
"type": "node",
"request": "attach",
"name": "Attach to existing debugger",
"port": 9229,
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["clean-trace-jaeger"],
"skipFiles": ["<node_internals>/**"],
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"],
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
"NEXT_PRIVATE_LOCAL_WEBPACK": "1"
}
},
{
"name": "Launch this example",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "debug", "dev", "${fileDirname}"],
"skipFiles": ["<node_internals>/**"],
"request": "attach",
"name": "Attach to existing debugger",
"port": 9229,
"skipFiles": ["<node_internals>/**"],
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
"NEXT_PRIVATE_LOCAL_WEBPACK": "1"
}
}
]
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Expand Up @@ -5,5 +5,10 @@
{ "language": "typescript", "autoFix": true },
{ "language": "typescriptreact", "autoFix": true }
],
"debug.javascript.unmapMissingSources": true
"debug.javascript.unmapMissingSources": true,
"files.exclude": {
"**/node_modules": false,
"node_modules": true,
"*[!test]**/node_modules": true
}
}
8 changes: 4 additions & 4 deletions bench/nested-deps/package.json
@@ -1,11 +1,11 @@
{
"scripts": {
"prepare": "rimraf components && mkdir components && node ./fuzzponent.js -d 2 -s 206 -o components",
"dev": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK5=1 node ../../node_modules/next/dist/bin/next dev",
"build": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK5=1 node ../../node_modules/next/dist/bin/next build",
"start": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK5=1 node ../../node_modules/next/dist/bin/next start",
"dev": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 node ../../node_modules/next/dist/bin/next dev",
"build": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 node ../../node_modules/next/dist/bin/next build",
"start": "cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 node ../../node_modules/next/dist/bin/next start",
"dev-nocache": "rimraf .next && yarn dev",
"dev-cpuprofile-nocache": "rimraf .next && cross-env NEXT_PRIVATE_LOCAL_WEBPACK5=1 node --cpu-prof ../../node_modules/next/dist/bin/next",
"dev-cpuprofile-nocache": "rimraf .next && cross-env NEXT_PRIVATE_LOCAL_WEBPACK=1 node --cpu-prof ../../node_modules/next/dist/bin/next",
"build-nocache": "rimraf .next && yarn build"
},
"devDependencies": {
Expand Down
8 changes: 8 additions & 0 deletions bench/vercel/.env.dev
@@ -0,0 +1,8 @@
# The Vercel team you want to deploy the project too
VERCEL_TEST_TEAM=

# The corresponding Vercel token
VERCEL_TEST_TOKEN=

# The Vercel project you want to deploy the test project too
VERCEL_TEST_PROJECT_NAME=
5 changes: 5 additions & 0 deletions bench/vercel/.gitignore
@@ -0,0 +1,5 @@
.vercel
.next
*.tgz
yarn.lock
.env
22 changes: 22 additions & 0 deletions bench/vercel/README.md
@@ -0,0 +1,22 @@
# Benchmarking Next.js on production

This script allows you to measure some performance metrics of your local build of Next.js on production by uploading your current build to Vercel with an example app and running some basic benchmarks on it.

## Requirements

- the Vercel CLI

## Setup

Rename the provided `./env.local` file to `./env` and fill in the required `VERCEL_TEST_TOKEN` and `VERCEL_TEST_TEAM` values. You can find and generate those from vercel.com.

Run `pnpm install`, `pnpm bench` and profit.

Note: if you made some changes to Next.js, make sure you compiled them by running at the root of the monorepo either `pnpm dev` or `pnpm build --force`.

## How it works

- with the Vercel CLI, we setup a project
- we `npm pack` the local Next build and add it to the repo
- we upload the repo to Vercel and let it build
- once it builds, we get the deployment url and run some tests

0 comments on commit e8bfb70

Please sign in to comment.