From c192f4ec2fd5cb90b06a7ba256d4aad537f33bcf Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Thu, 18 Jan 2024 18:10:10 +0100 Subject: [PATCH] turbopack: rename custom cache handler configs (#60828) Follow up for #57953 for turbopack side Closes NEXT-2153 --- .../next-swc/crates/next-core/src/next_config.rs | 14 ++++++++------ packages/next-swc/crates/next-core/src/util.rs | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) 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 50e1adf3acf67..171363dcc67e7 100644 --- a/packages/next-swc/crates/next-core/src/next_config.rs +++ b/packages/next-swc/crates/next-core/src/next_config.rs @@ -78,6 +78,13 @@ pub struct NextConfig { pub config_file: Option, pub config_file_name: String, + /// In-memory cache size in bytes. + /// + /// If `cache_max_memory_size: 0` disables in-memory caching. + pub cache_max_memory_size: Option, + /// custom path to a cache handler to use + pub cache_handler: Option, + pub env: IndexMap, pub experimental: ExperimentalConfig, pub images: ImageConfig, @@ -427,10 +434,6 @@ pub struct ExperimentalConfig { pub client_router_filter_allowed_rate: Option, pub client_router_filter_redirects: Option, pub fetch_cache_key_prefix: Option, - /// In-memory cache size in bytes. - /// - /// If `isr_memory_cache_size: 0` disables in-memory caching. - pub isr_memory_cache_size: Option, pub isr_flush_to_disk: Option, /// For use with `@next/mdx`. Compile MDX files using the new Rust compiler. /// @see https://nextjs.org/docs/app/api-reference/next-config-js/mdxRs @@ -481,8 +484,7 @@ pub struct ExperimentalConfig { force_swc_transforms: Option, fully_specified: Option, gzip_size: Option, - /// custom path to a cache handler to use - incremental_cache_handler_path: Option, + instrumentation_hook: Option, large_page_data_bytes: Option, logging: Option, diff --git a/packages/next-swc/crates/next-core/src/util.rs b/packages/next-swc/crates/next-core/src/util.rs index 25d10c1551d02..d1be0e3e78c7b 100644 --- a/packages/next-swc/crates/next-core/src/util.rs +++ b/packages/next-swc/crates/next-core/src/util.rs @@ -734,7 +734,7 @@ pub async fn render_data( server_info: server_info.ok(), allowed_revalidate_header_keys: experimental.allowed_revalidate_header_keys.clone(), fetch_cache_key_prefix: experimental.fetch_cache_key_prefix.clone(), - isr_memory_cache_size: experimental.isr_memory_cache_size, + isr_memory_cache_size: config.cache_max_memory_size, isr_flush_to_disk: experimental.isr_flush_to_disk, })?; Ok(Vc::cell(value))