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
09772c3a
Unverified
Commit
09772c3a
authored
Oct 19, 2025
by
Zack Tanner
Committed by
GitHub
Oct 19, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[cache components] add cache components indicator to dev start (#85069)
Missed the plumbing for this in `dev`.
parent
34a40fd9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
0 deletions
+67
-0
start-server.ts
packages/next/src/server/lib/start-server.ts
+3
-0
layout.tsx
test/development/app-dir/dev-output/app/layout.tsx
+11
-0
page.tsx
test/development/app-dir/dev-output/app/page.tsx
+3
-0
dev-output.test.ts
test/development/app-dir/dev-output/dev-output.test.ts
+50
-0
No files found.
packages/next/src/server/lib/start-server.ts
View file @
09772c3a
...
@@ -367,10 +367,12 @@ export async function startServer(
...
@@ -367,10 +367,12 @@ export async function startServer(
// Only load env and config in dev to for logging purposes
// Only load env and config in dev to for logging purposes
let
envInfo
:
string
[]
|
undefined
let
envInfo
:
string
[]
|
undefined
let
experimentalFeatures
:
ConfiguredExperimentalFeature
[]
|
undefined
let
experimentalFeatures
:
ConfiguredExperimentalFeature
[]
|
undefined
let
cacheComponents
:
boolean
|
undefined
try
{
try
{
if
(
isDev
)
{
if
(
isDev
)
{
const
startServerInfo
=
await
getStartServerInfo
({
dir
,
dev
:
isDev
})
const
startServerInfo
=
await
getStartServerInfo
({
dir
,
dev
:
isDev
})
envInfo
=
startServerInfo
.
envInfo
envInfo
=
startServerInfo
.
envInfo
cacheComponents
=
startServerInfo
.
cacheComponents
experimentalFeatures
=
startServerInfo
.
experimentalFeatures
experimentalFeatures
=
startServerInfo
.
experimentalFeatures
}
}
logStartInfo
({
logStartInfo
({
...
@@ -378,6 +380,7 @@ export async function startServer(
...
@@ -378,6 +380,7 @@ export async function startServer(
appUrl
,
appUrl
,
envInfo
,
envInfo
,
experimentalFeatures
,
experimentalFeatures
,
cacheComponents
,
logBundler
:
isDev
,
logBundler
:
isDev
,
})
})
...
...
test/development/app-dir/dev-output/app/layout.tsx
0 → 100644
View file @
09772c3a
export
default
function
RootLayout
({
children
,
}:
{
children
:
React
.
ReactNode
})
{
return
(
<
html
>
<
body
>
{
children
}
</
body
>
</
html
>
)
}
test/development/app-dir/dev-output/app/page.tsx
0 → 100644
View file @
09772c3a
export
default
function
Page
()
{
return
<
p
>
Hello, World!
</
p
>
}
test/development/app-dir/dev-output/dev-output.test.ts
0 → 100644
View file @
09772c3a
import
{
nextTestSetup
}
from
'e2e-utils'
const
{
version
:
nextVersion
}
=
require
(
'next/package.json'
)
const
cacheComponentsEnabled
=
process
.
env
.
__NEXT_CACHE_COMPONENTS
===
'true'
describe
(
'dev-output'
,
()
=>
{
const
{
next
,
isTurbopack
}
=
nextTestSetup
({
files
:
__dirname
,
})
it
(
'shows Cache Components indicator when enabled'
,
async
()
=>
{
const
preamble
=
getPreambleOutput
(
next
.
cliOutput
)
if
(
cacheComponentsEnabled
)
{
if
(
isTurbopack
)
{
expect
(
preamble
).
toContain
(
'Next.js'
)
expect
(
preamble
).
toContain
(
'Turbopack'
)
expect
(
preamble
).
toContain
(
'Cache Components'
)
}
else
{
expect
(
preamble
).
toContain
(
'Next.js'
)
expect
(
preamble
).
toContain
(
'webpack'
)
expect
(
preamble
).
toContain
(
'Cache Components'
)
}
}
else
{
// When cache components env is not set, should not show the indicator
expect
(
preamble
).
toContain
(
'Next.js'
)
if
(
isTurbopack
)
{
expect
(
preamble
).
toContain
(
'Turbopack'
)
}
else
{
expect
(
preamble
).
toContain
(
'webpack'
)
}
expect
(
preamble
).
not
.
toContain
(
'Cache Components'
)
}
})
})
function
getPreambleOutput
(
cliOutput
:
string
):
string
{
const
lines
:
string
[]
=
[]
for
(
const
line
of
cliOutput
.
split
(
'
\
n'
))
{
// Capture lines up to and including the "Local:" line
lines
.
push
(
line
.
replace
(
nextVersion
,
'x.y.z'
))
if
(
line
.
includes
(
'Local:'
))
{
break
}
}
return
lines
.
join
(
'
\
n'
).
trim
()
}
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