From 391cf961dcf8327ff375e41a96d23e3bab2c9338 Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Tue, 15 Aug 2023 11:25:11 -0400 Subject: [PATCH] Use shallow references in `any_content_changed_of_module` (vercel/turbo#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 --- crates/turbopack-core/src/changed.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/turbopack-core/src/changed.rs b/crates/turbopack-core/src/changed.rs index 0254ecbde1ad1..159d40f4d06a6 100644 --- a/crates/turbopack-core/src/changed.rs +++ b/crates/turbopack-core/src/changed.rs @@ -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( @@ -20,7 +20,7 @@ async fn get_referenced_output_assets( async fn get_referenced_modules( parent: Vc>, ) -> Result>> + Send> { - Ok(all_referenced_modules(parent) + Ok(primary_referenced_modules(parent) .await? .clone_value() .into_iter())