diff --git a/packages/next-swc/crates/next-build/src/next_app/app_entries.rs b/packages/next-swc/crates/next-build/src/next_app/app_entries.rs index 8b8f75b289b36..973b30ea7d548 100644 --- a/packages/next-swc/crates/next-build/src/next_app/app_entries.rs +++ b/packages/next-swc/crates/next-build/src/next_app/app_entries.rs @@ -61,7 +61,7 @@ pub async fn get_app_entries( server_compile_time_info: Vc, next_config: Vc, ) -> Result> { - let app_dir = find_app_dir_if_enabled(project_root, next_config); + let app_dir = find_app_dir_if_enabled(project_root); let Some(&app_dir) = app_dir.await?.as_ref() else { return Ok(AppEntries::cell(AppEntries { diff --git a/packages/next-swc/crates/next-core/src/app_structure.rs b/packages/next-swc/crates/next-core/src/app_structure.rs index 3967fc89d8d3a..c09ccdc644c98 100644 --- a/packages/next-swc/crates/next-core/src/app_structure.rs +++ b/packages/next-swc/crates/next-core/src/app_structure.rs @@ -243,13 +243,7 @@ pub async fn find_app_dir(project_path: Vc) -> Result, - next_config: Vc, -) -> Result> { - if !*next_config.app_dir().await? { - return Ok(Vc::cell(None)); - } +pub async fn find_app_dir_if_enabled(project_path: Vc) -> Result> { Ok(find_app_dir(project_path)) } diff --git a/packages/next-swc/crates/next-core/src/next_config.rs b/packages/next-swc/crates/next-core/src/next_config.rs index 4c61e995c3a16..443f07f6bf3f5 100644 --- a/packages/next-swc/crates/next-core/src/next_config.rs +++ b/packages/next-swc/crates/next-core/src/next_config.rs @@ -403,7 +403,6 @@ pub enum LoaderItem { #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, TraceRawVcs)] #[serde(rename_all = "camelCase")] pub struct ExperimentalConfig { - pub app_dir: Option, pub server_components_external_packages: Option>, pub turbo: Option, pub allowed_revalidate_header_keys: Option>, @@ -527,18 +526,6 @@ impl NextConfig { )) } - #[turbo_tasks::function] - pub async fn app_dir(self: Vc) -> Result> { - Ok(Vc::cell( - self.await? - .experimental - .app_dir - .as_ref() - .cloned() - .unwrap_or_default(), - )) - } - #[turbo_tasks::function] pub async fn env(self: Vc) -> Result> { // The value expected for env is Record, but config itself diff --git a/packages/next-swc/crates/next-dev/src/lib.rs b/packages/next-swc/crates/next-dev/src/lib.rs index 902ab2c13bc90..85810cde65812 100644 --- a/packages/next-swc/crates/next-dev/src/lib.rs +++ b/packages/next-swc/crates/next-dev/src/lib.rs @@ -388,7 +388,7 @@ async fn source( next_config, server_addr, ); - let app_dir = find_app_dir_if_enabled(project_path, next_config); + let app_dir = find_app_dir_if_enabled(project_path); let app_source = create_app_source( app_dir, project_path, diff --git a/packages/next/src/build/utils.ts b/packages/next/src/build/utils.ts index 8ca734be0f830..35a3b907a53bc 100644 --- a/packages/next/src/build/utils.ts +++ b/packages/next/src/build/utils.ts @@ -1987,7 +1987,7 @@ startServer({ port: currentPort, allowRetry: false, keepAliveTimeout, - useWorkers: !!nextConfig.experimental?.appDir, + useWorkers: true, }).catch((err) => { console.error(err); process.exit(1); diff --git a/packages/next/src/cli/next-dev.ts b/packages/next/src/cli/next-dev.ts index 765bdf051d1f7..969712a27492d 100644 --- a/packages/next/src/cli/next-dev.ts +++ b/packages/next/src/cli/next-dev.ts @@ -11,7 +11,7 @@ import { CliCommand } from '../lib/commands' import { getProjectDir } from '../lib/get-project-dir' import { CONFIG_FILES, PHASE_DEVELOPMENT_SERVER } from '../shared/lib/constants' import path from 'path' -import { defaultConfig, NextConfigComplete } from '../server/config-shared' +import { NextConfigComplete } from '../server/config-shared' import { traceGlobals } from '../trace/shared' import { Telemetry } from '../telemetry/storage' import loadConfig from '../server/config' @@ -352,12 +352,7 @@ const nextDev: CliCommand = async (argv) => { }) const distDir = path.join(dir, rawNextConfig.distDir || '.next') - const { pagesDir, appDir } = findPagesDir( - dir, - typeof rawNextConfig?.experimental?.appDir === 'undefined' - ? !!defaultConfig.experimental?.appDir - : !!rawNextConfig.experimental?.appDir - ) + const { pagesDir, appDir } = findPagesDir(dir, true) const telemetry = new Telemetry({ distDir, }) diff --git a/packages/next/src/server/config-schema.ts b/packages/next/src/server/config-schema.ts index 50d91ae00d8a6..935b5814b8f98 100644 --- a/packages/next/src/server/config-schema.ts +++ b/packages/next/src/server/config-schema.ts @@ -298,9 +298,6 @@ const configSchema = { }, ] as any, }, - appDir: { - type: 'boolean', - }, serverActions: { type: 'boolean', }, diff --git a/packages/next/src/server/config-shared.ts b/packages/next/src/server/config-shared.ts index 4ef7751f618e3..6d8b4762e219d 100644 --- a/packages/next/src/server/config-shared.ts +++ b/packages/next/src/server/config-shared.ts @@ -183,11 +183,6 @@ export interface ExperimentalConfig { nextScriptWorkers?: boolean scrollRestoration?: boolean externalDir?: boolean - /** - * The App Router (app directory) enables support for layouts, Server Components, streaming, and colocated data fetching. - * @see https://nextjs.org/docs/app/api-reference/next-config-js/appDir - */ - appDir?: boolean amp?: { optimizer?: any validator?: string @@ -702,7 +697,7 @@ export const defaultConfig: NextConfig = { deploymentId: undefined, useDeploymentIdServerActions: false, appDocumentPreloading: undefined, - clientRouterFilter: false, + clientRouterFilter: true, clientRouterFilterRedirects: false, fetchCacheKeyPrefix: '', middlewarePrefetch: 'flexible', @@ -727,7 +722,6 @@ export const defaultConfig: NextConfig = { gzipSize: true, craCompat: false, esmExternals: true, - appDir: true, // default to 50MB limit isrMemoryCacheSize: 50 * 1024 * 1024, incrementalCacheHandlerPath: undefined, diff --git a/packages/next/src/server/config.ts b/packages/next/src/server/config.ts index 49c8ecd87df2a..cfdf251330d82 100644 --- a/packages/next/src/server/config.ts +++ b/packages/next/src/server/config.ts @@ -425,13 +425,6 @@ function assignDefaults( silent ) - if ( - typeof userConfig.experimental?.clientRouterFilter === 'undefined' && - result.experimental?.appDir - ) { - result.experimental.clientRouterFilter = true - } - if ( result.experimental?.outputFileTracingRoot && !isAbsolute(result.experimental.outputFileTracingRoot)