From 9eceb955969ffa624c4346556a91a057310f84ad Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Mon, 25 Oct 2021 23:22:45 -0500 Subject: [PATCH] Move outputFileTracing config up (#30295) * Move outputFileTracing config up * remove old nftTracing config * remove old config Co-authored-by: Steven --- packages/next/build/index.ts | 4 ++-- packages/next/build/webpack-config.ts | 2 +- packages/next/server/config-shared.ts | 4 ++-- packages/next/server/config.ts | 10 ---------- test/e2e/prerender-native-module.test.ts | 5 ----- test/e2e/prerender.test.ts | 3 --- .../build-trace-extra-entries/app/next.config.js | 3 --- test/integration/production-swcminify/next.config.js | 3 --- test/integration/production/next.config.js | 3 --- test/production/required-server-files.test.ts | 3 --- 10 files changed, 5 insertions(+), 35 deletions(-) diff --git a/packages/next/build/index.ts b/packages/next/build/index.ts index d7229cd35ec7..6122d41a77ba 100644 --- a/packages/next/build/index.ts +++ b/packages/next/build/index.ts @@ -877,7 +877,7 @@ export default async function build( ) }) - if (config.experimental.outputFileTracing) { + if (config.outputFileTracing) { pageTraceIncludes.set(page, workerResult.traceIncludes || []) pageTraceExcludes.set(page, workerResult.traceExcludes || []) } @@ -1021,7 +1021,7 @@ export default async function build( ) } - if (config.experimental.outputFileTracing) { + if (config.outputFileTracing) { const { nodeFileTrace } = require('next/dist/compiled/@vercel/nft') as typeof import('next/dist/compiled/@vercel/nft') diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 460a3b83c14f..f2b2260889ce 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -1229,7 +1229,7 @@ export default async function getBaseWebpackConfig( pagesDir, }), !isServer && new DropClientPage(), - config.experimental.outputFileTracing && + config.outputFileTracing && !isLikeServerless && isServer && !dev && diff --git a/packages/next/server/config-shared.ts b/packages/next/server/config-shared.ts index 62b76e4ec74d..99af2429381c 100644 --- a/packages/next/server/config-shared.ts +++ b/packages/next/server/config-shared.ts @@ -116,6 +116,7 @@ export type NextConfig = { [key: string]: any } & { webpack5?: false strictPostcssConfiguration?: boolean } + outputFileTracing?: boolean staticPageGenerationTimeout?: number crossOrigin?: false | 'anonymous' | 'use-credentials' swcMinify?: boolean @@ -145,7 +146,6 @@ export type NextConfig = { [key: string]: any } & { craCompat?: boolean esmExternals?: boolean | 'loose' isrMemoryCacheSize?: number - outputFileTracing?: boolean concurrentFeatures?: boolean serverComponents?: boolean fullySpecified?: boolean @@ -201,6 +201,7 @@ export const defaultConfig: NextConfig = { httpAgentOptions: { keepAlive: true, }, + outputFileTracing: true, staticPageGenerationTimeout: 60, swcMinify: false, experimental: { @@ -226,7 +227,6 @@ export const defaultConfig: NextConfig = { esmExternals: true, // default to 50MB limit isrMemoryCacheSize: 50 * 1024 * 1024, - outputFileTracing: true, concurrentFeatures: false, serverComponents: false, fullySpecified: false, diff --git a/packages/next/server/config.ts b/packages/next/server/config.ts index 4fe9991e1340..7d7bf828ee83 100644 --- a/packages/next/server/config.ts +++ b/packages/next/server/config.ts @@ -371,16 +371,6 @@ function assignDefaults(userConfig: { [key: string]: any }) { ) } - if (result.experimental && 'nftTracing' in (result.experimental as any)) { - // TODO: remove this warning and assignment when we leave experimental phase - Log.warn( - `Experimental \`nftTracing\` has been renamed to \`outputFileTracing\`. Please update your ${configFileName} file accordingly.` - ) - result.experimental.outputFileTracing = ( - result.experimental as any - ).nftTracing - } - // TODO: Change defaultConfig type to NextConfigComplete // so we don't need "!" here. setHttpAgentOptions( diff --git a/test/e2e/prerender-native-module.test.ts b/test/e2e/prerender-native-module.test.ts index 33f597ea5b1f..8b0810547ef2 100644 --- a/test/e2e/prerender-native-module.test.ts +++ b/test/e2e/prerender-native-module.test.ts @@ -20,11 +20,6 @@ describe('prerender native module', () => { sqlite: '4.0.22', sqlite3: '5.0.2', }, - nextConfig: { - experimental: { - outputFileTracing: true, - }, - }, }) }) afterAll(() => next.destroy()) diff --git a/test/e2e/prerender.test.ts b/test/e2e/prerender.test.ts index 4f9025076f32..4a081aee9f09 100644 --- a/test/e2e/prerender.test.ts +++ b/test/e2e/prerender.test.ts @@ -28,9 +28,6 @@ describe('Prerender', () => { firebase: '7.14.5', }, nextConfig: { - experimental: { - outputFileTracing: true, - }, async rewrites() { return [ { diff --git a/test/integration/build-trace-extra-entries/app/next.config.js b/test/integration/build-trace-extra-entries/app/next.config.js index 6d63473ab030..bb188bcf77e8 100644 --- a/test/integration/build-trace-extra-entries/app/next.config.js +++ b/test/integration/build-trace-extra-entries/app/next.config.js @@ -1,9 +1,6 @@ const path = require('path') module.exports = { - experimental: { - outputFileTracing: true, - }, webpack(cfg, { isServer }) { console.log(cfg.entry) const origEntry = cfg.entry diff --git a/test/integration/production-swcminify/next.config.js b/test/integration/production-swcminify/next.config.js index 97a8dddde665..ddcef11239b0 100644 --- a/test/integration/production-swcminify/next.config.js +++ b/test/integration/production-swcminify/next.config.js @@ -3,9 +3,6 @@ setInterval(() => {}, 250) module.exports = { swcMinify: true, - experimental: { - outputFileTracing: true, - }, onDemandEntries: { // Make sure entries are not getting disposed. maxInactiveAge: 1000 * 60 * 60, diff --git a/test/integration/production/next.config.js b/test/integration/production/next.config.js index 7b95408bd267..cc65ddf36517 100644 --- a/test/integration/production/next.config.js +++ b/test/integration/production/next.config.js @@ -2,9 +2,6 @@ setInterval(() => {}, 250) module.exports = { - experimental: { - outputFileTracing: true, - }, onDemandEntries: { // Make sure entries are not getting disposed. maxInactiveAge: 1000 * 60 * 60, diff --git a/test/production/required-server-files.test.ts b/test/production/required-server-files.test.ts index 3dc8e6287d41..f3bebcf48fbd 100644 --- a/test/production/required-server-files.test.ts +++ b/test/production/required-server-files.test.ts @@ -30,9 +30,6 @@ describe('should set-up next', () => { ), }, nextConfig: { - experimental: { - outputFileTracing: true, - }, eslint: { ignoreDuringBuilds: true, },