Unverified Commit 7ec769c5 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Revert "Turbopack: loader change invalidation (#95732)" (#100414)

Revert part of #95732

This would cause a lot of worker pools to be created. Because
`get_evaluate_pool()` takes as an argument the `additional_invalidation`
and thus get a fresh worker pool per `additional_invalidation`
parent cdb48f76
...@@ -7,7 +7,10 @@ for (const cacheEnabled of [false, true]) { ...@@ -7,7 +7,10 @@ for (const cacheEnabled of [false, true]) {
describe(`filesystem-caching with cache ${cacheEnabled ? 'enabled' : 'disabled'}`, () => { describe(`filesystem-caching with cache ${cacheEnabled ? 'enabled' : 'disabled'}`, () => {
const { testChangesWhileStopped } = setupFilesystemCacheTest(cacheEnabled) const { testChangesWhileStopped } = setupFilesystemCacheTest(cacheEnabled)
testChangesWhileStopped(['loader change']) if (!process.env.IS_TURBOPACK_TEST) {
// TODO enable again
testChangesWhileStopped(['loader change'])
}
testChangesWhileStopped(['next config change']) testChangesWhileStopped(['next config change'])
testChangesWhileStopped(['env var change']) testChangesWhileStopped(['env var change'])
}) })
......
...@@ -250,6 +250,11 @@ export function setupFilesystemCacheTest(cacheEnabled: boolean) { ...@@ -250,6 +250,11 @@ export function setupFilesystemCacheTest(cacheEnabled: boolean) {
function testChangesWhileStopped(changeNames: readonly ChangeName[]) { function testChangesWhileStopped(changeNames: readonly ChangeName[]) {
registerCacheWarmUp() registerCacheWarmUp()
// TODO fix loader changes with Turbopack. Exclude them from combined tests
// as well as individual tests, without leaving undefined change entries.
changeNames = changeNames.filter(
(changeName) => changeName !== 'loader change' || !isTurbopack
)
const name = changeNames.join(', ') const name = changeNames.join(', ')
const changes = changeNames.map( const changes = changeNames.map(
(changeName) => POTENTIAL_CHANGES[changeName] (changeName) => POTENTIAL_CHANGES[changeName]
......
...@@ -10,7 +10,7 @@ const nextConfig = { ...@@ -10,7 +10,7 @@ const nextConfig = {
'./app/**/page.{jsx,tsx}': { './app/**/page.{jsx,tsx}': {
loaders: ['./my-timestamp-loader.js'], loaders: ['./my-timestamp-loader.js'],
}, },
'./app/loader/**/page.tsx': { './app/loader/page.tsx': {
loaders: ['./my-loader.js'], loaders: ['./my-loader.js'],
}, },
'./pages/pages.tsx': { './pages/pages.tsx': {
......
...@@ -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