mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Draft replacement for #96267 after restructuring the Request Insights stack. ## Summary - Request Insights bookkeeping used `Date.now()`, which Cache Components patches to detect unstable application wall-clock reads. - Framework bookkeeping could therefore be incorrectly attributed to user code. - Implicit timestamps now use `performance.timeOrigin + performance.now()`. - Explicit OpenTelemetry timestamp inputs remain unchanged. - Tests distinguish framework bookkeeping from a genuine application `Date.now()` call. ## Verification ```bash pnpm build-all pnpm --filter=next types pnpm --filter=next build pnpm test-unit --runTestsByPath packages/next/src/server/lib/trace/local-span-recorder.test.ts packages/next/src/server/lib/trace/span-store.test.ts packages/next/src/server/lib/trace/request-insights.test.ts pnpm test-dev-turbo test/development/app-dir/request-insights/request-insights.test.ts pnpm test-dev-webpack test/development/app-dir/request-insights/request-insights.test.ts ``` <!-- NEXT_JS_LLM -->
13 lines
320 B
TypeScript
13 lines
320 B
TypeScript
import type { Metadata } from 'next'
|
|
|
|
export const instant = { level: 'experimental-error' }
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
await new Promise<void>((resolve) => process.nextTick(resolve))
|
|
return { title: 'safe clock' }
|
|
}
|
|
|
|
export default function Page() {
|
|
return <p>safe clock</p>
|
|
}
|