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]) { ...@@ -296,13 +296,17 @@ for (const cacheEnabled of [false, true]) {
} as const } as const
// Checking only single change and all combined for performance reasons. // Checking only single change and all combined for performance reasons.
const combinations = Object.entries(POTENTIAL_CHANGES).map(([k, v]) => [ // TODO fix loader changes with Turbopack. Exclude them from combined tests
k, // as well as individual tests, without leaving undefined change entries.
[v], const potentialChanges = Object.entries(POTENTIAL_CHANGES).filter(
]) as Array<[string, Array<Change>]> ([changeName]) => changeName !== 'loader change' || !isTurbopack
)
const combinations = potentialChanges.map(([k, v]) => [k, [v]]) as Array<
[string, Array<Change>]
>
combinations.push([ combinations.push([
Object.keys(POTENTIAL_CHANGES).join(', '), potentialChanges.map(([name]) => name).join(', '),
Object.values(POTENTIAL_CHANGES), potentialChanges.map(([, change]) => change),
]) ])
for (const [name, changes] of combinations) { for (const [name, changes] of combinations) {
......
...@@ -487,16 +487,18 @@ impl WebpackLoadersProcessedAsset { ...@@ -487,16 +487,18 @@ impl WebpackLoadersProcessedAsset {
}; };
let loader_names: Vec<RcStr> = loaders.iter().map(|l| l.loader.clone()).collect(); 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 // Invalidate the transform when a loader module (or any of its
// transitive dependencies) changes. // transitive dependencies) changes.
let loaders_changed = loaders_changed( // let loaders_changed = loaders_changed(
*transform.loaders, // *transform.loaders,
project_path.clone(), // project_path.clone(),
*transform.config_tracing_context, // *transform.config_tracing_context,
*transform.resolve_options_context, // *transform.resolve_options_context,
) // )
.to_resolved() // .to_resolved()
.await?; // .await?;
let config_value = evaluate_webpack_loader(WebpackLoaderContext { let config_value = evaluate_webpack_loader(WebpackLoaderContext {
entries, entries,
...@@ -519,7 +521,7 @@ impl WebpackLoadersProcessedAsset { ...@@ -519,7 +521,7 @@ impl WebpackLoadersProcessedAsset {
ResolvedVc::cell(transform.mode.to_string().into()), ResolvedVc::cell(transform.mode.to_string().into()),
ResolvedVc::cell(transform.source_maps.into()), ResolvedVc::cell(transform.source_maps.into()),
], ],
additional_invalidation: loaders_changed, additional_invalidation: Completion::immutable().to_resolved().await?,
loader_names, loader_names,
}) })
.await?; .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