Unverified Commit f94e213d authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

remove legacy deprecated warnings (#65579)

# What
Remove the previous deprecated flags and warnings

Removed deprecated types:

In `next.config.js`
- `experimental.incrementalCacheHandlerPath` (has moved to new options
in next 14)
- `experimental.isrMemoryCacheSize` (has moved to new options in next
14)
- `outputFileTracing` (not support customization anymore)
- `swcMinify` (not support customization anymore)

In `next/types`
- `unstable_includeFiles` (already deprecated for a while)
- `unstable_excludeFiles` (already deprecated for a while)
parent bebda113
......@@ -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>,
......
......@@ -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,
......
......@@ -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
......
......@@ -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)(
......
......@@ -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',
......
......@@ -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(),
......
......@@ -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
......@@ -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
*
......@@ -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
*
......@@ -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,
......
......@@ -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',
......@@ -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) {
......
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment