Skip to content

Commit 0faaf69

Browse files
committed
Remove Collecting build traces JS step
1 parent f17ecfc commit 0faaf69

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

packages/next/src/build/collect-build-traces.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ export async function collectBuildTraces({
8282
hasSsrAmpPages,
8383
buildTraceContext,
8484
outputFileTracingRoot,
85-
isTurbopack,
8685
}: {
8786
dir: string
8887
distDir: string
@@ -94,7 +93,6 @@ export async function collectBuildTraces({
9493
nextBuildSpan?: Span
9594
config: NextConfigComplete
9695
buildTraceContext?: BuildTraceContext
97-
isTurbopack: boolean
9896
}) {
9997
const startTime = Date.now()
10098
debug('starting build traces')
@@ -111,13 +109,11 @@ export async function collectBuildTraces({
111109
.traceAsyncFn(async () => {
112110
const nextServerTraceOutput = path.join(
113111
distDir,
114-
isTurbopack ? 'next-server.ref.js.nft.json' : 'next-server.js.nft.json'
112+
'next-server.js.nft.json'
115113
)
116114
const nextMinimalTraceOutput = path.join(
117115
distDir,
118-
isTurbopack
119-
? 'next-minimal-server.ref.js.nft.json'
120-
: 'next-minimal-server.js.nft.json'
116+
'next-minimal-server.js.nft.json'
121117
)
122118
const root = outputFileTracingRoot
123119

@@ -282,11 +278,6 @@ export async function collectBuildTraces({
282278
)
283279
}
284280

285-
if (isTurbopack) {
286-
addToTracedFiles(distDir, './package.json', serverTracedFiles)
287-
addToTracedFiles(distDir, './package.json', minimalServerTracedFiles)
288-
}
289-
290281
{
291282
const chunksToTrace: string[] = [
292283
...(buildTraceContext?.chunksTrace?.action.input || []),

packages/next/src/build/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,7 +1736,6 @@ export default async function build(
17361736
hasSsrAmpPages: false,
17371737
buildTraceContext,
17381738
outputFileTracingRoot,
1739-
isTurbopack: false,
17401739
})
17411740
.catch((err) => {
17421741
console.error(err)
@@ -2630,7 +2629,7 @@ export default async function build(
26302629

26312630
await writeFunctionsConfigManifest(distDir, functionsConfigManifest)
26322631

2633-
if (!isGenerateMode && !buildTracesPromise) {
2632+
if (!isTurbopack && !isGenerateMode && !buildTracesPromise) {
26342633
buildTracesPromise = collectBuildTraces({
26352634
dir,
26362635
config,
@@ -2641,7 +2640,6 @@ export default async function build(
26412640
hasSsrAmpPages,
26422641
buildTraceContext,
26432642
outputFileTracingRoot,
2644-
isTurbopack,
26452643
}).catch((err) => {
26462644
console.error(err)
26472645
process.exit(1)
@@ -3923,7 +3921,10 @@ export default async function build(
39233921
}
39243922

39253923
const postBuildSpinner = createSpinner('Finalizing page optimization')
3926-
let buildTracesSpinner = createSpinner(`Collecting build traces`)
3924+
let buildTracesSpinner
3925+
if (buildTracesPromise) {
3926+
buildTracesSpinner = createSpinner('Collecting build traces')
3927+
}
39273928

39283929
// ensure the worker is not left hanging
39293930
worker.end()

test/production/app-dir/build-output-tree-view/build-output-tree-view.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ describe('build-output-tree-view', () => {
7474
})
7575

7676
function getTreeView(cliOutput: string): string {
77-
let foundBuildTracesLine = false
77+
let foundStart = false
7878
const lines: string[] = []
7979

8080
for (const line of cliOutput.split('\n')) {
81-
if (foundBuildTracesLine) {
81+
foundStart ||= line.startsWith('Route ')
82+
83+
if (foundStart) {
8284
lines.push(line)
8385
}
84-
85-
foundBuildTracesLine ||= line.includes('Collecting build traces')
8686
}
8787

8888
return lines.join('\n').trim()

0 commit comments

Comments
 (0)