Skip to content

Commit 594e278

Browse files
bgwhuozhi
authored andcommitted
Turbopack: chore: Remove dead experimental.ppr struct field (#85792)
- `experimental.ppr` was replaced with `cacheComponents`. - It's still in the zod and TS type schemas, I think for our error messages on the Next.js side, but Turbopack only needs to know about the fields that Turbopack cares about. Serde silently ignores unknown fields by default. - Nothing was reading this field from this struct. - This unit test coverage is very overkill.
1 parent c75e4c7 commit 594e278

File tree

1 file changed

+0
-66
lines changed

1 file changed

+0
-66
lines changed

crates/next-core/src/next_config.rs

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -863,9 +863,6 @@ pub struct ExperimentalConfig {
863863
/// Automatically apply the "modularize_imports" optimization to imports of
864864
/// the specified packages.
865865
optimize_package_imports: Option<Vec<RcStr>>,
866-
/// Using this feature will enable the `react@experimental` for the `app`
867-
/// directory.
868-
ppr: Option<ExperimentalPartialPrerendering>,
869866
taint: Option<bool>,
870867
proxy_timeout: Option<f64>,
871868
/// enables the minification of server code.
@@ -962,53 +959,6 @@ fn test_cache_life_profiles_invalid() {
962959
);
963960
}
964961

965-
#[derive(
966-
Clone, Debug, PartialEq, Serialize, Deserialize, TraceRawVcs, NonLocalValue, OperationValue,
967-
)]
968-
#[serde(rename_all = "lowercase")]
969-
pub enum ExperimentalPartialPrerenderingIncrementalValue {
970-
Incremental,
971-
}
972-
973-
#[derive(
974-
Clone, Debug, PartialEq, Deserialize, Serialize, TraceRawVcs, NonLocalValue, OperationValue,
975-
)]
976-
#[serde(untagged)]
977-
pub enum ExperimentalPartialPrerendering {
978-
Boolean(bool),
979-
Incremental(ExperimentalPartialPrerenderingIncrementalValue),
980-
}
981-
982-
#[test]
983-
fn test_parse_experimental_partial_prerendering() {
984-
let json = serde_json::json!({
985-
"ppr": "incremental"
986-
});
987-
let config: ExperimentalConfig = serde_json::from_value(json).unwrap();
988-
assert_eq!(
989-
config.ppr,
990-
Some(ExperimentalPartialPrerendering::Incremental(
991-
ExperimentalPartialPrerenderingIncrementalValue::Incremental
992-
))
993-
);
994-
995-
let json = serde_json::json!({
996-
"ppr": true
997-
});
998-
let config: ExperimentalConfig = serde_json::from_value(json).unwrap();
999-
assert_eq!(
1000-
config.ppr,
1001-
Some(ExperimentalPartialPrerendering::Boolean(true))
1002-
);
1003-
1004-
// Expect if we provide a random string, it will fail.
1005-
let json = serde_json::json!({
1006-
"ppr": "random"
1007-
});
1008-
let config = serde_json::from_value::<ExperimentalConfig>(json);
1009-
assert!(config.is_err());
1010-
}
1011-
1012962
#[derive(
1013963
Clone, Debug, PartialEq, Eq, Serialize, Deserialize, TraceRawVcs, NonLocalValue, OperationValue,
1014964
)]
@@ -1719,22 +1669,6 @@ impl NextConfig {
17191669
}
17201670
}
17211671

1722-
#[turbo_tasks::function]
1723-
pub fn enable_ppr(&self) -> Vc<bool> {
1724-
Vc::cell(
1725-
self.experimental
1726-
.ppr
1727-
.as_ref()
1728-
.map(|ppr| match ppr {
1729-
ExperimentalPartialPrerendering::Incremental(
1730-
ExperimentalPartialPrerenderingIncrementalValue::Incremental,
1731-
) => true,
1732-
ExperimentalPartialPrerendering::Boolean(b) => *b,
1733-
})
1734-
.unwrap_or(false),
1735-
)
1736-
}
1737-
17381672
#[turbo_tasks::function]
17391673
pub fn enable_taint(&self) -> Vc<bool> {
17401674
Vc::cell(self.experimental.taint.unwrap_or(false))

0 commit comments

Comments
 (0)