Skip to content

Commit be1e9f3

Browse files
author
Luca Forstner
committed
Merge remote-tracking branch 'origin/master' into lforst-app-dir-browser
2 parents 4c3e556 + 2f9ab36 commit be1e9f3

Some content is hidden

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

41 files changed

+337
-88
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ jobs:
191191
- name: Check build cache
192192
uses: actions/cache@v3
193193
id: cache_built_packages
194-
if: needs.job_get_metadata.outputs.force_skip_cache == 'false'
195194
with:
196195
path: ${{ env.CACHED_BUILD_PATHS }}
197196
key: ${{ env.BUILD_CACHE_KEY }}

.size-limit.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,10 @@ module.exports = [
7878
limit: '48 KB',
7979
ignore: ['@sentry/browser', '@sentry/utils', '@sentry/core', '@sentry/types'],
8080
},
81+
{
82+
name: '@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified)',
83+
path: 'packages/tracing/build/bundles/bundle.tracing.replay.min.js',
84+
gzip: true,
85+
limit: '80 KB',
86+
},
8187
];

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7+
## 7.31.1
8+
9+
- build(replay): Provide full browser+tracing+replay bundle (#6793)
10+
- feat(nextjs): Disable NextJS perf monitoring when using otel (#6820)
11+
- fix(nextjs): Add back browser field in package.json (#6809)
12+
- fix(nextjs): Connect Edge API route errors to span (#6806)
13+
- fix(nextjs): Correctly handle ts middleware files (#6816)
14+
715
## 7.31.0
816

917
The Next.js SDK now supports error and performance monitoring for Next.js [middleware](https://nextjs.org/docs/advanced-features/middleware) and [Edge API routes](https://nextjs.org/docs/api-routes/edge-api-routes).

packages/integration-tests/suites/replay/captureReplay/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { sentryTest } from '../../../utils/fixtures';
66
import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers';
77

88
sentryTest('captureReplay', async ({ getLocalTestPath, page }) => {
9-
// Currently bundle tests are not supported for replay
10-
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_')) {
9+
// Replay bundles are es6 only
10+
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_es5')) {
1111
sentryTest.skip();
1212
}
1313

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
window.Replay = new Sentry.Replay({
5+
flushMinDelay: 200,
6+
initialFlushDelay: 200,
7+
});
8+
9+
Sentry.init({
10+
dsn: 'https://[email protected]/1337',
11+
sampleRate: 0,
12+
replaysSessionSampleRate: 1.0,
13+
replaysOnErrorSampleRate: 0.0,
14+
15+
integrations: [window.Replay],
16+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
</head>
6+
<body>
7+
<button onclick="console.log('Test log')">Click me</button>
8+
</body>
9+
</html>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { expect } from '@playwright/test';
2+
import { SDK_VERSION } from '@sentry/browser';
3+
import type { Event } from '@sentry/types';
4+
5+
import { sentryTest } from '../../../utils/fixtures';
6+
import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers';
7+
8+
sentryTest('captureReplay', async ({ getLocalTestPath, page }) => {
9+
// For this test, we skip all bundle tests, as we're only interested in Replay being correctly
10+
// exported from the `@sentry/browser` npm package.
11+
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_')) {
12+
sentryTest.skip();
13+
}
14+
15+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
16+
return route.fulfill({
17+
status: 200,
18+
contentType: 'application/json',
19+
body: JSON.stringify({ id: 'test-id' }),
20+
});
21+
});
22+
23+
const url = await getLocalTestPath({ testDir: __dirname });
24+
await page.goto(url);
25+
26+
await page.click('button');
27+
await page.waitForTimeout(300);
28+
29+
const replayEvent = await getFirstSentryEnvelopeRequest<Event>(page, url);
30+
31+
expect(replayEvent).toBeDefined();
32+
expect(replayEvent).toEqual({
33+
type: 'replay_event',
34+
timestamp: expect.any(Number),
35+
error_ids: [],
36+
trace_ids: [],
37+
urls: [expect.stringContaining('/dist/index.html')],
38+
replay_id: expect.stringMatching(/\w{32}/),
39+
segment_id: 2,
40+
replay_type: 'session',
41+
event_id: expect.stringMatching(/\w{32}/),
42+
environment: 'production',
43+
sdk: {
44+
integrations: [
45+
'InboundFilters',
46+
'FunctionToString',
47+
'TryCatch',
48+
'Breadcrumbs',
49+
'GlobalHandlers',
50+
'LinkedErrors',
51+
'Dedupe',
52+
'HttpContext',
53+
'Replay',
54+
],
55+
version: SDK_VERSION,
56+
name: 'sentry.javascript.browser',
57+
},
58+
sdkProcessingMetadata: {},
59+
request: {
60+
url: expect.stringContaining('/dist/index.html'),
61+
headers: {
62+
'User-Agent': expect.stringContaining(''),
63+
},
64+
},
65+
platform: 'javascript',
66+
tags: { sessionSampleRate: 1, errorSampleRate: 0 },
67+
});
68+
});

packages/integration-tests/suites/replay/errorResponse/test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getReplaySnapshot } from '../../../utils/helpers';
55

66
sentryTest('errorResponse', async ({ getLocalTestPath, page }) => {
77
// Currently bundle tests are not supported for replay
8-
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_')) {
8+
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_es5')) {
99
sentryTest.skip();
1010
}
1111

@@ -31,7 +31,9 @@ sentryTest('errorResponse', async ({ getLocalTestPath, page }) => {
3131
await page.waitForTimeout(5001);
3232

3333
expect(called).toBe(1);
34+
3435
const replay = await getReplaySnapshot(page);
3536

36-
expect(replay['_isEnabled']).toBe(false);
37+
// @ts-ignore private API
38+
expect(replay._isEnabled).toBe(false);
3739
});

packages/integration-tests/suites/replay/init.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import * as Sentry from '@sentry/browser';
2+
import { Replay } from '@sentry/replay';
23

34
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
5+
window.Replay = new Replay({
56
flushMinDelay: 200,
67
initialFlushDelay: 200,
78
});

packages/integration-tests/suites/replay/sampling/init.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import * as Sentry from '@sentry/browser';
2+
import { Replay } from '@sentry/replay';
23

34
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
5+
window.Replay = new Replay({
56
flushMinDelay: 200,
67
initialFlushDelay: 200,
78
});

0 commit comments

Comments
 (0)