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
49aef300
Unverified
Commit
49aef300
authored
Aug 27, 2025
by
Hendrik Liebau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: split app-render
parent
39f5d0f3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
605 additions
and
493 deletions
+605
-493
next-runtime.webpack-config.js
packages/next/next-runtime.webpack-config.js
+20
-20
app-render.react-server.tsx
...es/next/src/server/app-render/app-render.react-server.tsx
+513
-0
app-render.tsx
packages/next/src/server/app-render/app-render.tsx
+6
-472
get-root-params.tsx
packages/next/src/server/app-render/get-root-params.tsx
+56
-0
make-get-server-inserted-html.tsx
...t/src/server/app-render/make-get-server-inserted-html.tsx
+1
-0
utils.tsx
...ges/next/src/server/node-environment-extensions/utils.tsx
+8
-0
taskfile-swc.js
packages/next/taskfile-swc.js
+1
-1
No files found.
packages/next/next-runtime.webpack-config.js
View file @
49aef300
...
@@ -169,6 +169,19 @@ module.exports = ({ dev, turbo, bundleType, experimental, ...rest }) => {
...
@@ -169,6 +169,19 @@ module.exports = ({ dev, turbo, bundleType, experimental, ...rest }) => {
})
})
:
{}
:
{}
const
aliasReactServer
=
{
react
$
:
`next/dist/compiled/react
${
bundledReactChannel
}
/react.react-server`
,
[
`next/dist/compiled/react
${
bundledReactChannel
}
$`
]:
`next/dist/compiled/react
${
bundledReactChannel
}
/react.react-server`
,
'react/jsx-runtime$'
:
`next/dist/compiled/react
${
bundledReactChannel
}
/jsx-runtime.react-server`
,
[
`next/dist/compiled/react
${
bundledReactChannel
}
/jsx-runtime$`
]:
`next/dist/compiled/react
${
bundledReactChannel
}
/jsx-runtime.react-server`
,
'react/jsx-dev-runtime$'
:
`next/dist/compiled/react
${
bundledReactChannel
}
/jsx-dev-runtime.react-server`
,
[
`next/dist/compiled/react
${
bundledReactChannel
}
/jsx-dev-runtime$`
]:
`next/dist/compiled/react
${
bundledReactChannel
}
/jsx-dev-runtime.react-server`
,
'react/compiler-runtime$'
:
`next/dist/compiled/react
${
bundledReactChannel
}
/compiler-runtime`
,
[
`next/dist/compiled/react
${
bundledReactChannel
}
/compiler-runtime$`
]:
`next/dist/compiled/react
${
bundledReactChannel
}
/compiler-runtime`
,
'react-dom$'
:
`next/dist/compiled/react-dom
${
bundledReactChannel
}
/react-dom.react-server`
,
[
`next/dist/compiled/react-dom
${
bundledReactChannel
}
$`
]:
`next/dist/compiled/react-dom
${
bundledReactChannel
}
/react-dom.react-server`
,
}
return
{
return
{
entry
:
bundleTypes
[
bundleType
],
entry
:
bundleTypes
[
bundleType
],
target
:
'node'
,
target
:
'node'
,
...
@@ -183,7 +196,7 @@ module.exports = ({ dev, turbo, bundleType, experimental, ...rest }) => {
...
@@ -183,7 +196,7 @@ module.exports = ({ dev, turbo, bundleType, experimental, ...rest }) => {
devtool
:
'source-map'
,
devtool
:
'source-map'
,
optimization
:
{
optimization
:
{
moduleIds
:
'named'
,
moduleIds
:
'named'
,
minimize
:
tru
e
,
minimize
:
fals
e
,
concatenateModules
:
true
,
concatenateModules
:
true
,
minimizer
:
[
minimizer
:
[
new
webpack
.
SwcJsMinimizerRspackPlugin
({
new
webpack
.
SwcJsMinimizerRspackPlugin
({
...
@@ -250,21 +263,13 @@ module.exports = ({ dev, turbo, bundleType, experimental, ...rest }) => {
...
@@ -250,21 +263,13 @@ module.exports = ({ dev, turbo, bundleType, experimental, ...rest }) => {
layer
:
'react-server'
,
layer
:
'react-server'
,
},
},
{
{
include
:
/vendored
[\\/]
rsc
[\\/]
entrypoints/
,
include
:
[
/vendored
[\\/]
rsc
[\\/]
entrypoints/
,
/server
[\\/]
app-render
[\\/]
app-render.react-server/
,
],
resolve
:
{
resolve
:
{
conditionNames
:
[
'react-server'
,
'...'
],
conditionNames
:
[
'react-server'
,
'...'
],
alias
:
{
alias
:
aliasReactServer
,
react
$
:
`next/dist/compiled/react
${
bundledReactChannel
}
/react.react-server`
,
[
`next/dist/compiled/react
${
bundledReactChannel
}
$`
]:
`next/dist/compiled/react
${
bundledReactChannel
}
/react.react-server`
,
'react/jsx-runtime$'
:
`next/dist/compiled/react
${
bundledReactChannel
}
/jsx-runtime.react-server`
,
[
`next/dist/compiled/react
${
bundledReactChannel
}
/jsx-runtime$`
]:
`next/dist/compiled/react
${
bundledReactChannel
}
/jsx-runtime.react-server`
,
'react/jsx-dev-runtime$'
:
`next/dist/compiled/react
${
bundledReactChannel
}
/jsx-dev-runtime.react-server`
,
[
`next/dist/compiled/react
${
bundledReactChannel
}
/jsx-dev-runtime$`
]:
`next/dist/compiled/react
${
bundledReactChannel
}
/jsx-dev-runtime.react-server`
,
'react/compiler-runtime$'
:
`next/dist/compiled/react
${
bundledReactChannel
}
/compiler-runtime`
,
[
`next/dist/compiled/react
${
bundledReactChannel
}
/compiler-runtime$`
]:
`next/dist/compiled/react
${
bundledReactChannel
}
/compiler-runtime`
,
'react-dom$'
:
`next/dist/compiled/react-dom
${
bundledReactChannel
}
/react-dom.react-server`
,
[
`next/dist/compiled/react-dom
${
bundledReactChannel
}
$`
]:
`next/dist/compiled/react-dom
${
bundledReactChannel
}
/react-dom.react-server`
,
},
},
},
layer
:
'react-server'
,
layer
:
'react-server'
,
},
},
...
@@ -272,12 +277,7 @@ module.exports = ({ dev, turbo, bundleType, experimental, ...rest }) => {
...
@@ -272,12 +277,7 @@ module.exports = ({ dev, turbo, bundleType, experimental, ...rest }) => {
issuerLayer
:
'react-server'
,
issuerLayer
:
'react-server'
,
resolve
:
{
resolve
:
{
conditionNames
:
[
'react-server'
,
'...'
],
conditionNames
:
[
'react-server'
,
'...'
],
alias
:
{
alias
:
aliasReactServer
,
react
$
:
`next/dist/compiled/react
${
bundledReactChannel
}
/react.react-server`
,
[
`next/dist/compiled/react
${
bundledReactChannel
}
$`
]:
`next/dist/compiled/react
${
bundledReactChannel
}
/react.react-server`
,
'react-dom$'
:
`next/dist/compiled/react-dom
${
bundledReactChannel
}
/react-dom.react-server`
,
[
`next/dist/compiled/react-dom
${
bundledReactChannel
}
$`
]:
`next/dist/compiled/react-dom
${
bundledReactChannel
}
/react-dom.react-server`
,
},
},
},
},
},
],
],
...
...
packages/next/src/server/app-render/app-render.react-server.tsx
0 → 100644
View file @
49aef300
This diff is collapsed.
Click to expand it.
packages/next/src/server/app-render/app-render.tsx
View file @
49aef300
This diff is collapsed.
Click to expand it.
packages/next/src/server/app-render/get-root-params.tsx
0 → 100644
View file @
49aef300
import
type
{
LoaderTree
}
from
'../lib/app-dir-module'
import
type
{
Params
}
from
'../request/params'
import
type
{
GetDynamicParamFromSegment
}
from
'./app-render'
import
{
parseLoaderTree
}
from
'./parse-loader-tree'
export
function
getRootParams
(
loaderTree
:
LoaderTree
,
getDynamicParamFromSegment
:
GetDynamicParamFromSegment
):
Params
{
return
getRootParamsImpl
({},
loaderTree
,
getDynamicParamFromSegment
)
}
function
getRootParamsImpl
(
parentParams
:
Params
,
loaderTree
:
LoaderTree
,
getDynamicParamFromSegment
:
GetDynamicParamFromSegment
):
Params
{
const
{
segment
,
modules
:
{
layout
},
parallelRoutes
,
}
=
parseLoaderTree
(
loaderTree
)
const
segmentParam
=
getDynamicParamFromSegment
(
segment
)
let
currentParams
:
Params
=
parentParams
if
(
segmentParam
&&
segmentParam
.
value
!==
null
)
{
currentParams
=
{
...
parentParams
,
[
segmentParam
.
param
]:
segmentParam
.
value
,
}
}
const
isRootLayout
=
typeof
layout
!==
'undefined'
if
(
isRootLayout
)
{
return
currentParams
}
else
if
(
!
parallelRoutes
.
children
)
{
// This should really be an error but there are bugs in Turbopack that cause
// the _not-found LoaderTree to not have any layouts. For rootParams sake
// this is somewhat irrelevant when you are not customizing the 404 page.
// If you are customizing 404
// TODO update rootParams to make all params optional if `/app/not-found.tsx` is defined
return
currentParams
}
else
{
return
getRootParamsImpl
(
currentParams
,
// We stop looking for root params as soon as we hit the first layout and
// it is not possible to use parallel route children above the root layout
// so every parallelRoutes object that this function can visit will
// necessarily have a single `children` prop and no others.
parallelRoutes
.
children
,
getDynamicParamFromSegment
)
}
}
packages/next/src/server/app-render/make-get-server-inserted-html.tsx
View file @
49aef300
...
@@ -87,6 +87,7 @@ export function makeGetServerInsertedHTML({
...
@@ -87,6 +87,7 @@ export function makeGetServerInsertedHTML({
return
''
return
''
}
}
// TODO: Use `prerender`?
const
stream
=
await
renderToReadableStream
(
const
stream
=
await
renderToReadableStream
(
<>
<>
{
{
...
...
packages/next/src/server/node-environment-extensions/utils.tsx
View file @
49aef300
...
@@ -49,6 +49,14 @@ export function io(expression: string, type: ApiType) {
...
@@ -49,6 +49,14 @@ export function io(expression: string, type: ApiType) {
if
(
process
.
env
.
NODE_ENV
!==
'production'
)
{
if
(
process
.
env
.
NODE_ENV
!==
'production'
)
{
const
ownerStack
=
workUnitStore
.
captureOwnerStack
!
()
const
ownerStack
=
workUnitStore
.
captureOwnerStack
!
()
console
.
log
(
'WORK UNIT STORE'
,
workUnitStore
.
type
,
'STACK
\
n'
,
errorWithStack
.
stack
,
'OWNER STACK
\
n'
,
ownerStack
)
if
(
ownerStack
)
{
if
(
ownerStack
)
{
// TODO: Instead of stitching the stacks here, we should log the
// TODO: Instead of stitching the stacks here, we should log the
...
...
packages/next/taskfile-swc.js
View file @
49aef300
...
@@ -111,7 +111,7 @@ module.exports = function (task) {
...
@@ -111,7 +111,7 @@ module.exports = function (task) {
runtime
:
'automatic'
,
runtime
:
'automatic'
,
pragmaFrag
:
'React.Fragment'
,
pragmaFrag
:
'React.Fragment'
,
throwIfNamespace
:
true
,
throwIfNamespace
:
true
,
development
:
fals
e
,
development
:
tru
e
,
useBuiltins
:
true
,
useBuiltins
:
true
,
},
},
},
},
...
...
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