Skip to content

Commit 2540b57

Browse files
authored
Merge branch 'canary' into cms-builder-io-example
2 parents 571fd38 + 41efb82 commit 2540b57

File tree

386 files changed

+120431
-86569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

386 files changed

+120431
-86569
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ packages/next-codemod/**/*.js
1616
packages/next-codemod/**/*.d.ts
1717
packages/next-env/**/*.d.ts
1818
test/integration/async-modules/**
19-
test-timings.json
19+
test-timings.json
20+
packages/next/lib/regexr/**/*

.github/ISSUE_TEMPLATE/1.bug_report.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Bug Report
2-
about: Create a bug report for the Next.js core
3-
title: ''
2+
description: Create a bug report for the Next.js core
3+
title: 'Bug Report'
44
labels: 'template: bug'
5-
issue_body: true
65
body:
76
- type: markdown
87
attributes:

.github/ISSUE_TEMPLATE/2.example_bug_report.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Example Bug Report
2-
about: Create a bug report for the examples
3-
title: ''
2+
description: Create a bug report for the examples
3+
title: 'Example Bug Report'
44
labels: 'type: example,template: bug'
5-
issue_body: true
65
body:
76
- type: markdown
87
attributes:

.github/ISSUE_TEMPLATE/3.feature_request.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Feature Request
2-
about: Create a feature request for the Next.js core
3-
title: ''
2+
description: Create a feature request for the Next.js core
3+
title: 'Feature Request'
44
labels: 'template: story'
5-
issue_body: true
65
body:
76
- type: markdown
87
attributes:

.github/actions/next-stats-action/src/add-comment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ module.exports = async function addComment(
8383
else if (!isGzipItem && !groupKey.match(gzipIgnoreRegex)) return
8484

8585
if (
86-
itemKey !== 'buildDuration' ||
86+
!itemKey.startsWith('buildDuration') ||
8787
(isBenchmark && itemKey.match(/req\/sec/))
8888
) {
8989
if (typeof mainItemVal === 'number') mainRepoTotal += mainItemVal

.github/actions/next-stats-action/src/run/index.js

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ async function runConfigs(
2626
let curStats = {
2727
General: {
2828
buildDuration: null,
29+
buildDurationCached: null,
2930
nodeModulesSize: null,
3031
},
3132
}
@@ -55,20 +56,25 @@ async function runConfigs(
5556
)
5657
}
5758

58-
const buildStart = new Date().getTime()
59+
const buildStart = Date.now()
5960
await exec(`cd ${statsAppDir} && ${statsConfig.appBuildCommand}`, false, {
6061
env: yarnEnvValues,
6162
})
62-
curStats.General.buildDuration = new Date().getTime() - buildStart
63+
curStats.General.buildDuration = Date.now() - buildStart
6364

6465
// apply renames to get deterministic output names
6566
for (const rename of config.renames) {
6667
const results = await glob(rename.srcGlob, { cwd: statsAppDir })
67-
if (results.length === 0 || results[0] === rename.dest) continue
68-
await fs.move(
69-
path.join(statsAppDir, results[0]),
70-
path.join(statsAppDir, rename.dest)
71-
)
68+
for (const result of results) {
69+
let dest = rename.removeHash
70+
? result.replace(/(\.|-)[0-9a-f]{20}(\.|-)/g, '$1HASH$2')
71+
: rename.dest
72+
if (result === dest) continue
73+
await fs.move(
74+
path.join(statsAppDir, result),
75+
path.join(statsAppDir, dest)
76+
)
77+
}
7278
}
7379

7480
const collectedStats = await collectStats(config, statsConfig)
@@ -80,19 +86,17 @@ async function runConfigs(
8086
const applyRenames = (renames, stats) => {
8187
if (renames) {
8288
for (const rename of renames) {
89+
let { cur, prev } = rename
90+
cur = path.basename(cur)
91+
prev = path.basename(prev)
92+
8393
Object.keys(stats).forEach((group) => {
84-
Object.keys(stats[group]).forEach((item) => {
85-
let { cur, prev } = rename
86-
cur = path.basename(cur)
87-
prev = path.basename(prev)
88-
89-
if (cur === item) {
90-
stats[group][prev] = stats[group][item]
91-
stats[group][prev + ' gzip'] = stats[group][item + ' gzip']
92-
delete stats[group][item]
93-
delete stats[group][item + ' gzip']
94-
}
95-
})
94+
if (stats[group][cur]) {
95+
stats[group][prev] = stats[group][cur]
96+
stats[group][prev + ' gzip'] = stats[group][cur + ' gzip']
97+
delete stats[group][cur]
98+
delete stats[group][cur + ' gzip']
99+
}
96100
})
97101
}
98102
}
@@ -146,6 +150,12 @@ async function runConfigs(
146150
/* eslint-disable-next-line */
147151
mainRepoStats = curStats
148152
}
153+
154+
const secondBuildStart = Date.now()
155+
await exec(`cd ${statsAppDir} && ${statsConfig.appBuildCommand}`, false, {
156+
env: yarnEnvValues,
157+
})
158+
curStats.General.buildDurationCached = Date.now() - secondBuildStart
149159
}
150160

151161
logger(`Finished running: ${config.title}`)

.github/workflows/build_test_deploy.yml

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -126,30 +126,28 @@ jobs:
126126
- run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
127127
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
128128

129-
- run: yarn add -W --dev [email protected] [email protected]
129+
- run: cd test/integration/with-electron/app && yarn
130130
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
131131

132132
- run: xvfb-run node run-tests.js test/integration/with-electron/test/index.test.js
133133
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
134134

135135
testYarnPnP:
136136
runs-on: ubuntu-latest
137+
needs: build
137138
env:
138139
NODE_OPTIONS: '--unhandled-rejections=strict'
139140
YARN_COMPRESSION_LEVEL: '0'
140141
steps:
141-
- uses: actions/checkout@v2
142+
- uses: actions/cache@v2
143+
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
144+
id: restore-build
142145
with:
143-
fetch-depth: 25
144-
145-
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
146-
id: docs-change
147-
148-
- run: yarn install --frozen-lockfile --check-files
149-
if: ${{steps.docs-change.outputs.DOCS_CHANGE != 'docs only change'}}
146+
path: ./*
147+
key: ${{ github.sha }}
150148

151149
- run: bash ./test-pnp.sh
152-
if: ${{steps.docs-change.outputs.DOCS_CHANGE != 'docs only change'}}
150+
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
153151

154152
testsPass:
155153
name: thank you, next
@@ -161,28 +159,23 @@ jobs:
161159
testFutureDependencies:
162160
name: Webpack 5 (Basic, Production, Acceptance)
163161
runs-on: ubuntu-latest
162+
needs: build
164163
env:
165164
NEXT_TELEMETRY_DISABLED: 1
166165
NEXT_TEST_JOB: 1
167166
HEADLESS: true
168167
NEXT_PRIVATE_TEST_WEBPACK5_MODE: 1
169168

170169
steps:
171-
- uses: actions/checkout@v2
170+
- uses: actions/cache@v2
171+
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
172+
id: restore-build
172173
with:
173-
fetch-depth: 25
174-
175-
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
176-
id: docs-change
177-
178-
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
179-
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
180-
181-
- run: yarn install --check-files
182-
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
174+
path: ./*
175+
key: ${{ github.sha }}
183176

184177
- run: xvfb-run node run-tests.js test/integration/{fallback-modules,link-ref,production,basic,async-modules,font-optimization,ssr-ctx}/test/index.test.js test/acceptance/*.test.js
185-
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
178+
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
186179

187180
testLegacyReact:
188181
name: React 16 + Webpack 4 (Basic, Production, Acceptance)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on:
2+
schedule:
3+
# * is a special character in YAML so you have to quote this string
4+
- cron: '0 0,12 * * *'
5+
6+
name: Test react@experimental
7+
8+
jobs:
9+
# build:
10+
# runs-on: ubuntu-latest
11+
# steps:
12+
# - uses: actions/checkout@v2
13+
14+
# - run: yarn install --frozen-lockfile --check-files
15+
# env:
16+
# NEXT_TELEMETRY_DISABLED: 1
17+
18+
# - run: yarn upgrade react@next react-dom@next -W --dev
19+
20+
# - uses: actions/cache@v2
21+
# id: cache-build
22+
# with:
23+
# path: ./*
24+
# key: ${{ github.sha }}
25+
26+
testAll:
27+
name: Test All
28+
runs-on: ubuntu-latest
29+
# needs: build
30+
env:
31+
NEXT_TELEMETRY_DISABLED: 1
32+
NEXT_PRIVATE_REACT_MODE: concurrent
33+
HEADLESS: true
34+
NEXT_PRIVATE_SKIP_SIZE_TESTS: true
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
group: [1, 2, 3, 4, 5, 6]
39+
steps:
40+
# - uses: actions/cache@v2
41+
# id: restore-build
42+
# with:
43+
# path: ./*
44+
# key: ${{ github.sha }}
45+
46+
- uses: actions/checkout@v2
47+
48+
- run: yarn install --frozen-lockfile --check-files
49+
50+
- run: yarn upgrade react@experimental react-dom@experimental -W --dev
51+
52+
# TODO: remove after we fix watchpack watching too much
53+
- run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
54+
55+
- run: node run-tests.js --timings -g ${{ matrix.group }}/6 -c 3

.github/workflows/test_react_next.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
env:
3131
NEXT_TELEMETRY_DISABLED: 1
3232
HEADLESS: true
33+
NEXT_PRIVATE_SKIP_SIZE_TESTS: true
3334
strategy:
3435
fail-fast: false
3536
matrix:

.vscode/launch.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"runtimeExecutable": "yarn",
1313
"runtimeArgs": ["run", "debug", "dev", "test/integration/basic"],
1414
"skipFiles": ["<node_internals>/**"],
15+
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"],
1516
"port": 9229
1617
},
1718
{

0 commit comments

Comments
 (0)