Skip to content

Commit 00efcd5

Browse files
authored
Merge branch 'develop' into handle-buffer
2 parents 402bd0e + c56d84d commit 00efcd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+754
-179
lines changed

.github/dependency-review-config.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fail-on-severity: 'high'
2+
allow-ghsas:
3+
# dependency review does not allow specific file exclusions
4+
# we use an older version of NextJS in our tests and thus need to
5+
# exclude this
6+
# once our minimum supported version is over 14.1.1 this can be removed
7+
- GHSA-fr5h-rqp8-mj6g

.github/workflows/build.yml

+33-11
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@ jobs:
904904
'nextjs-13',
905905
'nextjs-14',
906906
'nextjs-15',
907+
'nextjs-turbo',
907908
'nextjs-t3',
908909
'react-17',
909910
'react-19',
@@ -1018,12 +1019,12 @@ jobs:
10181019

10191020
- name: Build E2E app
10201021
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1021-
timeout-minutes: 5
1022+
timeout-minutes: 7
10221023
run: pnpm ${{ matrix.build-command || 'test:build' }}
10231024

10241025
- name: Run E2E test
10251026
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1026-
timeout-minutes: 5
1027+
timeout-minutes: 10
10271028
run: pnpm test:assert
10281029

10291030
- name: Upload Playwright Traces
@@ -1035,14 +1036,19 @@ jobs:
10351036
overwrite: true
10361037
retention-days: 7
10371038

1039+
- name: Pre-process E2E Test Dumps
1040+
run: |
1041+
node ./scripts/normalize-e2e-test-dump-transaction-events.js
1042+
10381043
- name: Upload E2E Test Event Dumps
10391044
uses: actions/upload-artifact@v4
10401045
if: always()
10411046
with:
1042-
name: playwright-event-dumps-job_e2e_playwright_tests-${{ matrix.test-application }}
1047+
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
10431048
path: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/event-dumps
10441049
overwrite: true
10451050
retention-days: 7
1051+
if-no-files-found: ignore
10461052

10471053
- name: Upload test results to Codecov
10481054
if: cancelled() == false
@@ -1083,10 +1089,6 @@ jobs:
10831089
'react-send-to-sentry',
10841090
'node-express-send-to-sentry',
10851091
'debug-id-sourcemaps',
1086-
'nextjs-app-dir',
1087-
'nextjs-13',
1088-
'nextjs-14',
1089-
'nextjs-15',
10901092
]
10911093
build-command:
10921094
- false
@@ -1125,6 +1127,12 @@ jobs:
11251127
- test-application: 'nextjs-15'
11261128
build-command: 'test:build-latest'
11271129
label: 'nextjs-15 (latest)'
1130+
- test-application: 'nextjs-turbo'
1131+
build-command: 'test:build-canary'
1132+
label: 'nextjs-turbo (canary)'
1133+
- test-application: 'nextjs-turbo'
1134+
build-command: 'test:build-latest'
1135+
label: 'nextjs-turbo (latest)'
11281136

11291137
steps:
11301138
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
@@ -1176,14 +1184,28 @@ jobs:
11761184

11771185
- name: Build E2E app
11781186
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1179-
timeout-minutes: 5
1187+
timeout-minutes: 7
11801188
run: pnpm ${{ matrix.build-command || 'test:build' }}
11811189

11821190
- name: Run E2E test
11831191
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1184-
timeout-minutes: 5
1192+
timeout-minutes: 10
11851193
run: pnpm ${{ matrix.assert-command || 'test:assert' }}
11861194

1195+
- name: Pre-process E2E Test Dumps
1196+
run: |
1197+
node ./scripts/normalize-e2e-test-dump-transaction-events.js
1198+
1199+
- name: Upload E2E Test Event Dumps
1200+
uses: actions/upload-artifact@v4
1201+
if: always()
1202+
with:
1203+
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
1204+
path: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/event-dumps
1205+
overwrite: true
1206+
retention-days: 7
1207+
if-no-files-found: ignore
1208+
11871209
- name: Deploy Astro to Cloudflare
11881210
uses: cloudflare/pages-action@v1
11891211
if: matrix.test-application == 'cloudflare-astro'
@@ -1282,12 +1304,12 @@ jobs:
12821304

12831305
- name: Build E2E app
12841306
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1285-
timeout-minutes: 5
1307+
timeout-minutes: 7
12861308
run: yarn ${{ matrix.build-command || 'test:build' }}
12871309

12881310
- name: Run E2E test
12891311
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1290-
timeout-minutes: 5
1312+
timeout-minutes: 10
12911313
run: yarn test:assert
12921314

12931315
job_required_jobs_passed:

.github/workflows/canary.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ jobs:
9696
- test-application: 'nextjs-15'
9797
build-command: 'test:build-latest'
9898
label: 'nextjs-15 (latest)'
99+
- test-application: 'nextjs-turbo'
100+
build-command: 'test:build-canary'
101+
label: 'nextjs-turbo (canary)'
102+
- test-application: 'nextjs-turbo'
103+
build-command: 'test:build-latest'
104+
label: 'nextjs-turbo (latest)'
99105
- test-application: 'react-create-hash-router'
100106
build-command: 'test:build-canary'
101107
label: 'react-create-hash-router (canary)'
@@ -140,7 +146,7 @@ jobs:
140146

141147
- name: Build E2E app
142148
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
143-
timeout-minutes: 5
149+
timeout-minutes: 7
144150
run: yarn ${{ matrix.build-command }}
145151

146152
- name: Run E2E test

dev-packages/e2e-tests/test-applications/debug-id-sourcemaps/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"devDependencies": {
1616
"rollup": "^4.0.2",
1717
"vitest": "^0.34.6",
18-
"@sentry/rollup-plugin": "2.22.3"
18+
"@sentry/rollup-plugin": "2.22.6"
1919
},
2020
"volta": {
2121
"extends": "../../package.json"

dev-packages/e2e-tests/test-applications/nextjs-13/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ next-env.d.ts
3838
!*.d.ts
3939

4040
test-results
41+
event-dumps
4142

4243
.vscode
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
import * as fs from 'fs';
2+
import * as path from 'path';
13
import { startEventProxyServer } from '@sentry-internal/test-utils';
24

5+
const packageJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json')));
6+
37
startEventProxyServer({
48
port: 3031,
59
proxyServerName: 'nextjs-13',
10+
envelopeDumpPath: path.join(
11+
process.cwd(),
12+
`event-dumps/next-13-v${packageJson.dependencies.next}-${process.env.TEST_ENV}.dump`,
13+
),
614
});

dev-packages/e2e-tests/test-applications/nextjs-14/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ next-env.d.ts
4343
.vscode
4444

4545
test-results
46+
event-dumps
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
import * as fs from 'fs';
2+
import * as path from 'path';
13
import { startEventProxyServer } from '@sentry-internal/test-utils';
24

5+
const packageJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json')));
6+
37
startEventProxyServer({
48
port: 3031,
59
proxyServerName: 'nextjs-14',
10+
envelopeDumpPath: path.join(
11+
process.cwd(),
12+
`event-dumps/next-14-v${packageJson.dependencies.next}-${process.env.TEST_ENV}.dump`,
13+
),
614
});

dev-packages/e2e-tests/test-applications/nextjs-15/start-event-proxy.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ startEventProxyServer({
99
proxyServerName: 'nextjs-15',
1010
envelopeDumpPath: path.join(
1111
process.cwd(),
12-
`event-dumps/next-${packageJson.dependencies.next}-${process.env.TEST_ENV}.dump`,
12+
`event-dumps/next-15-v${packageJson.dependencies.next}-${process.env.TEST_ENV}.dump`,
1313
),
1414
});

dev-packages/e2e-tests/test-applications/nextjs-app-dir/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ next-env.d.ts
4343
.vscode
4444

4545
test-results
46+
event-dumps
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
import * as fs from 'fs';
2+
import * as path from 'path';
13
import { startEventProxyServer } from '@sentry-internal/test-utils';
24

5+
const packageJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json')));
6+
37
startEventProxyServer({
48
port: 3031,
59
proxyServerName: 'nextjs-app-dir',
10+
envelopeDumpPath: path.join(
11+
process.cwd(),
12+
`event-dumps/next-app-dir-v${packageJson.dependencies.next}-${process.env.TEST_ENV}.dump`,
13+
),
614
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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
46+
event-dumps
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const dynamic = 'force-dynamic';
2+
3+
export default function Page() {
4+
if (Math.random() > -1) {
5+
throw new Error('page rsc render error');
6+
}
7+
8+
return null;
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
'use client';
2+
3+
import * as Sentry from '@sentry/nextjs';
4+
import NextError from 'next/error';
5+
import { useEffect } from 'react';
6+
7+
export default function GlobalError({
8+
error,
9+
}: {
10+
error: Error & { digest?: string };
11+
}) {
12+
useEffect(() => {
13+
Sentry.captureException(error);
14+
}, [error]);
15+
16+
return (
17+
<html>
18+
<body>
19+
{/* `NextError` is the default Next.js error page component. Its type
20+
definition requires a `statusCode` prop. However, since the App Router
21+
does not expose status codes for errors, we simply pass 0 to render a
22+
generic error message. */}
23+
<NextError statusCode={0} />
24+
</body>
25+
</html>
26+
);
27+
}
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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface Window {
2+
recordedTransactions?: string[];
3+
capturedExceptionId?: string;
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as Sentry from '@sentry/nextjs';
2+
3+
export async function register() {
4+
if (process.env.NEXT_RUNTIME === 'nodejs') {
5+
await import('./sentry.server.config');
6+
}
7+
8+
if (process.env.NEXT_RUNTIME === 'edge') {
9+
await import('./sentry.edge.config');
10+
}
11+
}
12+
13+
export const onRequestError = Sentry.captureRequestError;
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/app/building-your-application/configuring/typescript for more information.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const { withSentryConfig } = require('@sentry/nextjs');
2+
3+
/** @type {import('next').NextConfig} */
4+
const nextConfig = {
5+
experimental: {
6+
turbo: {}, // Enables Turbopack for builds
7+
},
8+
};
9+
10+
module.exports = withSentryConfig(nextConfig, {
11+
silent: true,
12+
});

0 commit comments

Comments
 (0)