From fdf029f59667a3fefc8a2e5006f69ad6181a7056 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:53:35 +0200 Subject: [PATCH] Remove debug logging --- .../turbopack-core/src/resolve/alias_map.rs | 20 ------- crates/turbopack-core/src/resolve/mod.rs | 58 +------------------ crates/turbopack-core/src/resolve/options.rs | 10 ---- crates/turbopack-core/src/resolve/remap.rs | 6 -- 4 files changed, 1 insertion(+), 93 deletions(-) diff --git a/crates/turbopack-core/src/resolve/alias_map.rs b/crates/turbopack-core/src/resolve/alias_map.rs index 32af8aeb78c8bc..44a87ff07e0dc1 100644 --- a/crates/turbopack-core/src/resolve/alias_map.rs +++ b/crates/turbopack-core/src/resolve/alias_map.rs @@ -483,26 +483,6 @@ where let mut remaining = self.request.clone(); remaining.strip_prefix(prefix.len()); let remaining_suffix = remaining.constant_suffix(); - println!( - "AliasKey::Wildcard request {:?}, prefix: {:?}, suffix: {:?}, wo \ - prefix: {:?}, remaining_suffix {:?}, wo presuffix {:?}, skipped {:?}", - self.request, - std::str::from_utf8(prefix), - suffix, - { - let mut x = self.request.clone(); - x.strip_prefix(prefix.len()); - x - }, - remaining_suffix, - { - let mut x = self.request.clone(); - x.strip_prefix(prefix.len()); - x.strip_suffix(suffix.len()); - x - }, - !remaining_suffix.ends_with(&**suffix) - ); if !remaining_suffix.ends_with(&**suffix) { continue; } diff --git a/crates/turbopack-core/src/resolve/mod.rs b/crates/turbopack-core/src/resolve/mod.rs index f1bc8cd103b2ba..23de0da019a44c 100644 --- a/crates/turbopack-core/src/resolve/mod.rs +++ b/crates/turbopack-core/src/resolve/mod.rs @@ -1504,26 +1504,13 @@ async fn handle_after_resolve_plugins( .cell()) } -use turbo_tasks::debug::ValueDebug; #[turbo_tasks::function] async fn resolve_internal( lookup_path: Vc, request: Vc, options: Vc, ) -> Result> { - let x = resolve_internal_inline(lookup_path, request, options).await?; - // match &*request.await? { - // Request::Module { module, .. } if module == "@" => { - println!( - "resolve_internal {:?} {:?} {:?}", - lookup_path.await?.path, - request.dbg().await?, - x.dbg().await? - ); - // } - // _ => {} - // } - Ok(x) + resolve_internal_inline(lookup_path, request, options).await } fn resolve_internal_boxed( @@ -1558,17 +1545,6 @@ async fn resolve_internal_inline( // Apply import mappings if provided if let Some(import_map) = &options_value.import_map { let result = import_map.await?.lookup(lookup_path, request).await?; - // match &*request.await? { - // Request::Module { module, .. } if module == "@" => { - println!( - "resolve_internal_inline import_map {:?} {:?} {:?}", - lookup_path.await?.path, - request.dbg().await?, - result.clone().cell().dbg().await? - ); - // } - // _ => {} - // } if !matches!(result, ImportMapResult::NoEntry) { has_alias = true; let resolved_result = resolve_import_map_result( @@ -2264,15 +2240,6 @@ async fn resolve_module_request( query: Vc, fragment: Vc, ) -> Result> { - if module == "@" { - println!( - "resolve_module_request {:?} {:?} {:?}", - lookup_path.await?.path, - module, - path - ); - } - // Check alias field for module aliases first if let Some(result) = apply_in_package( lookup_path, @@ -2606,20 +2573,11 @@ async fn handle_exports_imports_field( let query_str = query.await?; let req = Pattern::Constant(format!("{}{}", path, query_str).into()); - println!( - "handle_exports_imports_field req {:?} {:?} {:?}", - req, - req.constant_prefix(), - exports_imports_field - ); - let values = exports_imports_field .lookup(&req) .map(|m| m.try_into_self()) .collect::>>()?; - println!("handle_exports_imports_field values {:?}", values); - for value in values.iter() { // println!("handle_exports_imports_field {:?}", value); @@ -2634,11 +2592,6 @@ async fn handle_exports_imports_field( } } - println!( - "handle_exports_imports_field list {:?} {:?}", - results, conditions_state - ); - let mut resolved_results = Vec::new(); for (result_path, conditions) in results { if let Some(result_path) = result_path.with_normalized_path() { @@ -2646,11 +2599,6 @@ async fn handle_exports_imports_field( Pattern::Constant("./".into()), result_path, ]))); - println!( - "handle_exports_imports_field reresolve {:?} {:?}", - package_path.await?.path, - request.dbg().await? - ); let resolve_result = resolve_internal_boxed(package_path, request, options).await?; if conditions.is_empty() { @@ -2663,10 +2611,6 @@ async fn handle_exports_imports_field( } } - for r in &resolved_results { - println!("handle_exports_imports_field result {:?}", r.dbg().await?); - } - // other options do not apply anymore when an exports field exist Ok(merge_results_with_affecting_sources( resolved_results, diff --git a/crates/turbopack-core/src/resolve/options.rs b/crates/turbopack-core/src/resolve/options.rs index 4fa9f3baaa403c..805a14b0248729 100644 --- a/crates/turbopack-core/src/resolve/options.rs +++ b/crates/turbopack-core/src/resolve/options.rs @@ -408,17 +408,9 @@ impl ImportMap { lookup_path: Vc, request: Vc, ) -> Result { - // TODO lookup pattern // relative requests must not match global wildcard aliases. - use turbo_tasks::debug::ValueDebug; - println!("lookup 1 {:?} {:?}", request.dbg().await?, self.map); if let Some(request_pattern) = request.await?.request_pattern() { - println!( - "lookup 2 {:?} {:?}", - request_pattern, - request_pattern.constant_prefix() - ); let mut lookup = if request_pattern.must_match("./") { self.map .lookup_with_prefix_predicate(&request_pattern, |prefix| { @@ -434,10 +426,8 @@ impl ImportMap { }; if let Some(result) = lookup.next() { let x: Vc = result.try_join_into_self().await?; - println!("lookup 3 {:?} : {:?}", request_pattern, x.dbg().await?); return import_mapping_to_result(x, lookup_path, request).await; } else { - println!("lookup 3 {:?} : {:?}", request_pattern, "None"); } } Ok(ImportMapResult::NoEntry) diff --git a/crates/turbopack-core/src/resolve/remap.rs b/crates/turbopack-core/src/resolve/remap.rs index aec3a65f1625a7..37e4650207bde7 100644 --- a/crates/turbopack-core/src/resolve/remap.rs +++ b/crates/turbopack-core/src/resolve/remap.rs @@ -121,12 +121,6 @@ impl AliasTemplate for SubpathValue { .collect::>>()?, ), SubpathValue::Result(value) => { - println!( - "AliasTemplate::replace {:?} {:?} {:?}", - capture, - value, - capture.spread_into_star(value) - ); SubpathValueResult::Result(capture.spread_into_star(value)) } SubpathValue::Excluded => SubpathValueResult::Excluded,