Skip to content

Commit

Permalink
turbopack: rename custom cache handler configs (#60828)
Browse files Browse the repository at this point in the history
Follow up for #57953 for turbopack side

Closes NEXT-2153
  • Loading branch information
huozhi committed Jan 18, 2024
1 parent 2227ae5 commit c192f4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions packages/next-swc/crates/next-core/src/next_config.rs
Expand Up @@ -78,6 +78,13 @@ pub struct NextConfig {
pub config_file: Option<String>,
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<f64>,
/// custom path to a cache handler to use
pub cache_handler: Option<String>,

pub env: IndexMap<String, JsonValue>,
pub experimental: ExperimentalConfig,
pub images: ImageConfig,
Expand Down Expand Up @@ -427,10 +434,6 @@ pub struct ExperimentalConfig {
pub client_router_filter_allowed_rate: Option<f64>,
pub client_router_filter_redirects: Option<bool>,
pub fetch_cache_key_prefix: Option<String>,
/// In-memory cache size in bytes.
///
/// If `isr_memory_cache_size: 0` disables in-memory caching.
pub isr_memory_cache_size: Option<f64>,
pub isr_flush_to_disk: Option<bool>,
/// 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
Expand Down Expand Up @@ -481,8 +484,7 @@ pub struct ExperimentalConfig {
force_swc_transforms: Option<bool>,
fully_specified: Option<bool>,
gzip_size: Option<bool>,
/// custom path to a cache handler to use
incremental_cache_handler_path: Option<String>,

instrumentation_hook: Option<bool>,
large_page_data_bytes: Option<f64>,
logging: Option<serde_json::Value>,
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/next-core/src/util.rs
Expand Up @@ -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))
Expand Down

0 comments on commit c192f4e

Please sign in to comment.