Skip to content

Commit

Permalink
remove legacy deprecated warnings (#65579)
Browse files Browse the repository at this point in the history
# 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)
  • Loading branch information
huozhi committed May 10, 2024
1 parent bebda11 commit f94e213
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 110 deletions.
1 change: 0 additions & 1 deletion packages/next-swc/crates/next-core/src/next_config.rs
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
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
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
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
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
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
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
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
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

0 comments on commit f94e213

Please sign in to comment.