Unverified Commit d11f61b1 authored by Janka Uryga's avatar Janka Uryga Committed by GitHub

Log partialPrefetching during startup (#94822)

Logs:
- `- Partial Prefetching enabled` if it's `true`
- `- Partial Prefetching enabled (unstable_eager)` if it's
`unstable_eager`
parent f2ddd134
...@@ -76,14 +76,22 @@ export function logStartInfo({ ...@@ -76,14 +76,22 @@ export function logStartInfo({
export function logExperimentalInfo({ export function logExperimentalInfo({
experimentalFeatures, experimentalFeatures,
cacheComponents, cacheComponents,
partialPrefetching,
}: { }: {
experimentalFeatures?: ConfiguredExperimentalFeature[] experimentalFeatures?: ConfiguredExperimentalFeature[]
cacheComponents?: boolean cacheComponents?: boolean
partialPrefetching?: boolean | 'unstable_eager'
}) { }) {
if (cacheComponents) { if (cacheComponents) {
Log.bootstrap(`- Cache Components enabled`) Log.bootstrap(`- Cache Components enabled`)
} }
if (partialPrefetching) {
const mode =
partialPrefetching === 'unstable_eager' ? ' (unstable_eager)' : ''
Log.bootstrap(`- Partial Prefetching enabled${mode}`)
}
if (experimentalFeatures?.length) { if (experimentalFeatures?.length) {
Log.bootstrap(`- Experiments (use with caution):`) Log.bootstrap(`- Experiments (use with caution):`)
for (const exp of experimentalFeatures) { for (const exp of experimentalFeatures) {
......
...@@ -22,6 +22,8 @@ export type ServerInitResult = { ...@@ -22,6 +22,8 @@ export type ServerInitResult = {
experimentalFeatures: ConfiguredExperimentalFeature[] experimentalFeatures: ConfiguredExperimentalFeature[]
// Whether cache components is enabled // Whether cache components is enabled
cacheComponents: boolean cacheComponents: boolean
// Whether partial prefetching is enabled (and its mode)
partialPrefetching?: boolean | 'unstable_eager'
// Whether AGENTS.md / CLAUDE.md auto-generation is enabled (default true) // Whether AGENTS.md / CLAUDE.md auto-generation is enabled (default true)
agentRules?: boolean agentRules?: boolean
} }
...@@ -103,6 +105,7 @@ async function initializeImpl(opts: { ...@@ -103,6 +105,7 @@ async function initializeImpl(opts: {
distDir: string distDir: string
experimentalFeatures: ConfiguredExperimentalFeature[] experimentalFeatures: ConfiguredExperimentalFeature[]
cacheComponents: boolean cacheComponents: boolean
partialPrefetching?: boolean | 'unstable_eager'
}): Promise<ServerInitResult> { }): Promise<ServerInitResult> {
const type = process.env.__NEXT_PRIVATE_RENDER_WORKER const type = process.env.__NEXT_PRIVATE_RENDER_WORKER
if (type) { if (type) {
...@@ -181,6 +184,7 @@ async function initializeImpl(opts: { ...@@ -181,6 +184,7 @@ async function initializeImpl(opts: {
distDir: opts.distDir, distDir: opts.distDir,
experimentalFeatures: opts.experimentalFeatures, experimentalFeatures: opts.experimentalFeatures,
cacheComponents: opts.cacheComponents, cacheComponents: opts.cacheComponents,
partialPrefetching: opts.partialPrefetching,
} }
} }
......
...@@ -756,6 +756,7 @@ export async function initialize(opts: { ...@@ -756,6 +756,7 @@ export async function initialize(opts: {
distDir: config.distDir, distDir: config.distDir,
experimentalFeatures, experimentalFeatures,
cacheComponents: config.cacheComponents, cacheComponents: config.cacheComponents,
partialPrefetching: config.partialPrefetching,
} }
renderServerOpts.serverFields.routerServerHandler = requestHandlerImpl renderServerOpts.serverFields.routerServerHandler = requestHandlerImpl
...@@ -935,6 +936,7 @@ export async function initialize(opts: { ...@@ -935,6 +936,7 @@ export async function initialize(opts: {
distDir: config.distDir, distDir: config.distDir,
experimentalFeatures, experimentalFeatures,
cacheComponents: config.cacheComponents, cacheComponents: config.cacheComponents,
partialPrefetching: config.partialPrefetching,
agentRules: config.agentRules, agentRules: config.agentRules,
} }
} }
...@@ -505,6 +505,7 @@ export async function startServer( ...@@ -505,6 +505,7 @@ export async function startServer(
logExperimentalInfo({ logExperimentalInfo({
experimentalFeatures: initResult.experimentalFeatures, experimentalFeatures: initResult.experimentalFeatures,
cacheComponents: initResult.cacheComponents, cacheComponents: initResult.cacheComponents,
partialPrefetching: initResult.partialPrefetching,
}) })
// Auto-generate AGENTS.md / CLAUDE.md when an AI coding agent // Auto-generate AGENTS.md / CLAUDE.md when an AI coding agent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment