Skip to content

Commit 742d3b8

Browse files
committed
Revert "WIP DEBUG"
This reverts commit f34b6e0cd49fbc4653694f24c29d5bf1676d5bba.
1 parent 81e4b91 commit 742d3b8

File tree

6 files changed

+21
-85
lines changed

6 files changed

+21
-85
lines changed

turbopack/crates/turbopack-core/src/module_graph/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ impl SingleModuleGraph {
364364
}
365365
}
366366
if !duplicates.is_empty() {
367-
println!("Duplicate module idents in graph: {duplicates:#?}");
367+
panic!("Duplicate module idents in graph: {duplicates:#?}");
368368
}
369369
}
370370
}

turbopack/crates/turbopack-css/src/asset.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::Result;
22
use turbo_rcstr::rcstr;
3-
use turbo_tasks::{IntoTraitRef, ResolvedVc, TryJoinIterExt, ValueToString, Vc, task::TaskOutput};
3+
use turbo_tasks::{IntoTraitRef, ResolvedVc, TryJoinIterExt, ValueToString, Vc};
44
use turbo_tasks_fs::FileSystemPath;
55
use turbopack_core::{
66
asset::{Asset, AssetContent},
@@ -46,26 +46,20 @@ pub struct CssModuleAsset {
4646
impl CssModuleAsset {
4747
/// Creates a new CSS asset.
4848
#[turbo_tasks::function]
49-
pub async fn new(
49+
pub fn new(
5050
source: ResolvedVc<Box<dyn Source>>,
5151
asset_context: ResolvedVc<Box<dyn AssetContext>>,
5252
ty: CssModuleAssetType,
5353
import_context: Option<ResolvedVc<ImportContext>>,
5454
environment: Option<ResolvedVc<Environment>>,
55-
) -> Result<Vc<Self>> {
56-
println!(
57-
"Css {:?} {:?} {:?}",
58-
source.ident().to_string().await?,
59-
source.try_into_raw_vc()?,
60-
asset_context.into_trait_ref().await?.layer().name()
61-
);
62-
Ok(Self::cell(CssModuleAsset {
55+
) -> Vc<Self> {
56+
Self::cell(CssModuleAsset {
6357
source,
6458
asset_context,
6559
import_context,
6660
ty,
6761
environment,
68-
}))
62+
})
6963
}
7064

7165
/// Returns the asset ident of the source without the "css" modifier

turbopack/crates/turbopack-css/src/module_asset.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use indoc::formatdoc;
55
use lightningcss::css_modules::CssModuleReference;
66
use swc_core::common::{BytePos, FileName, LineCol, SourceMap};
77
use turbo_rcstr::{RcStr, rcstr};
8-
use turbo_tasks::{FxIndexMap, IntoTraitRef, ResolvedVc, ValueToString, Vc, task::TaskOutput};
8+
use turbo_tasks::{FxIndexMap, IntoTraitRef, ResolvedVc, ValueToString, Vc};
99
use turbo_tasks_fs::{FileSystemPath, rope::Rope};
1010
use turbopack_core::{
1111
asset::{Asset, AssetContent},
@@ -49,20 +49,14 @@ pub struct ModuleCssAsset {
4949
#[turbo_tasks::value_impl]
5050
impl ModuleCssAsset {
5151
#[turbo_tasks::function]
52-
pub async fn new(
52+
pub fn new(
5353
source: ResolvedVc<Box<dyn Source>>,
5454
asset_context: ResolvedVc<Box<dyn AssetContext>>,
55-
) -> Result<Vc<Self>> {
56-
println!(
57-
"ModuleCss {:?} {:?} {:?}",
58-
source.ident().to_string().await?,
59-
source.try_into_raw_vc()?,
60-
asset_context.into_trait_ref().await?.layer().name()
61-
);
62-
Ok(Self::cell(ModuleCssAsset {
55+
) -> Vc<Self> {
56+
Self::cell(ModuleCssAsset {
6357
source,
6458
asset_context,
65-
}))
59+
})
6660
}
6761
}
6862

turbopack/crates/turbopack-node/src/transforms/postcss.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use indoc::formatdoc;
33
use serde::{Deserialize, Serialize};
44
use turbo_rcstr::{RcStr, rcstr};
55
use turbo_tasks::{
6-
Completion, Completions, NonLocalValue, ResolvedVc, TaskInput, TryFlatJoinIterExt,
7-
ValueToString, Vc, fxindexmap, trace::TraceRawVcs,
6+
Completion, Completions, NonLocalValue, ResolvedVc, TaskInput, TryFlatJoinIterExt, Vc,
7+
fxindexmap, trace::TraceRawVcs,
88
};
99
use turbo_tasks_bytes::stream::SingleValue;
1010
use turbo_tasks_fs::{
@@ -131,8 +131,8 @@ impl PostCssTransform {
131131
#[turbo_tasks::value_impl]
132132
impl SourceTransform for PostCssTransform {
133133
#[turbo_tasks::function]
134-
async fn transform(&self, source: ResolvedVc<Box<dyn Source>>) -> Result<Vc<Box<dyn Source>>> {
135-
let x = Vc::upcast(
134+
fn transform(&self, source: ResolvedVc<Box<dyn Source>>) -> Vc<Box<dyn Source>> {
135+
Vc::upcast(
136136
PostCssTransformedAsset {
137137
evaluate_context: self.evaluate_context,
138138
execution_context: self.execution_context,
@@ -141,14 +141,7 @@ impl SourceTransform for PostCssTransform {
141141
source_map: self.source_maps,
142142
}
143143
.cell(),
144-
);
145-
println!(
146-
"PostCssTransformedAsset {:?} {:?}",
147-
source,
148-
// source.ident().to_string().await?,
149-
x
150-
);
151-
Ok(x)
144+
)
152145
}
153146
}
154147

turbopack/crates/turbopack-node/src/transforms/webpack.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,25 +128,17 @@ impl WebpackLoaders {
128128
#[turbo_tasks::value_impl]
129129
impl SourceTransform for WebpackLoaders {
130130
#[turbo_tasks::function]
131-
async fn transform(
131+
fn transform(
132132
self: ResolvedVc<Self>,
133133
source: ResolvedVc<Box<dyn Source>>,
134-
) -> Result<Vc<Box<dyn Source>>> {
135-
let x = Vc::upcast(
134+
) -> Vc<Box<dyn Source>> {
135+
Vc::upcast(
136136
WebpackLoadersProcessedAsset {
137137
transform: self,
138138
source,
139139
}
140140
.cell(),
141-
);
142-
println!(
143-
"WebpackLoadersProcessedAsset {:?} {:?} {:?}",
144-
source,
145-
// source.ident().to_string().await?,
146-
self.await?.resolve_options_context.await?.browser,
147-
x
148-
);
149-
Ok(x)
141+
)
150142
}
151143
}
152144

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
use anyhow::Result;
2-
use turbo_tasks::{ResolvedVc, ValueToString, Vc};
3-
use turbopack_core::{
4-
context::ProcessResult, module::Module, reference_type::ReferenceType, source::Source,
5-
};
1+
use turbo_tasks::{ResolvedVc, Vc};
62

73
use crate::{ModuleAssetContext, transition::Transition};
84

@@ -29,37 +25,4 @@ impl Transition for FullContextTransition {
2925
) -> Vc<ModuleAssetContext> {
3026
*self.module_context
3127
}
32-
33-
#[turbo_tasks::function]
34-
async fn process(
35-
self: Vc<Self>,
36-
asset: Vc<Box<dyn Source>>,
37-
module_asset_context: Vc<ModuleAssetContext>,
38-
reference_type: ReferenceType,
39-
) -> Result<Vc<ProcessResult>> {
40-
let asset = self.process_source(asset);
41-
let module_asset_context = self.process_context(module_asset_context);
42-
let asset = asset.to_resolved().await?;
43-
44-
Ok(match &*module_asset_context
45-
.process_default(asset, reference_type)
46-
.await?
47-
.await?
48-
{
49-
ProcessResult::Module(m) => {
50-
let x = self
51-
.process_module(**m, module_asset_context)
52-
.to_resolved()
53-
.await?;
54-
let ident = x.ident().to_string().await?;
55-
if ident.contains("styles.module") {
56-
println!("FullContextTransition: {:?} {:?} {:?}", asset, x, ident);
57-
}
58-
ProcessResult::Module(x)
59-
}
60-
ProcessResult::Unknown(source) => ProcessResult::Unknown(*source),
61-
ProcessResult::Ignore => ProcessResult::Ignore,
62-
}
63-
.cell())
64-
}
6528
}

0 commit comments

Comments
 (0)