Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
31 lines
1.0 KiB
Plaintext
31 lines
1.0 KiB
Plaintext
import { WINDOW } from '@sentry/react';
|
|
import { appRouterInstrumentNavigation, appRouterInstrumentPageLoad } from './appRouterRoutingInstrumentation.js';
|
|
import { pagesRouterInstrumentNavigation, pagesRouterInstrumentPageLoad } from './pagesRouterRoutingInstrumentation.js';
|
|
|
|
/**
|
|
* Instruments the Next.js Client Router for page loads.
|
|
*/
|
|
function nextRouterInstrumentPageLoad(client) {
|
|
const isAppRouter = !WINDOW.document.getElementById('__NEXT_DATA__');
|
|
if (isAppRouter) {
|
|
appRouterInstrumentPageLoad(client);
|
|
} else {
|
|
pagesRouterInstrumentPageLoad(client);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Instruments the Next.js Client Router for navigation.
|
|
*/
|
|
function nextRouterInstrumentNavigation(client) {
|
|
const isAppRouter = !WINDOW.document.getElementById('__NEXT_DATA__');
|
|
if (isAppRouter) {
|
|
appRouterInstrumentNavigation(client);
|
|
} else {
|
|
pagesRouterInstrumentNavigation(client);
|
|
}
|
|
}
|
|
|
|
export { nextRouterInstrumentNavigation, nextRouterInstrumentPageLoad };
|
|
//# sourceMappingURL=nextRoutingInstrumentation.js.map
|