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
16c937a8
Commit
16c937a8
authored
Mar 03, 2025
by
Niklas Mischkulnig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort in place
parent
101efe6f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
app_client_references_chunks.rs
...es/next-core/src/next_app/app_client_references_chunks.rs
+14
-12
primitives.rs
turbopack/crates/turbo-tasks/src/primitives.rs
+6
-1
No files found.
crates/next-core/src/next_app/app_client_references_chunks.rs
View file @
16c937a8
use
std
::
cmp
::
Ordering
;
use
anyhow
::
Result
;
use
futures
::
join
;
use
tracing
::
Instrument
;
...
...
@@ -429,6 +431,7 @@ fn reorder_isolated_merged_entries(
else
{
unreachable!
(
"expected ChunkGroup::IsolatedMerged for client reference"
)
};
// Reorder the entries, because the order of IsolatedMerged entries obtained by chunk_group_info
// is unspecified (and thus not strictly execution order, which is a problem for CSS).
//
...
...
@@ -437,18 +440,17 @@ fn reorder_isolated_merged_entries(
// matter in this case (since they will not be chunked in this step anyway).
if
entries
.iter
()
.any
(|
m
|
client_to_ref_ty
.contains_key
(
m
))
{
let
entries
=
client_to_ref_ty
.keys
()
.copied
()
.filter
(|
m
|
entries
.contains
(
m
))
.chain
(
entries
.iter
()
.copied
()
.filter
(|
m
|
!
client_to_ref_ty
.contains_key
(
m
)),
)
.collect
();
let
mut
entries
=
entries
.clone
();
entries
.sort_by
(|
a
,
b
|
{
match
(
client_to_ref_ty
.get_index_of
(
a
),
client_to_ref_ty
.get_index_of
(
b
),
)
{
(
Some
(
a
),
Some
(
b
))
=>
a
.cmp
(
&
b
),
// We don't know, so just keep the same order.
_
=>
Ordering
::
Equal
,
}
});
Some
(
ChunkGroup
::
IsolatedMerged
{
parent
:
*
parent
,
entries
,
...
...
turbopack/crates/turbo-tasks/src/primitives.rs
View file @
16c937a8
use
std
::{
hash
::{
BuildHasher
,
Hash
},
ops
::
Deref
,
ops
::
{
Deref
,
DerefMut
}
,
time
::
Duration
,
};
...
...
@@ -91,6 +91,11 @@ impl<T: Hash + Eq> Deref for HashableIndexSet<T> {
&
self
.
0
}
}
impl
<
T
:
Hash
+
Eq
>
DerefMut
for
HashableIndexSet
<
T
>
{
fn
deref_mut
(
&
mut
self
)
->
&
mut
Self
::
Target
{
&
mut
self
.
0
}
}
impl
<
T
:
Hash
+
Eq
>
Hash
for
HashableIndexSet
<
T
>
{
fn
hash
<
H
:
std
::
hash
::
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
let
mut
result
=
0u64
;
...
...
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