Unverified Commit c864c78f authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

[lts-active] Revert "Turbopack: loader change invalidation (#95732)" (#100438)

Backports #100414 to `releases/lts/active`.

Adapted the loader-change exclusions to the release branch’s unsplit
filesystem-cache suite.

<!-- NEXT_JS_LLM -->
parent f3ff9430
......@@ -296,13 +296,17 @@ for (const cacheEnabled of [false, true]) {
} as const
// Checking only single change and all combined for performance reasons.
const combinations = Object.entries(POTENTIAL_CHANGES).map(([k, v]) => [
k,
[v],
]) as Array<[string, Array<Change>]>
// TODO fix loader changes with Turbopack. Exclude them from combined tests
// as well as individual tests, without leaving undefined change entries.
const potentialChanges = Object.entries(POTENTIAL_CHANGES).filter(
([changeName]) => changeName !== 'loader change' || !isTurbopack
)
const combinations = potentialChanges.map(([k, v]) => [k, [v]]) as Array<
[string, Array<Change>]
>
combinations.push([
Object.keys(POTENTIAL_CHANGES).join(', '),
Object.values(POTENTIAL_CHANGES),
potentialChanges.map(([name]) => name).join(', '),
potentialChanges.map(([, change]) => change),
])
for (const [name, changes] of combinations) {
......
......@@ -487,16 +487,18 @@ impl WebpackLoadersProcessedAsset {
};
let loader_names: Vec<RcStr> = loaders.iter().map(|l| l.loader.clone()).collect();
// TODO pass this into additional_invalidation again once we have proper pool handling
//
// Invalidate the transform when a loader module (or any of its
// transitive dependencies) changes.
let loaders_changed = loaders_changed(
*transform.loaders,
project_path.clone(),
*transform.config_tracing_context,
*transform.resolve_options_context,
)
.to_resolved()
.await?;
// let loaders_changed = loaders_changed(
// *transform.loaders,
// project_path.clone(),
// *transform.config_tracing_context,
// *transform.resolve_options_context,
// )
// .to_resolved()
// .await?;
let config_value = evaluate_webpack_loader(WebpackLoaderContext {
entries,
......@@ -519,7 +521,7 @@ impl WebpackLoadersProcessedAsset {
ResolvedVc::cell(transform.mode.to_string().into()),
ResolvedVc::cell(transform.source_maps.into()),
],
additional_invalidation: loaders_changed,
additional_invalidation: Completion::immutable().to_resolved().await?,
loader_names,
})
.await?;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment