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
67b17f17
Commit
67b17f17
authored
Jul 10, 2025
by
Luke Sandberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of self cycles
eliminate some clones
parent
f6685556
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
app.rs
crates/next-api/src/app.rs
+8
-7
client_references.rs
crates/next-api/src/client_references.rs
+13
-6
No files found.
crates/next-api/src/app.rs
View file @
67b17f17
...
...
@@ -1939,10 +1939,10 @@ impl Endpoint for AppEndpoint {
};
async
move
{
let
output
=
self
.output
()
.await
?
;
let
output_assets
=
self
.output
()
.output_assets
();
let
node_root
=
this
.app_project
.project
()
.node_root
()
;
let
node_root
_ref
=
&
node_root
.await
?
;
let
output
=
self
.output
();
let
output_assets
=
output
.output_assets
();
let
output
=
output
.await
?
;
let
node_root
=
&*
this
.app_project
.project
()
.node_root
()
.await
?
;
let
(
server_paths
,
client_paths
)
=
if
this
.app_project
...
...
@@ -1951,8 +1951,9 @@ impl Endpoint for AppEndpoint {
.await
?
.is_development
()
{
let
node_root
=
this
.app_project
.project
()
.node_root
()
.await
?
.clone_value
();
let
server_paths
=
all_server_paths
(
output_assets
,
node_root
)
.owned
()
.await
?
;
let
server_paths
=
all_server_paths
(
output_assets
,
node_root
.clone
())
.owned
()
.await
?
;
let
client_relative_root
=
this
.app_project
...
...
@@ -1971,7 +1972,7 @@ impl Endpoint for AppEndpoint {
let
written_endpoint
=
match
*
output
{
AppEndpointOutput
::
NodeJs
{
rsc_chunk
,
..
}
=>
EndpointOutputPaths
::
NodeJs
{
server_entry_path
:
node_root
_ref
server_entry_path
:
node_root
.get_path_to
(
&*
rsc_chunk
.path
()
.await
?
)
.context
(
"Node.js chunk entry path must be inside the node root"
)
?
.to_string
(),
...
...
crates/next-api/src/client_references.rs
View file @
67b17f17
...
...
@@ -15,7 +15,8 @@ use turbopack::css::chunk::CssChunkPlaceable;
use
turbopack_core
::{
module
::
Module
,
module_graph
::{
GraphTraversalAction
,
SingleModuleGraph
,
chunk_group_info
::
RoaringBitmapWrapper
,
GraphTraversalAction
,
SingleModuleGraph
,
SingleModuleGraphModuleNode
,
chunk_group_info
::
RoaringBitmapWrapper
,
},
};
...
...
@@ -56,7 +57,7 @@ impl ClientReferencesSet {
let
bitmap
=
&
self
.server_components_for_client_references
.get
(
&
module
)
.expect
(
"
the passed m
odule should be a client reference module"
)
.expect
(
"
M
odule should be a client reference module"
)
.
0
;
bitmap
...
...
@@ -139,20 +140,26 @@ pub async fn map_client_references(
true
}
};
if
let
Some
((
parent_module
,
_
))
=
parent_info
{
if
let
Some
((
SingleModuleGraphModuleNode
{
module
:
parent_module
},
_
))
=
parent_info
// Skip self cycles such as in
// test/e2e/app-dir/dynamic-import/app/page.tsx where a very-dynamic import induces a
// 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.
let
[
Some
(
current
),
Some
(
parent
)]
=
parent_modules
.get_disjoint_mut
([
&
module
,
&
parent_module
.
module
])
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
// 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
;
should_visit_children
|
=
len
!=
current
.len
();
// did we find new bits
// did we find new bits? If so visit the children again
should_visit_children
|
=
len
!=
current
.len
();
}
else
{
*
current
|
=
&*
parent
;
}
...
...
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