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
ccfe44d3
Commit
ccfe44d3
authored
Nov 05, 2025
by
Niklas Mischkulnig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
7e638d8d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
162 additions
and
54 deletions
+162
-54
works.tsx
bench/basic-app/works.tsx
+0
-0
dynamic_imports.rs
crates/next-api/src/dynamic_imports.rs
+19
-2
module_graph.rs
crates/next-api/src/module_graph.rs
+21
-1
pages.rs
crates/next-api/src/pages.rs
+117
-46
page_entry.rs
crates/next-core/src/next_pages/page_entry.rs
+5
-5
No files found.
bench/basic-app/
pages/
works.tsx
→
bench/basic-app/works.tsx
View file @
ccfe44d3
File moved
crates/next-api/src/dynamic_imports.rs
View file @
ccfe44d3
...
...
@@ -26,8 +26,8 @@ use next_core::{
};
use
serde
::{
Deserialize
,
Serialize
};
use
turbo_tasks
::{
FxIndexMap
,
NonLocalValue
,
ReadRef
,
ResolvedVc
,
TryFlatJoinIterExt
,
TryJoinIterExt
,
Vc
,
debug
::
ValueDebugFormat
,
trace
::
TraceRawVcs
,
FxIndexMap
,
NonLocalValue
,
ReadRef
,
ResolvedVc
,
TryFlatJoinIterExt
,
TryJoinIterExt
,
ValueDefault
,
Vc
,
debug
::
ValueDebugFormat
,
trace
::
TraceRawVcs
,
};
use
turbopack_core
::{
chunk
::{
...
...
@@ -107,6 +107,23 @@ pub struct DynamicImportedChunks(
>
,
);
#[turbo_tasks
::
value_impl]
impl
DynamicImportedChunks
{
#[turbo_tasks
::
function]
pub
async
fn
concatenate
(
&
self
,
other
:
Vc
<
Self
>
)
->
Result
<
Vc
<
Self
>>
{
let
mut
chunks
=
self
.
0
.clone
();
chunks
.extend
(
other
.await
?
.iter
()
.map
(|(
k
,
v
)|
(
*
k
,
*
v
)));
Ok
(
Vc
::
cell
(
chunks
))
}
}
#[turbo_tasks
::
value_impl]
impl
ValueDefault
for
DynamicImportedChunks
{
#[turbo_tasks
::
function]
fn
value_default
()
->
Vc
<
Self
>
{
Self
::
default
()
.cell
()
}
}
#[derive(
Clone,
PartialEq,
Eq,
ValueDebugFormat,
Serialize,
Deserialize,
TraceRawVcs,
NonLocalValue,
)]
...
...
crates/next-api/src/module_graph.rs
View file @
ccfe44d3
...
...
@@ -16,7 +16,8 @@ use rustc_hash::FxHashMap;
use
tracing
::
Instrument
;
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_tasks
::{
CollectiblesSource
,
FxIndexMap
,
FxIndexSet
,
ResolvedVc
,
TryFlatJoinIterExt
,
TryJoinIterExt
,
Vc
,
CollectiblesSource
,
FxIndexMap
,
FxIndexSet
,
ResolvedVc
,
TryFlatJoinIterExt
,
TryJoinIterExt
,
ValueToString
,
Vc
,
};
use
turbo_tasks_fs
::
FileSystemPath
;
use
turbopack
::
css
::{
CssModuleAsset
,
ModuleCssAsset
};
...
...
@@ -75,6 +76,25 @@ impl NextDynamicGraph {
async
move
{
let
data
=
&*
self
.data.await
?
;
let
graph
=
&*
self
.graph.await
?
;
// println!(
// "get {:?} {} {:#?} {:#?} {:#?}",
// entry,
// entry.ident().to_string().await?,
// data.keys()
// .map(|m| m.ident().to_string())
// .try_join()
// .await?,
// graph
// .entry_modules()
// .map(|m| m.ident().to_string())
// .try_join()
// .await?,
// graph
// .enumerate_nodes()
// .map(|n| n.1.module().ident().to_string())
// .try_join()
// .await?
// );
#[derive(Clone,
PartialEq,
Eq)]
enum
VisitState
{
...
...
crates/next-api/src/pages.rs
View file @
ccfe44d3
This diff is collapsed.
Click to expand it.
crates/next-core/src/next_pages/page_entry.rs
View file @
ccfe44d3
...
...
@@ -25,8 +25,8 @@ use crate::{
#[turbo_tasks
::
value]
pub
struct
PageSsrEntryModule
{
pub
ssr_module
:
ResolvedVc
<
Box
<
dyn
Module
>>
,
pub
app_module
:
Option
<
ResolvedVc
<
Box
<
dyn
Module
>>>
,
pub
document_module
:
Option
<
ResolvedVc
<
Box
<
dyn
Module
>>>
,
pub
app_
ssr_
module
:
Option
<
ResolvedVc
<
Box
<
dyn
Module
>>>
,
pub
document_
ssr_
module
:
Option
<
ResolvedVc
<
Box
<
dyn
Module
>>>
,
}
#[turbo_tasks
::
function]
...
...
@@ -127,7 +127,7 @@ pub async fn create_page_ssr_entry_module(
let
pages_structure_ref
=
pages_structure
.await
?
;
let
(
app_
module
,
document
_module
)
=
if
is_page
{
let
(
app_
ssr_module
,
document_ssr
_module
)
=
if
is_page
{
// We process the document and app modules in the same context and reference type.
let
document_module
=
process_global_item
(
*
pages_structure_ref
.document
,
...
...
@@ -184,8 +184,8 @@ pub async fn create_page_ssr_entry_module(
Ok
(
PageSsrEntryModule
{
ssr_module
:
ssr_module
.to_resolved
()
.await
?
,
app_module
,
document_module
,
app_
ssr_
module
,
document_
ssr_
module
,
}
.cell
())
}
...
...
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