Unverified Commit 4d13d671 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Add check for startLatency in fast refresh (#26417)

parent 075139a2
......@@ -173,16 +173,20 @@ function handleErrors(errors) {
}
}
let startLatency = undefined
function onFastRefresh(hasUpdates) {
DevOverlay.onBuildOk()
if (hasUpdates) {
DevOverlay.onRefresh()
}
const latency = Date.now() - startLatency
console.log(`[Fast Refresh] done in ${latency}ms`)
if (self.__NEXT_HMR_LATENCY_CB) {
self.__NEXT_HMR_LATENCY_CB(latency)
if (startLatency) {
const latency = Date.now() - startLatency
console.log(`[Fast Refresh] done in ${latency}ms`)
if (self.__NEXT_HMR_LATENCY_CB) {
self.__NEXT_HMR_LATENCY_CB(latency)
}
}
}
......@@ -192,8 +196,6 @@ function handleAvailableHash(hash) {
mostRecentCompilationHash = hash
}
let startLatency = undefined
// Handle messages from the server.
function processMessage(e) {
const obj = JSON.parse(e.data)
......
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