hatch-surf/node_modules/next/dist/client/dev/report-hmr-latency.js
Riley Zhang df378d33ef
Some checks failed
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Deploy static site / Deploy to GitHub Pages (push) Has been cancelled
Deploy static site / Deploy via Docker to hatch.surf (push) Has been cancelled
Merge GitHub main into Gitea repo (allow unrelated histories)
Resolved conflicts by taking GitHub versions for:
- .dockerignore, .gitignore, Dockerfile, README.md, docker-compose.yml

Kept deploy.sh updated to:
- Pull from GitHub (primary source)
- Push to Gitea (push-mirror)
- Build from site/ directory (GitHub structure)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-25 05:20:46 +02:00

49 lines
1.9 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, /**
* Logs information about a completed HMR to the console, the server (via a
* `client-hmr-latency` event), and to `self.__NEXT_HMR_LATENCY_CB` (a debugging
* hook).
*
* @param hasUpdate Set this to `false` to avoid reporting the HMR event via a
* `client-hmr-latency` event or to `self.__NEXT_HMR_LATENCY_CB`. Used by
* turbopack when we must report a message to the browser console (because we
* already logged a "rebuilding" message), but it's not a real HMR, so we
* don't want to impact our telemetry.
*/ "default", {
enumerable: true,
get: function() {
return reportHmrLatency;
}
});
function reportHmrLatency(sendMessage, updatedModules, startMsSinceEpoch, endMsSinceEpoch, hasUpdate = true) {
const latencyMs = endMsSinceEpoch - startMsSinceEpoch;
console.log(`[Fast Refresh] done in ${latencyMs}ms`);
if (!hasUpdate) {
return;
}
sendMessage(JSON.stringify({
event: 'client-hmr-latency',
id: window.__nextDevClientId,
startTime: startMsSinceEpoch,
endTime: endMsSinceEpoch,
page: window.location.pathname,
updatedModules,
// Whether the page (tab) was hidden at the time the event occurred.
// This can impact the accuracy of the event's timing.
isPageHidden: document.visibilityState === 'hidden'
}));
if (self.__NEXT_HMR_LATENCY_CB) {
self.__NEXT_HMR_LATENCY_CB(latencyMs);
}
}
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
Object.defineProperty(exports.default, '__esModule', { value: true });
Object.assign(exports.default, exports);
module.exports = exports.default;
}
//# sourceMappingURL=report-hmr-latency.js.map