Skip to content

Commit

Permalink
use relayer
Browse files Browse the repository at this point in the history
  • Loading branch information
housseindjirdeh committed Nov 21, 2019
1 parent d1a54bd commit bd9ac98
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions packages/next/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,22 +379,14 @@ function measureFid () {
const { startTime, duration } = hydrationMeasures[0]
const hydrateEnd = startTime + duration

// TODO: Instead of console.logs, expose values to user code through perf relayer (next.js/pull/8480)
console.log(
'First input after hydration',
`start: ${event.timeStamp}`,
`delay: ${delay}`
)
console.log(
'Delta between hydration end and first input',
`diff: ${event.timeStamp - hydrateEnd}`
)
if (onPerfEntry) {
onPerfEntry({ name: 'first-input-delay-after-hydration', startTime: event.timeStamp, value: delay })
onPerfEntry({ name: 'time-to-first-input-after-hydration', startTime: hydrateEnd, value: event.timeStamp - hydrateEnd })
}
} else {
console.log(
'First input before hydration',
`start: ${event.timeStamp}`,
`delay: ${delay}`
)
if (onPerfEntry) {
onPerfEntry({ name: 'first-input-delay-before-hydration', startTime: event.timeStamp, value: delay })
}
}
})

Expand Down

0 comments on commit bd9ac98

Please sign in to comment.