Skip to content

Commit

Permalink
Move outputFileTracing config up (#30295)
Browse files Browse the repository at this point in the history
* Move outputFileTracing config up

* remove old nftTracing config

* remove old config

Co-authored-by: Steven <steven@ceriously.com>
  • Loading branch information
ijjk and styfle committed Oct 26, 2021
1 parent 9101df7 commit 9eceb95
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 35 deletions.
4 changes: 2 additions & 2 deletions packages/next/build/index.ts
Expand Up @@ -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 || [])
}
Expand Down Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/webpack-config.ts
Expand Up @@ -1229,7 +1229,7 @@ export default async function getBaseWebpackConfig(
pagesDir,
}),
!isServer && new DropClientPage(),
config.experimental.outputFileTracing &&
config.outputFileTracing &&
!isLikeServerless &&
isServer &&
!dev &&
Expand Down
4 changes: 2 additions & 2 deletions packages/next/server/config-shared.ts
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -201,6 +201,7 @@ export const defaultConfig: NextConfig = {
httpAgentOptions: {
keepAlive: true,
},
outputFileTracing: true,
staticPageGenerationTimeout: 60,
swcMinify: false,
experimental: {
Expand All @@ -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,
Expand Down
10 changes: 0 additions & 10 deletions packages/next/server/config.ts
Expand Up @@ -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(
Expand Down
5 changes: 0 additions & 5 deletions test/e2e/prerender-native-module.test.ts
Expand Up @@ -20,11 +20,6 @@ describe('prerender native module', () => {
sqlite: '4.0.22',
sqlite3: '5.0.2',
},
nextConfig: {
experimental: {
outputFileTracing: true,
},
},
})
})
afterAll(() => next.destroy())
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/prerender.test.ts
Expand Up @@ -28,9 +28,6 @@ describe('Prerender', () => {
firebase: '7.14.5',
},
nextConfig: {
experimental: {
outputFileTracing: true,
},
async rewrites() {
return [
{
Expand Down
3 changes: 0 additions & 3 deletions 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
Expand Down
3 changes: 0 additions & 3 deletions test/integration/production-swcminify/next.config.js
Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions test/integration/production/next.config.js
Expand Up @@ -2,9 +2,6 @@
setInterval(() => {}, 250)

module.exports = {
experimental: {
outputFileTracing: true,
},
onDemandEntries: {
// Make sure entries are not getting disposed.
maxInactiveAge: 1000 * 60 * 60,
Expand Down
3 changes: 0 additions & 3 deletions test/production/required-server-files.test.ts
Expand Up @@ -30,9 +30,6 @@ describe('should set-up next', () => {
),
},
nextConfig: {
experimental: {
outputFileTracing: true,
},
eslint: {
ignoreDuringBuilds: true,
},
Expand Down

0 comments on commit 9eceb95

Please sign in to comment.