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
c8201396
Commit
c8201396
authored
Jul 11, 2025
by
Luke Sandberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve documentation and comments to make `vade` happy
parent
f35cdd0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
client_references.rs
crates/next-api/src/client_references.rs
+3
-4
mod.rs
turbopack/crates/turbopack-core/src/module_graph/mod.rs
+7
-7
No files found.
crates/next-api/src/client_references.rs
View file @
c8201396
...
...
@@ -146,15 +146,14 @@ pub async fn map_client_references(
// self cycle. They don't introduce new bits anyway.
&&
module
!=
*
parent_module
{
// copy parent bits down.
visit_preorder
always visits parents before
// children so we can assert that the parent it set.
// copy parent bits down.
`traverse_edges_from_entries_fixed_point``
always visits parents before
// children so we can
simply
assert that the parent it set.
let
[
Some
(
current
),
Some
(
parent
)]
=
parent_modules
.get_disjoint_mut
([
&
module
,
parent_module
])
else
{
unreachable!
()
};
// inherit the server components from the newly observed parent.
// check if we are adding new bits and thus need to revisit children unless we are already planning to because this is a new node.
// Check if we are adding new bits and thus need to revisit children unless we are already planning to because this is a new node.
if
!
should_visit_children
{
let
len
=
current
.len
();
*
current
|
=
&*
parent
;
...
...
turbopack/crates/turbopack-core/src/module_graph/mod.rs
View file @
c8201396
...
...
@@ -568,19 +568,18 @@ impl SingleModuleGraph {
/// eventual termination of the traversal. This corresponds to computing a fixed point state for
/// the graph.
///
/// Nodes are (re)visited according to the returned priority of the node, prioritizing high
/// values. This priority is intended to be used a heuristic to reduce the number of
/// retraversals.
/// It is guaranteed that the parent node passed to the `visit` function, if any, has
/// already been passed to `visit`.
///
/// * `entries` - The entry modules to start the traversal from
/// * `state` - The state to be passed to the callbacks
/// * `visit` - Called for a specific edge
/// - Receives: (originating &SingleModuleGraphNode, edge &ChunkingType), target
/// - Receives:
Option
(originating &SingleModuleGraphNode, edge &ChunkingType), target
/// &SingleModuleGraphNode
/// - Return [GraphTraversalAction]s to control the traversal
///
/// Returns the number of node visits (i.e. higher than the node
count if there are
/// retraversals).
/// Returns the number of node visits (i.e. higher than the node
///
count if there are
retraversals).
pub
fn
traverse_edges_from_entries_fixed_point
<
'a
>
(
&
'a
self
,
entries
:
impl
IntoIterator
<
Item
=
ResolvedVc
<
Box
<
dyn
Module
>>>
,
...
...
@@ -2001,7 +2000,7 @@ pub mod tests {
}
#[tokio
::
test]
async
fn
traverse_edges_from_entries_fixed_point_
diamond
()
{
async
fn
traverse_edges_from_entries_fixed_point_
cycle
()
{
run_graph_test
(
vec!
[
rcstr!
(
"a.js"
)],
{
...
...
@@ -2040,6 +2039,7 @@ pub mod tests {
(
Some
(
rcstr!
(
"a.js"
)),
rcstr!
(
"b.js"
)),
(
Some
(
rcstr!
(
"b.js"
)),
rcstr!
(
"c.js"
)),
(
Some
(
rcstr!
(
"c.js"
)),
rcstr!
(
"a.js"
)),
// we start following the cycle again
(
Some
(
rcstr!
(
"a.js"
)),
rcstr!
(
"b.js"
)),
(
Some
(
rcstr!
(
"b.js"
)),
rcstr!
(
"c.js"
)),
],
...
...
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