Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove legacy deprecated warnings #65579

Merged
merged 6 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/next-swc/crates/next-core/src/next_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ pub struct NextConfig {
generate_etags: bool,
http_agent_options: HttpAgentConfig,
on_demand_entries: OnDemandEntriesConfig,
output_file_tracing: bool,
powered_by_header: bool,
production_browser_source_maps: bool,
public_runtime_config: IndexMap<String, serde_json::Value>,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2383,7 +2383,7 @@ export default async function build(

await writeFunctionsConfigManifest(distDir, functionsConfigManifest)

if (!isGenerateMode && config.outputFileTracing && !buildTracesPromise) {
if (!isGenerateMode && !buildTracesPromise) {
buildTracesPromise = collectBuildTraces({
dir,
config,
Expand Down
6 changes: 0 additions & 6 deletions packages/next/src/build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1769,12 +1769,6 @@ export async function isPageStatic({
? {}
: componentsResult.pageConfig

if (config.unstable_includeFiles || config.unstable_excludeFiles) {
Log.warn(
`unstable_includeFiles/unstable_excludeFiles has been removed in favor of the option in next.config.js.\nSee more info here: https://nextjs.org/docs/advanced-features/output-file-tracing#caveats`
)
}

let isStatic = false
if (!hasStaticProps && !hasGetInitialProps && !hasServerProps) {
isStatic = true
Expand Down
3 changes: 1 addition & 2 deletions packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1761,8 +1761,7 @@ export default async function getBaseWebpackConfig(
dev,
}),
(isClient || isEdgeServer) && new DropClientPage(),
config.outputFileTracing &&
isNodeServer &&
isNodeServer &&
!dev &&
new (require('./webpack/plugins/next-trace-entrypoints-plugin')
.TraceEntryPointsPlugin as typeof import('./webpack/plugins/next-trace-entrypoints-plugin').TraceEntryPointsPlugin)(
Expand Down
1 change: 0 additions & 1 deletion packages/next/src/lib/turbopack-warning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const unsupportedTurbopackNextConfigOptions = [

// The following will need to be supported by `next build --turbo`
const unsupportedProductionSpecificTurbopackNextConfigOptions = [
'outputFileTracing',
// TODO: Support disabling sourcemaps, currently they're always enabled.
// 'productionBrowserSourceMaps',
'reactProductionProfiling',
Expand Down
1 change: 0 additions & 1 deletion packages/next/src/server/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@ export const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>
.optional(),
optimizeFonts: z.boolean().optional(),
output: z.enum(['standalone', 'export']).optional(),
outputFileTracing: z.boolean().optional(),
pageExtensions: z.array(z.string()).min(1).optional(),
poweredByHeader: z.boolean().optional(),
productionBrowserSourceMaps: z.boolean().optional(),
Expand Down
29 changes: 0 additions & 29 deletions packages/next/src/server/config-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,7 @@ export interface ExperimentalConfig {
* much as possible, even when this leads to many requests.
*/
cssChunking?: 'strict' | 'loose'
/**
* @deprecated use config.cacheHandler instead
*/
incrementalCacheHandlerPath?: string
/**
* @deprecated use config.cacheMaxMemorySize instead
*
*/
isrMemoryCacheSize?: number
disablePostcssPresetEnv?: boolean
swcMinify?: boolean
cpus?: number
memoryBasedWorkersCount?: boolean
proxyTimeout?: number
Expand Down Expand Up @@ -728,16 +718,6 @@ export interface NextConfig extends Record<string, any> {
*/
httpAgentOptions?: { keepAlive?: boolean }

/**
* During a build, Next.js will automatically trace each page and its dependencies to determine all of the files
* that are needed for deploying a production version of your application.
*
* @see [Output File Tracing](https://nextjs.org/docs/advanced-features/output-file-tracing)
* @deprecated will be enabled by default and removed in Next.js 15
*
*/
outputFileTracing?: boolean

/**
* Timeout after waiting to generate static pages in seconds
*
Expand All @@ -753,14 +733,6 @@ export interface NextConfig extends Record<string, any> {
*/
crossOrigin?: 'anonymous' | 'use-credentials'

/**
* Use [SWC compiler](https://swc.rs) to minify the generated JavaScript
* @deprecated will be enabled by default and removed in Next.js 15
*
* @see [SWC Minification](https://nextjs.org/docs/advanced-features/compiler#minification)
*/
swcMinify?: boolean

/**
* Optionally enable compiler transforms
*
Expand Down Expand Up @@ -895,7 +867,6 @@ export const defaultConfig: NextConfig = {
httpAgentOptions: {
keepAlive: true,
},
outputFileTracing: true,
staticPageGenerationTimeout: 60,
swcMinify: true,
output: !!process.env.NEXT_PRIVATE_STANDALONE ? 'standalone' : undefined,
Expand Down
59 changes: 0 additions & 59 deletions packages/next/src/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,56 +465,6 @@ function assignDefaults(
}
}

if (result.experimental?.incrementalCacheHandlerPath) {
// TODO: Remove this warning in Next.js 15
warnOptionHasBeenDeprecated(
result,
'experimental.incrementalCacheHandlerPath',
'The "experimental.incrementalCacheHandlerPath" option has been renamed to "cacheHandler". Please update your next.config.js.',
silent
)
}

if (result.experimental?.isrMemoryCacheSize) {
// TODO: Remove this warning in Next.js 15
warnOptionHasBeenDeprecated(
result,
'experimental.isrMemoryCacheSize',
'The "experimental.isrMemoryCacheSize" option has been renamed to "cacheMaxMemorySize". Please update your next.config.js.',
silent
)
}

if (typeof result.experimental?.serverActions === 'boolean') {
// TODO: Remove this warning in Next.js 15
warnOptionHasBeenDeprecated(
result,
'experimental.serverActions',
'Server Actions are available by default now, `experimental.serverActions` option can be safely removed.',
silent
)
}

if (result.swcMinify === false) {
// TODO: Remove this warning in Next.js 15
warnOptionHasBeenDeprecated(
result,
'swcMinify',
'Disabling SWC Minifier will not be an option in the next major version. Please report any issues you may be experiencing to https://github.com/vercel/next.js/issues',
silent
)
}

if (result.outputFileTracing === false) {
// TODO: Remove this warning in Next.js 15
warnOptionHasBeenDeprecated(
result,
'outputFileTracing',
'Disabling outputFileTracing will not be an option in the next major version. Please report any issues you may be experiencing to https://github.com/vercel/next.js/issues',
silent
)
}

warnOptionHasBeenMovedOutOfExperimental(
result,
'relay',
Expand Down Expand Up @@ -631,15 +581,6 @@ function assignDefaults(
}
}

if (result.output === 'standalone' && !result.outputFileTracing) {
if (!silent) {
Log.warn(
`"output: 'standalone'" requires outputFileTracing not be disabled please enable it to leverage the standalone build`
)
}
result.output = undefined
}

setHttpClientAndAgentOptions(result || defaultConfig)

if (result.i18n) {
Expand Down
10 changes: 0 additions & 10 deletions packages/next/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,6 @@ export type PageConfig = {
runtime?: ServerRuntime
unstable_runtimeJS?: false
unstable_JsPreload?: false
/**
* @deprecated this config has been removed in favor of the next.config.js option
*/
// TODO: remove in next minor release (current v13.1.1)
unstable_includeFiles?: string[]
/**
* @deprecated this config has been removed in favor of the next.config.js option
*/
// TODO: remove in next minor release (current v13.1.1)
unstable_excludeFiles?: string[]
}

export type {
Expand Down