Skip to content

Commit

Permalink
Merge branch 'canary' into perserve-hash-in-next-url
Browse files Browse the repository at this point in the history
  • Loading branch information
nuta committed Oct 18, 2022
2 parents a8ad502 + f260328 commit d108aa1
Show file tree
Hide file tree
Showing 1,405 changed files with 26,061 additions and 8,195 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -4,7 +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
/errors/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia @leerob @balazsorban44
/examples/ @timneutkens @ijjk @shuding @leerob @steven-tey @balazsorban44

# SWC Build & Telemetry (@padmaia)
Expand Down
Expand Up @@ -16,7 +16,10 @@ function loadStatsConfig() {
'stats-config.js'
))
break
} catch (_) {
} catch (err) {
if (err.code !== 'MODULE_NOT_FOUND') {
console.error('Failed to load stats-config at', configPath, err)
}
/* */
}
}
Expand Down
49 changes: 0 additions & 49 deletions .github/actions/next-stats-action/src/run/index.js
Expand Up @@ -169,55 +169,6 @@ async function runConfigs(
)
)
curStats.General.buildDurationCached = Date.now() - secondBuildStart

if (statsConfig.appDevCommand) {
const port = await getPort()
const startTime = Date.now()
const child = exec.spawn(statsConfig.appDevCommand, {
cwd: statsAppDir,
env: {
PORT: port,
},
stdio: 'pipe',
})

let serverReadyResolve
let serverReadyResolved = false
const serverReadyPromise = new Promise((resolve) => {
serverReadyResolve = resolve
})

child.stdout.on('data', (data) => {
if (
data.toString().includes('started server') &&
!serverReadyResolved
) {
serverReadyResolved = true
serverReadyResolve()
}
process.stdout.write(data)
})
child.stderr.on('data', (data) => process.stderr.write(data))

child.on('exit', (code) => {
if (!serverReadyResolved) {
serverReadyResolve()
serverReadyResolved = true
}
exitCode = code
})

setTimeout(() => {
if (!serverReadyResolved) {
child.kill()
}
}, 3 * 1000)

await serverReadyPromise
child.kill()

curStats['General']['nextDevReadyDuration'] = Date.now() - startTime
}
}

logger(`Finished running: ${config.title}`)
Expand Down
38 changes: 26 additions & 12 deletions .github/workflows/build_test_deploy.yml
Expand Up @@ -7,7 +7,7 @@ on:
name: Build, test, and deploy

env:
NAPI_CLI_VERSION: 2.7.0
NAPI_CLI_VERSION: 2.12.0
TURBO_VERSION: 1.3.2-canary.1
RUST_TOOLCHAIN: nightly-2022-09-23
PNPM_VERSION: 7.3.0
Expand Down Expand Up @@ -208,6 +208,7 @@ jobs:
name: Test Unit
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 10
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
Expand Down Expand Up @@ -242,6 +243,7 @@ jobs:
name: Test Development
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 30
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
Expand Down Expand Up @@ -281,7 +283,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

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

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

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

- run: node run-tests.js --type development --timings -g ${{ matrix.group }}/2
Expand All @@ -362,6 +364,7 @@ jobs:
name: Test Development (E2E)
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 30
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
Expand Down Expand Up @@ -402,7 +405,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

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

- run: npx @replayio/playwright install chromium
Expand Down Expand Up @@ -481,7 +484,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

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

- run: NEXT_TEST_MODE=dev node run-tests.js --type e2e --timings -g ${{ matrix.group }}/3
Expand All @@ -502,6 +505,7 @@ jobs:
name: Test Production
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 15
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
Expand Down Expand Up @@ -541,7 +545,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

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

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

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

- run: node run-tests.js --type production --timings -g ${{ matrix.group }}/2
Expand All @@ -602,6 +606,7 @@ jobs:
name: Test Production (E2E)
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 30
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
Expand Down Expand Up @@ -642,7 +647,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
timeout-minutes: 5
timeout-minutes: 10
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 @@ -693,7 +698,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

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

- run: NEXT_TEST_MODE=start node run-tests.js --type e2e --timings -g ${{ matrix.group }}/3
Expand All @@ -704,6 +709,7 @@ jobs:
name: Test Integration
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 30
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
Expand Down Expand Up @@ -765,7 +771,7 @@ jobs:
if: ${{needs.build.outputs.docsChange == 'nope'}}

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

- run: xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/20
Expand All @@ -785,6 +791,7 @@ jobs:
name: Test Electron
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 10
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
Expand Down Expand Up @@ -840,6 +847,7 @@ jobs:
name: Test Firefox (production)
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 10
env:
BROWSER_NAME: 'firefox'
NEXT_TELEMETRY_DISABLED: 1
Expand Down Expand Up @@ -874,6 +882,7 @@ jobs:
name: Test Safari (production)
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 15
env:
BROWSER_NAME: 'safari'
NEXT_TEST_MODE: 'start'
Expand Down Expand Up @@ -919,6 +928,7 @@ jobs:
name: Test Safari 10.1 (nav)
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 10
env:
BROWSERSTACK: true
LEGACY_SAFARI: true
Expand Down Expand Up @@ -965,6 +975,7 @@ jobs:
name: Test Firefox Node.js 18
runs-on: ubuntu-latest
needs: [build, testFirefox, build-native-test]
timeout-minutes: 10
env:
BROWSER_NAME: 'firefox'
NEXT_TELEMETRY_DISABLED: 1
Expand Down Expand Up @@ -1070,7 +1081,7 @@ jobs:
name: Install pnpm

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

- run: RESET_VC_PROJECT=true node scripts/reset-vercel-project.mjs
Expand Down Expand Up @@ -1237,6 +1248,7 @@ jobs:
test-wasm:
name: Test the wasm build
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [build, build-native-test, build-wasm-dev]

steps:
Expand Down Expand Up @@ -1271,7 +1283,7 @@ jobs:
check-latest: true

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

- run: node ./scripts/setup-wasm.mjs
Expand Down Expand Up @@ -1349,6 +1361,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: >-
set -e &&
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" &&
rustup target add aarch64-unknown-linux-gnu &&
Expand Down Expand Up @@ -1400,6 +1413,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: >-
set -e &&
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" &&
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request_stats.yml
Expand Up @@ -5,7 +5,7 @@ on:
name: Generate Pull Request Stats

env:
NAPI_CLI_VERSION: 2.7.0
NAPI_CLI_VERSION: 2.12.0
TURBO_VERSION: 1.3.2-canary.1
RUST_TOOLCHAIN: nightly-2022-09-23
PNPM_VERSION: 7.3.0
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
# since the repo's dependencies aren't installed we need
# to install napi globally
- run: npm i -g @napi-rs/cli@2.7.0
- run: npm i -g @napi-rs/cli@${NAPI_CLI_VERSION}
- run: npm i -g turbo@${TURBO_VERSION} pnpm@${PNPM_VERSION}

- name: Build
Expand Down
10 changes: 10 additions & 0 deletions bench/minimal-server/benchmark-app/app/layout.js
@@ -0,0 +1,10 @@
import * as React from 'react'

export default function Root({ children }) {
return (
<html>
<head></head>
<body>{children}</body>
</html>
)
}
5 changes: 5 additions & 0 deletions bench/minimal-server/benchmark-app/app/rsc/page.js
@@ -0,0 +1,5 @@
import * as React from 'react'

export default function page() {
return <div>hello</div>
}
5 changes: 5 additions & 0 deletions bench/minimal-server/benchmark-app/next.config.js
@@ -0,0 +1,5 @@
module.exports = {
experimental: {
appDir: true,
},
}
14 changes: 14 additions & 0 deletions bench/minimal-server/benchmark-app/package.json
@@ -0,0 +1,14 @@
{
"name": "stats-app",
"private": true,
"license": "MIT",
"dependencies": {
"webpack-bundle-analyzer": "^4.6.1",
"webpack-stats-plugin": "^1.1.0"
},
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
}
}
9 changes: 9 additions & 0 deletions bench/minimal-server/benchmark-app/pages/index.js
@@ -0,0 +1,9 @@
import * as React from 'react'

export default function page() {
return <div> hello world </div>
}

export async function getServerSideProps() {
return {}
}
7 changes: 7 additions & 0 deletions bench/minimal-server/package.json
@@ -0,0 +1,7 @@
{
"name": "next-minimal-server",
"description": "Minimal server for Next.js for benchmarking/perf analysis purposes.",
"scripts": {
"start": "node start.js"
}
}

0 comments on commit d108aa1

Please sign in to comment.