Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
9f8d4cdb
Commit
9f8d4cdb
authored
Sep 29, 2025
by
Niklas Mischkulnig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flatter traces
parent
5c9525be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
mod.rs
turbopack/crates/turbopack-core/src/module_graph/mod.rs
+20
-8
No files found.
turbopack/crates/turbopack-core/src/module_graph/mod.rs
View file @
9f8d4cdb
use
std
::{
collections
::{
BinaryHeap
,
HashSet
,
VecDeque
,
hash_map
::
Entry
},
future
::
Future
,
sync
::
LazyLock
,
};
use
anyhow
::{
Context
,
Result
,
bail
};
...
...
@@ -224,6 +225,10 @@ impl SingleModuleGraph {
include_traced
:
bool
,
)
->
Result
<
Vc
<
Self
>>
{
let
emit_spans
=
tracing
::
enabled!
(
Level
::
INFO
);
static
EMIT_REFERENCE_SPANS
:
LazyLock
<
bool
>
=
LazyLock
::
new
(||
{
std
::
env
::
var_os
(
"TURBOPACK_TRACE_MODULES_FLAT"
)
.is_none_or
(|
v
|
v
!=
"1"
&&
v
!=
"true"
)
});
let
root_edges
=
entries
.iter
()
.flat_map
(|
e
|
e
.entries
())
...
...
@@ -243,6 +248,7 @@ impl SingleModuleGraph {
SingleModuleGraphBuilder
{
visited_modules
,
emit_spans
,
emit_reference_spans
:
*
EMIT_REFERENCE_SPANS
,
include_traced
,
},
)
...
...
@@ -349,8 +355,7 @@ impl SingleModuleGraph {
#[cfg(debug_assertions)]
{
use
once_cell
::
sync
::
Lazy
;
static
CHECK_FOR_DUPLICATE_MODULES
:
Lazy
<
bool
>
=
Lazy
::
new
(||
{
static
CHECK_FOR_DUPLICATE_MODULES
:
LazyLock
<
bool
>
=
LazyLock
::
new
(||
{
match
std
::
env
::
var_os
(
"TURBOPACK_TEMP_DISABLE_DUPLICATE_MODULES_CHECK"
)
{
Some
(
v
)
=>
v
!=
"1"
&&
v
!=
"true"
,
None
=>
true
,
...
...
@@ -1749,7 +1754,10 @@ const COMMON_CHUNKING_TYPE: ChunkingType = ChunkingType::Parallel {
struct
SingleModuleGraphBuilder
<
'a
>
{
visited_modules
:
&
'a
FxIndexMap
<
ResolvedVc
<
Box
<
dyn
Module
>>
,
GraphNodeIndex
>
,
// Whether to emit spans for nodes
emit_spans
:
bool
,
// Whether to emit spans for references, disabling this flattens the trace
emit_reference_spans
:
bool
,
/// Whether to walk ChunkingType::Traced references
include_traced
:
bool
,
...
...
@@ -1882,12 +1890,16 @@ impl Visit<(SingleModuleGraphBuilderNode, ExportUsage)> for SingleModuleGraphBui
..
}
=>
Span
::
current
(),
_
=>
{
tracing
::
info_span!
(
"chunkable reference"
,
ty
=
debug
(
&
ref_data
.chunking_type
),
source
=
display
(
source_ident
),
target
=
display
(
target_ident
)
)
if
self
.emit_reference_spans
{
tracing
::
info_span!
(
"chunkable reference"
,
ty
=
debug
(
&
ref_data
.chunking_type
),
source
=
display
(
source_ident
),
target
=
display
(
target_ident
)
)
}
else
{
Span
::
current
()
}
}
},
SingleModuleGraphBuilderNode
::
VisitedModule
{
..
}
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment