Skip to content

Commit d5a332c

Browse files
author
Luca Forstner
authored
feat(nextjs): Trace pageloads in App Router (#12157)
1 parent 4caf92c commit d5a332c

23 files changed

+415
-20
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,7 @@ jobs:
10081008
'node-express-esm-without-loader',
10091009
'nextjs-app-dir',
10101010
'nextjs-14',
1011+
'nextjs-15',
10111012
'react-create-hash-router',
10121013
'react-router-6-use-routes',
10131014
'react-router-5',

.github/workflows/canary.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ jobs:
8383
- test-application: 'nextjs-14'
8484
build-command: 'test:build-latest'
8585
label: 'nextjs-14 (latest)'
86+
- test-application: 'nextjs-15'
87+
build-command: 'test:build-canary'
88+
label: 'nextjs-15 (canary)'
89+
- test-application: 'nextjs-15'
90+
build-command: 'test:build-latest'
91+
label: 'nextjs-15 (latest)'
8692
- test-application: 'react-create-hash-router'
8793
build-command: 'test:build-canary'
8894
label: 'react-create-hash-router (canary)'
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts
37+
38+
!*.d.ts
39+
40+
# Sentry
41+
.sentryclirc
42+
43+
.vscode
44+
45+
test-results
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@sentry:registry=http://127.0.0.1:4873
2+
@sentry-internal:registry=http://127.0.0.1:4873
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function Layout({ children }: { children: React.ReactNode }) {
2+
return (
3+
<html lang="en">
4+
<body>{children}</body>
5+
</html>
6+
);
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { PropsWithChildren } from 'react';
2+
3+
export const dynamic = 'force-dynamic';
4+
5+
export default async function Layout({ children }: PropsWithChildren<unknown>) {
6+
await new Promise(resolve => setTimeout(resolve, 500));
7+
return <>{children}</>;
8+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const dynamic = 'force-dynamic';
2+
3+
export default async function Page() {
4+
await new Promise(resolve => setTimeout(resolve, 1000));
5+
return <p>I am page 2</p>;
6+
}
7+
8+
export async function generateMetadata() {
9+
(await fetch('http://example.com/')).text();
10+
11+
return {
12+
title: 'my title',
13+
};
14+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface Window {
2+
recordedTransactions?: string[];
3+
capturedExceptionId?: string;
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export async function register() {
2+
if (process.env.NEXT_RUNTIME === 'nodejs') {
3+
await import('./sentry.server.config');
4+
}
5+
6+
if (process.env.NEXT_RUNTIME === 'edge') {
7+
await import('./sentry.edge.config');
8+
}
9+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

0 commit comments

Comments
 (0)