Skip to content

Commit

Permalink
Use shallow references in any_content_changed_of_module (vercel/tur…
Browse files Browse the repository at this point in the history
…borepo#5718)

### Description

Switches `get_referenced_modules` to use `primary_referenced_modules`,
which only returns modules _directly_ referenced by this module. The old
`all_referenced_modules` did its own recursive traversal of the module
looking direct and transitively referenced modules, defeating the
purpose of our `NonDeterministic().skip_duplicates()` graph traversal.

### Testing Instructions



Closes WEB-1378
  • Loading branch information
jridgewell authored Aug 15, 2023
1 parent efc1cc2 commit 391cf96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/turbopack-core/src/changed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
asset::Asset,
module::Module,
output::{OutputAsset, OutputAssets},
reference::all_referenced_modules,
reference::primary_referenced_modules,
};

async fn get_referenced_output_assets(
Expand All @@ -20,7 +20,7 @@ async fn get_referenced_output_assets(
async fn get_referenced_modules(
parent: Vc<Box<dyn Module>>,
) -> Result<impl Iterator<Item = Vc<Box<dyn Module>>> + Send> {
Ok(all_referenced_modules(parent)
Ok(primary_referenced_modules(parent)
.await?
.clone_value()
.into_iter())
Expand Down

0 comments on commit 391cf96

Please sign in to comment.