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
7fd7ee7b
Unverified
Commit
7fd7ee7b
authored
Jan 11, 2025
by
Benjamin Woodruff
Committed by
GitHub
Jan 11, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(turbopack): Delete some dead code that was using unresolved Vcs (#74705)
parent
982fff33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
75 deletions
+0
-75
lib.rs
turbopack/crates/turbopack/src/lib.rs
+0
-75
No files found.
turbopack/crates/turbopack/src/lib.rs
View file @
7fd7ee7b
...
@@ -13,11 +13,6 @@ pub mod module_options;
...
@@ -13,11 +13,6 @@ pub mod module_options;
pub
mod
transition
;
pub
mod
transition
;
pub
(
crate
)
mod
unsupported_sass
;
pub
(
crate
)
mod
unsupported_sass
;
use
std
::{
collections
::{
HashMap
,
HashSet
},
mem
::
swap
,
};
use
anyhow
::{
bail
,
Result
};
use
anyhow
::{
bail
,
Result
};
use
css
::{
CssModuleAsset
,
ModuleCssAsset
};
use
css
::{
CssModuleAsset
,
ModuleCssAsset
};
use
ecmascript
::{
use
ecmascript
::{
...
@@ -952,76 +947,6 @@ pub async fn emit_asset_into_dir(
...
@@ -952,76 +947,6 @@ pub async fn emit_asset_into_dir(
Ok
(())
Ok
(())
}
}
type
OutputAssetSet
=
HashSet
<
Vc
<
Box
<
dyn
OutputAsset
>>>
;
#[turbo_tasks
::
value(shared,
local)]
struct
ReferencesList
{
referenced_by
:
HashMap
<
ResolvedVc
<
Box
<
dyn
OutputAsset
>>
,
OutputAssetSet
>
,
}
#[turbo_tasks
::
function]
async
fn
compute_back_references
(
aggregated
:
ResolvedVc
<
AggregatedGraph
>
,
)
->
Result
<
Vc
<
ReferencesList
>>
{
Ok
(
match
&*
aggregated
.content
()
.await
?
{
&
AggregatedGraphNodeContent
::
Asset
(
asset
)
=>
{
let
mut
referenced_by
=
HashMap
::
new
();
for
&
reference
in
asset
.references
()
.await
?
.iter
()
{
referenced_by
.insert
(
reference
,
[
*
asset
]
.into_iter
()
.collect
());
}
ReferencesList
{
referenced_by
}
.into
()
}
AggregatedGraphNodeContent
::
Children
(
children
)
=>
{
let
mut
referenced_by
=
HashMap
::
<
ResolvedVc
<
Box
<
dyn
OutputAsset
>>
,
OutputAssetSet
>
::
new
();
let
lists
=
children
.iter
()
.map
(|
child
|
compute_back_references
(
**
child
))
.collect
::
<
Vec
<
_
>>
();
for
list
in
lists
{
for
(
key
,
values
)
in
list
.await
?
.referenced_by
.iter
()
{
if
let
Some
(
set
)
=
referenced_by
.get_mut
(
key
)
{
for
value
in
values
{
set
.insert
(
*
value
);
}
}
else
{
referenced_by
.insert
(
*
key
,
values
.clone
());
}
}
}
ReferencesList
{
referenced_by
}
.into
()
}
})
}
#[turbo_tasks
::
function]
async
fn
top_references
(
list
:
Vc
<
ReferencesList
>
)
->
Result
<
Vc
<
ReferencesList
>>
{
let
list
=
list
.await
?
;
const
N
:
usize
=
5
;
let
mut
top
=
Vec
::
<
(
&
ResolvedVc
<
Box
<
dyn
OutputAsset
>>
,
&
HashSet
<
Vc
<
Box
<
dyn
OutputAsset
>>>
,
)
>
::
new
();
for
tuple
in
list
.referenced_by
.iter
()
{
let
mut
current
=
tuple
;
for
item
in
&
mut
top
{
if
item
.
1
.len
()
<
tuple
.
1
.len
()
{
swap
(
item
,
&
mut
current
);
}
}
if
top
.len
()
<
N
{
top
.push
(
current
);
}
}
Ok
(
ReferencesList
{
referenced_by
:
top
.into_iter
()
.map
(|(
asset
,
set
)|
(
*
asset
,
set
.clone
()))
.collect
(),
}
.into
())
}
/// Replaces the externals in the result with `ExternalModuleAsset` instances.
/// Replaces the externals in the result with `ExternalModuleAsset` instances.
pub
async
fn
replace_external
(
pub
async
fn
replace_external
(
name
:
&
RcStr
,
name
:
&
RcStr
,
...
...
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