Skip to content

Commit 4a1185a

Browse files
committed
just use the whole_app_module_graph
1 parent 44451a3 commit 4a1185a

File tree

6 files changed

+10
-18
lines changed

6 files changed

+10
-18
lines changed

crates/next-core/src/next_config.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ pub struct ExperimentalConfig {
876876
turbopack_tree_shaking: Option<bool>,
877877
turbopack_scope_hoisting: Option<bool>,
878878
turbopack_use_system_tls_certs: Option<bool>,
879-
turbopack_use_production_chunking_in_dev: Option<bool>,
879+
turbopack_use_whole_app_module_graph_in_dev: Option<bool>,
880880
/// Disable automatic configuration of the sass loader.
881881
#[serde(default)]
882882
turbopack_use_builtin_sass: Option<bool>,
@@ -1823,7 +1823,7 @@ impl NextConfig {
18231823
// module graph as well.
18241824
NextMode::Development => self
18251825
.experimental
1826-
.turbopack_use_production_chunking_in_dev
1826+
.turbopack_use_whole_app_module_graph_in_dev
18271827
.unwrap_or(true),
18281828
NextMode::Build => true,
18291829
}))
@@ -1832,17 +1832,7 @@ impl NextConfig {
18321832
#[turbo_tasks::function]
18331833
pub async fn turbo_chunking_style(&self, mode: Vc<NextMode>) -> Result<Vc<ChunkingStyle>> {
18341834
Ok(match *mode.await? {
1835-
NextMode::Development => {
1836-
if self
1837-
.experimental
1838-
.turbopack_use_production_chunking_in_dev
1839-
.unwrap_or(true)
1840-
{
1841-
ChunkingStyle::production()
1842-
} else {
1843-
ChunkingStyle::development()
1844-
}
1845-
}
1835+
NextMode::Development => ChunkingStyle::development(),
18461836
NextMode::Build => ChunkingStyle::production(),
18471837
})
18481838
}

packages/next/src/server/config-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ export const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>
475475
turbopackUseSystemTlsCerts: z.boolean().optional(),
476476
turbopackUseBuiltinBabel: z.boolean().optional(),
477477
turbopackUseBuiltinSass: z.boolean().optional(),
478-
turbopackUseProductionChunkingInDev: z.boolean().optional(),
478+
turbopackUseWholeAppModuleGraphInDev: z.boolean().optional(),
479479
optimizePackageImports: z.array(z.string()).optional(),
480480
optimizeServerReact: z.boolean().optional(),
481481
clientTraceMetadata: z.array(z.string()).optional(),

packages/next/src/server/config-shared.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,10 @@ export interface ExperimentalConfig {
654654
turbopackUseBuiltinSass?: boolean
655655

656656
/**
657-
* Whether to use production chunking in development mode. This makes development mode chunking more like production but may come with an HMR performance regression.
657+
* Whether to compute the whole app module graph in development mode. This may reduce memory usage
658+
* by enabling more sharing of chunking decisions across routes.
658659
*/
659-
turbopackUseProductionChunkingInDev?: boolean
660+
turbopackUseWholeAppModuleGraphInDev?: boolean
660661

661662
/**
662663
* For use with `@next/mdx`. Compile MDX files using the new Rust compiler.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
experimental: {
3-
turbopackUseProductionChunkingInDev: true,
3+
turbopackUseWholeAppModuleGraphInDev: true,
44
},
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
experimental: {
3-
turbopackUseProductionChunkingInDev: true,
3+
turbopackUseWholeAppModuleGraphInDev: true,
44
},
55
}

turbopack/crates/turbopack-core/src/chunk/chunking_context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ pub struct ChunkingConfigs(FxHashMap<ResolvedVc<Box<dyn ChunkType>>, ChunkingCon
154154
pub trait ChunkingContext {
155155
#[turbo_tasks::function]
156156
fn name(self: Vc<Self>) -> Vc<RcStr>;
157+
/// Whether to use file URIs in source maps.
157158
#[turbo_tasks::function]
158159
fn should_use_file_source_map_uris(self: Vc<Self>) -> Vc<bool>;
159160
/// The root path of the project

0 commit comments

Comments
 (0)