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
c2d28fa7
Unverified
Commit
c2d28fa7
authored
Mar 06, 2025
by
Niklas Mischkulnig
Committed by
GitHub
Mar 06, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: remove unused IncludeModulesModule (#76868)
Using this would break the module graph and chunking now anyway .
parent
ec2ca8b6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
187 deletions
+3
-187
pages.rs
crates/next-api/src/pages.rs
+3
-16
include_modules_module.rs
crates/next-core/src/next_app/include_modules_module.rs
+0
-170
mod.rs
crates/next-core/src/next_app/mod.rs
+0
-1
No files found.
crates/next-api/src/pages.rs
View file @
c2d28fa7
...
...
@@ -906,25 +906,12 @@ impl PageEndpoint {
}
=
*
self
.internal_ssr_chunk_module
()
.await
?
;
let
project
=
this
.pages_project
.project
();
// The SSR and Client Graphs are not connected in Pages Router.
// We are only interested in get_next_dynamic_imports_for_endpoint at the
// moment, which only needs the client graph anyway.
let
module_graph
=
project
.module_graph
(
*
ssr_module
,
ChunkGroupType
::
Entry
);
let
next_dynamic_imports
=
if
let
PageEndpointType
::
Html
=
this
.ty
{
// The SSR and Client Graphs are not connected in Pages Router.
// We are only interested in get_next_dynamic_imports_for_endpoint at the
// moment, which only needs the client graph anyway.
//
// If we do want to change this to have both included. We'd need to create a
// `IncludeModulesModule` that includes both SSR and Client (and use that both
// there and in Project::get_all_entries):
// let client_module = self.client_module().to_resolved().await?;
// let ssr_module = self.internal_ssr_chunk_module().await?.ssr_module;
// Ok(Vc::upcast(IncludeModulesModule::new(
// self.source()
// .ident()
// .with_modifier(Vc::cell("unified entrypoint".into())),
// vec![*client_module, *ssr_module],
// )))
let
client_availability_info
=
self
.client_chunks
()
.await
?
.availability_info
;
let
client_module_graph
=
self
.client_module_graph
();
...
...
crates/next-core/src/next_app/include_modules_module.rs
deleted
100644 → 0
View file @
ec2ca8b6
use
anyhow
::
Result
;
use
turbo_rcstr
::
RcStr
;
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
ValueToString
,
Vc
};
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkableModuleReference
,
ChunkingContext
},
ident
::
AssetIdent
,
module
::
Module
,
module_graph
::
ModuleGraph
,
reference
::{
ModuleReference
,
ModuleReferences
},
resolve
::
ModuleResolveResult
,
};
use
turbopack_ecmascript
::
chunk
::{
EcmascriptChunkItem
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptChunkType
,
EcmascriptExports
,
};
/// A virtual module that references other modules, but doesn't do anything at
/// runtime. It can be used to include modules into a chunk.
#[turbo_tasks
::
value]
pub
struct
IncludeModulesModule
{
ident
:
ResolvedVc
<
AssetIdent
>
,
modules
:
Vec
<
ResolvedVc
<
Box
<
dyn
Module
>>>
,
}
#[turbo_tasks
::
value_impl]
impl
IncludeModulesModule
{
#[turbo_tasks
::
function]
pub
fn
new
(
ident
:
ResolvedVc
<
AssetIdent
>
,
modules
:
Vec
<
ResolvedVc
<
Box
<
dyn
Module
>>>
,
)
->
Vc
<
Self
>
{
Self
{
ident
,
modules
}
.cell
()
}
}
impl
Asset
for
IncludeModulesModule
{
fn
content
(
self
:
Vc
<
Self
>
)
->
Vc
<
AssetContent
>
{
todo!
(
"IncludeModulesModule doesn't implement content()"
)
}
}
#[turbo_tasks
::
value_impl]
impl
Module
for
IncludeModulesModule
{
#[turbo_tasks
::
function]
fn
ident
(
&
self
)
->
Vc
<
AssetIdent
>
{
*
self
.ident
}
#[turbo_tasks
::
function]
async
fn
references
(
&
self
)
->
Result
<
Vc
<
ModuleReferences
>>
{
Ok
(
Vc
::
cell
(
self
.modules
.iter
()
.map
(|
&
module
|
async
move
{
Ok
(
ResolvedVc
::
upcast
(
IncludedModuleReference
::
new
(
*
module
)
.to_resolved
()
.await
?
,
))
})
.try_join
()
.await
?
,
))
}
}
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
IncludeModulesModule
{
#[turbo_tasks
::
function]
fn
get_exports
(
self
:
Vc
<
Self
>
)
->
Vc
<
EcmascriptExports
>
{
EcmascriptExports
::
None
.cell
()
}
#[turbo_tasks
::
function]
fn
is_marked_as_side_effect_free
(
self
:
Vc
<
Self
>
,
_
:
Vc
<
Glob
>
)
->
Vc
<
bool
>
{
Vc
::
cell
(
true
)
}
}
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
IncludeModulesModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
_module_graph
:
Vc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
ChunkItem
>>
{
Vc
::
upcast
(
IncludeModulesChunkItem
{
module
:
self
,
chunking_context
,
}
.cell
(),
)
}
}
/// The chunk item for [`IncludeModulesModule`].
#[turbo_tasks
::
value]
struct
IncludeModulesChunkItem
{
module
:
ResolvedVc
<
IncludeModulesModule
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
}
#[turbo_tasks
::
value_impl]
impl
ChunkItem
for
IncludeModulesChunkItem
{
#[turbo_tasks
::
function]
fn
chunking_context
(
&
self
)
->
Vc
<
Box
<
dyn
ChunkingContext
>>
{
Vc
::
upcast
(
*
self
.chunking_context
)
}
#[turbo_tasks
::
function]
fn
asset_ident
(
&
self
)
->
Vc
<
AssetIdent
>
{
self
.module
.ident
()
}
#[turbo_tasks
::
function]
fn
ty
(
&
self
)
->
Vc
<
Box
<
dyn
ChunkType
>>
{
Vc
::
upcast
(
Vc
::
<
EcmascriptChunkType
>
::
default
())
}
#[turbo_tasks
::
function]
fn
module
(
&
self
)
->
Vc
<
Box
<
dyn
Module
>>
{
Vc
::
upcast
(
*
self
.module
)
}
}
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkItem
for
IncludeModulesChunkItem
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
EcmascriptChunkItemContent
>
{
EcmascriptChunkItemContent
{
..
Default
::
default
()
}
.cell
()
}
}
/// A module reference that references a module that is references from the
/// [`IncludeModulesModule`].
#[turbo_tasks
::
value]
pub
struct
IncludedModuleReference
{
pub
module
:
ResolvedVc
<
Box
<
dyn
Module
>>
,
}
#[turbo_tasks
::
value_impl]
impl
IncludedModuleReference
{
#[turbo_tasks
::
function]
pub
fn
new
(
module
:
ResolvedVc
<
Box
<
dyn
Module
>>
)
->
Vc
<
Self
>
{
IncludedModuleReference
{
module
}
.cell
()
}
}
#[turbo_tasks
::
value_impl]
impl
ValueToString
for
IncludedModuleReference
{
#[turbo_tasks
::
function]
fn
to_string
(
&
self
)
->
Vc
<
RcStr
>
{
Vc
::
cell
(
"module"
.into
())
}
}
#[turbo_tasks
::
value_impl]
impl
ModuleReference
for
IncludedModuleReference
{
#[turbo_tasks
::
function]
fn
resolve_reference
(
&
self
)
->
Vc
<
ModuleResolveResult
>
{
*
ModuleResolveResult
::
module
(
self
.module
)
}
}
#[turbo_tasks
::
value_impl]
impl
ChunkableModuleReference
for
IncludedModuleReference
{}
crates/next-core/src/next_app/mod.rs
View file @
c2d28fa7
...
...
@@ -3,7 +3,6 @@ pub mod app_client_shared_chunks;
pub
mod
app_entry
;
pub
mod
app_page_entry
;
pub
mod
app_route_entry
;
pub
mod
include_modules_module
;
pub
mod
metadata
;
use
std
::{
...
...
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