Skip to content

Commit 8fa4055

Browse files
committed
Merge branch 'develop' into jb/pkg/profiling-node
2 parents 32b0c61 + 7dc9260 commit 8fa4055

File tree

206 files changed

+4027
-725
lines changed

Some content is hidden

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

206 files changed

+4027
-725
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,8 @@ jobs:
974974
'generic-ts3.8',
975975
'node-experimental-fastify-app',
976976
'node-hapi-app',
977-
'node-profiling'
977+
'node-profiling',
978+
'node-exports-test-app',
978979
]
979980
build-command:
980981
- false

.size-limit.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ module.exports = [
4747
gzip: true,
4848
limit: '35 KB',
4949
},
50+
{
51+
name: '@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped)',
52+
path: 'packages/browser/build/npm/esm/index.js',
53+
import: '{ init, browserTracingIntegration }',
54+
gzip: true,
55+
limit: '35 KB',
56+
},
5057
{
5158
name: '@sentry/browser (incl. Feedback) - Webpack (gzipped)',
5259
path: 'packages/browser/build/npm/esm/index.js',

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ finished. This is useful for event emitters or similar.
11031103
function middleware(_req, res, next) {
11041104
return Sentry.startSpanManual({ name: 'middleware' }, (span, finish) => {
11051105
res.once('finish', () => {
1106-
span?.setHttpStatus(res.status);
1106+
setHttpStatus(span, res.status);
11071107
finish();
11081108
});
11091109
return next();

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ able to use it. From the top level of the repo, there are three commands availab
3737
dependencies (`utils`, `core`, `browser`, etc), and all packages which depend on it (currently `gatsby` and `nextjs`))
3838
- `yarn build:dev:watch`, which runs `yarn build:dev` in watch mode (recommended)
3939

40+
You can also run a production build via `yarn build`, which will build everything except for the tarballs for publishing
41+
to NPM. You can use this if you want to bundle Sentry yourself. The build output can be found in the packages `build/`
42+
folder, e.g. `packages/browser/build`. Bundled files can be found in `packages/browser/build/bundles`. Note that there
43+
are no guarantees about the produced file names etc., so make sure to double check which files are generated after
44+
upgrading.
45+
4046
## Testing SDK Packages Locally
4147

4248
To test local versions of SDK packages, for instance in test projects, you have a couple of options:

MIGRATION.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,15 @@ The following list shows how integrations should be migrated:
5353
| `new RewriteFrames()` | `rewriteFramesIntegration()` | `@sentry/integrations` |
5454
| `new SessionTiming()` | `sessionTimingIntegration()` | `@sentry/integrations` |
5555
| `new HttpClient()` | `httpClientIntegration()` | `@sentry/integrations` |
56-
| `new ContextLines()` | `contextLinesIntegration()` | `@sentry/browser` |
56+
| `new ContextLines()` | `contextLinesIntegration()` | `@sentry/browser`, `@sentry/deno` |
5757
| `new Breadcrumbs()` | `breadcrumbsIntegration()` | `@sentry/browser`, `@sentry/deno` |
58-
| `new GlobalHandlers()` | `globalHandlersIntegration()` | `@sentry/browser` |
58+
| `new GlobalHandlers()` | `globalHandlersIntegration()` | `@sentry/browser` , `@sentry/deno` |
5959
| `new HttpContext()` | `httpContextIntegration()` | `@sentry/browser` |
6060
| `new TryCatch()` | `browserApiErrorsIntegration()` | `@sentry/browser`, `@sentry/deno` |
6161
| `new VueIntegration()` | `vueIntegration()` | `@sentry/vue` |
62+
| `new DenoContext()` | `denoContextIntegration()` | `@sentry/deno` |
63+
| `new DenoCron()` | `denoCronIntegration()` | `@sentry/deno` |
64+
| `new NormalizePaths()` | `normalizePathsIntegration()` | `@sentry/deno` |
6265

6366
## Deprecate `hub.bindClient()` and `makeMain()`
6467

biome.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@
4747
"dev-packages/browser-integration-tests/suites/**/*.json",
4848
"dev-packages/browser-integration-tests/loader-suites/**/*.js",
4949
"dev-packages/browser-integration-tests/suites/stacktraces/**/*.js",
50+
".next/**/*",
5051
"**/fixtures/*/*.json",
5152
"**/*.min.js",
52-
"**/profiling-node/lib/**"
53+
"**/profiling-node/lib/**",
54+
".next/**",
55+
".svelte-kit/**"
5356
]
5457
},
5558
"javascript": {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
// Replay should not actually work, but still not error out
6+
window.Replay = new Sentry.replayIntegration({
7+
flushMinDelay: 200,
8+
flushMaxDelay: 200,
9+
minReplayDuration: 0,
10+
});
11+
12+
Sentry.init({
13+
dsn: 'https://[email protected]/1337',
14+
sampleRate: 1,
15+
replaysSessionSampleRate: 1.0,
16+
replaysOnErrorSampleRate: 0.0,
17+
integrations: [window.Replay],
18+
});
19+
20+
// Ensure none of these break
21+
window.Replay.start();
22+
window.Replay.stop();
23+
window.Replay.flush();
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: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { sentryTest } from '../../../utils/fixtures';
4+
5+
sentryTest(
6+
'exports a shim replayIntegration integration for non-replay bundles',
7+
async ({ getLocalTestPath, page, forceFlushReplay }) => {
8+
const bundle = process.env.PW_BUNDLE;
9+
10+
if (!bundle || !bundle.startsWith('bundle_') || bundle.includes('replay')) {
11+
sentryTest.skip();
12+
}
13+
14+
const consoleMessages: string[] = [];
15+
page.on('console', msg => consoleMessages.push(msg.text()));
16+
17+
let requestCount = 0;
18+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
19+
requestCount++;
20+
return route.fulfill({
21+
status: 200,
22+
contentType: 'application/json',
23+
body: JSON.stringify({ id: 'test-id' }),
24+
});
25+
});
26+
27+
const url = await getLocalTestPath({ testDir: __dirname });
28+
29+
await page.goto(url);
30+
await forceFlushReplay();
31+
32+
expect(requestCount).toBe(0);
33+
expect(consoleMessages).toEqual(['You are using new Replay() even though this bundle does not include replay.']);
34+
},
35+
);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
integrations: [Sentry.browserTracingIntegration({ idleTimeout: 9000 })],
8+
tracesSampleRate: 1,
9+
});

0 commit comments

Comments
 (0)