Skip to content

Commit 29998a5

Browse files
authored
Merge pull request #10405 from getsentry/prepare-release/7.99.0
meta(changelog): Update changelog for 7.99.0
2 parents f296747 + 818d959 commit 29998a5

File tree

223 files changed

+5239
-1169
lines changed

Some content is hidden

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

223 files changed

+5239
-1169
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,7 @@ jobs:
913913
'generic-ts3.8',
914914
'node-experimental-fastify-app',
915915
'node-hapi-app',
916+
'node-exports-test-app',
916917
]
917918
build-command:
918919
- false
@@ -946,6 +947,9 @@ jobs:
946947
uses: actions/setup-node@v4
947948
with:
948949
node-version-file: 'dev-packages/e2e-tests/package.json'
950+
- name: Set up Bun
951+
if: matrix.test-application == 'node-exports-test-app'
952+
uses: oven-sh/setup-bun@v1
949953
- name: Restore caches
950954
uses: ./.github/actions/restore-cache
951955
env:

.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: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,43 @@
44

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

7+
## 7.99.0
8+
9+
### Important Changes
10+
11+
#### Deprecations
12+
13+
This release includes some deprecations for span related methods and integrations in our Deno SDK, `@sentry/deno`. For
14+
more details please look at our
15+
[migration guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md).
16+
17+
- feat(core): Deprecate `Span.setHttpStatus` in favor of `setHttpStatus` (#10268)
18+
- feat(core): Deprecate `spanStatusfromHttpCode` in favour of `getSpanStatusFromHttpCode` (#10361)
19+
- feat(core): Deprecate `StartSpanOptions.origin` in favour of passing attribute (#10274)
20+
- feat(deno): Expose functional integrations to replace classes (#10355)
21+
22+
### Other Changes
23+
24+
- feat(bun): Add missing `@sentry/node` re-exports (#10396)
25+
- feat(core): Add `afterAllSetup` hook for integrations (#10345)
26+
- feat(core): Ensure `startSpan()` can handle spans that require parent (#10386)
27+
- feat(core): Read propagation context off scopes in `startSpan` APIs (#10300)
28+
- feat(remix): Export missing `@sentry/node` functions (#10385, #10391)
29+
- feat(serverless): Add missing `@sentry/node` re-exports (#10390)
30+
- feat(sveltekit): Add more missing `@sentry/node` re-exports (#10392)
31+
- feat(tracing): Export proper type for browser tracing (#10411)
32+
- feat(tracing): Expose new `browserTracingIntegration` (#10351)
33+
- fix: Ensure `afterAllSetup` is called when using `addIntegration()` (#10372)
34+
- fix(core): Export `spanToTraceContext` function from span utils (#10364)
35+
- fix(core): Make `FunctionToString` integration use SETUP_CLIENTS weakmap (#10358)
36+
- fix(deno): Call function if client is not setup (#10354)
37+
- fix(react): Fix attachReduxState option (#10381)
38+
- fix(spotlight): Use unpatched http.request (#10369)
39+
- fix(tracing): Only create request span if there is active span (#10375)
40+
- ref: Read propagation context off of scope and isolation scope when propagating and applying trace context (#10297)
41+
42+
Work in this release contributed by @AleshaOleg. Thank you for your contribution!
43+
744
## 7.98.0
845

946
This release primarily fixes some type declaration errors:
@@ -20,7 +57,7 @@ Note: The 7.96.0 release was incomplete. This release is partially encompassing
2057

2158
## 7.96.0
2259

23-
Note: This release was incomplete. Not all Sentry SDK packages were released for this version. Please upgrade to 7.97.0
60+
Note: This release was incomplete. Not all Sentry SDK packages were released for this version. Please upgrade to 7.98.0
2461
directly.
2562

2663
### Important Changes
@@ -1103,7 +1140,7 @@ finished. This is useful for event emitters or similar.
11031140
function middleware(_req, res, next) {
11041141
return Sentry.startSpanManual({ name: 'middleware' }, (span, finish) => {
11051142
res.once('finish', () => {
1106-
span?.setHttpStatus(res.status);
1143+
setHttpStatus(span, res.status);
11071144
finish();
11081145
});
11091146
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

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ convenient interface and improved consistency between various JavaScript environ
3232
- [Supported Platforms](#supported-platforms)
3333
- [Installation and Usage](#installation-and-usage)
3434
- [Other Packages](#other-packages)
35+
- [Bug Bounty Program](#bug-bounty-program)
3536

3637
## Supported Platforms
3738

@@ -104,3 +105,12 @@ below:
104105
utility functions useful for various SDKs.
105106
- [`@sentry/types`](https://github.com/getsentry/sentry-javascript/tree/master/packages/types): Types used in all
106107
packages.
108+
109+
## Bug Bounty Program
110+
111+
Our bug bounty program aims to improve the security of our open source projects by encouraging the community to identify and report potential security vulnerabilities. Your reward will depend on the severity of the identified vulnerability.
112+
113+
Our program is currently running on an invitation basis. If you're interested in participating, please send us an email to [email protected] and tell us, that you are interested in auditing this repository.
114+
115+
For more details, please have a look at https://sentry.io/security/#vulnerability-disclosure.
116+

biome.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@
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",
51-
"**/*.min.js"
52+
"**/*.min.js",
53+
".next/**",
54+
".svelte-kit/**"
5255
]
5356
},
5457
"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+
);
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+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
document.getElementById('go-background').addEventListener('click', () => {
2+
Object.defineProperty(document, 'hidden', { value: true, writable: true });
3+
const ev = document.createEvent('Event');
4+
ev.initEvent('visibilitychange');
5+
document.dispatchEvent(ev);
6+
});
7+
8+
document.getElementById('start-transaction').addEventListener('click', () => {
9+
window.transaction = Sentry.startTransaction({ name: 'test-transaction' });
10+
Sentry.getCurrentHub().configureScope(scope => scope.setSpan(window.transaction));
11+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
</head>
6+
<body>
7+
<button id="start-transaction">Start Transaction</button>
8+
<button id="go-background">New Tab</button>
9+
</body>
10+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import type { JSHandle } from '@playwright/test';
2+
import { expect } from '@playwright/test';
3+
import type { Event } from '@sentry/types';
4+
5+
import { sentryTest } from '../../../../utils/fixtures';
6+
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
7+
8+
async function getPropertyValue(handle: JSHandle, prop: string) {
9+
return (await handle.getProperty(prop))?.jsonValue();
10+
}
11+
12+
sentryTest('should finish a custom transaction when the page goes background', async ({ getLocalTestPath, page }) => {
13+
if (shouldSkipTracingTest()) {
14+
sentryTest.skip();
15+
}
16+
17+
const url = await getLocalTestPath({ testDir: __dirname });
18+
19+
const pageloadTransaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
20+
expect(pageloadTransaction).toBeDefined();
21+
22+
await page.locator('#start-transaction').click();
23+
const transactionHandle = await page.evaluateHandle('window.transaction');
24+
25+
const id_before = await getPropertyValue(transactionHandle, 'span_id');
26+
const name_before = await getPropertyValue(transactionHandle, 'name');
27+
const status_before = await getPropertyValue(transactionHandle, 'status');
28+
const tags_before = await getPropertyValue(transactionHandle, 'tags');
29+
30+
expect(name_before).toBe('test-transaction');
31+
expect(status_before).toBeUndefined();
32+
expect(tags_before).toStrictEqual({});
33+
34+
await page.locator('#go-background').click();
35+
36+
const id_after = await getPropertyValue(transactionHandle, 'span_id');
37+
const name_after = await getPropertyValue(transactionHandle, 'name');
38+
const status_after = await getPropertyValue(transactionHandle, 'status');
39+
const tags_after = await getPropertyValue(transactionHandle, 'tags');
40+
41+
expect(id_before).toBe(id_after);
42+
expect(name_after).toBe(name_before);
43+
expect(status_after).toBe('cancelled');
44+
expect(tags_after).toStrictEqual({ visibilitychange: 'document.hidden' });
45+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
document.getElementById('go-background').addEventListener('click', () => {
2+
setTimeout(() => {
3+
Object.defineProperty(document, 'hidden', { value: true, writable: true });
4+
const ev = document.createEvent('Event');
5+
ev.initEvent('visibilitychange');
6+
document.dispatchEvent(ev);
7+
}, 250);
8+
});
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 id="go-background">New Tab</button>
8+
</body>
9+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event } from '@sentry/types';
3+
4+
import { sentryTest } from '../../../../utils/fixtures';
5+
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
6+
7+
sentryTest('should finish pageload transaction when the page goes background', async ({ getLocalTestPath, page }) => {
8+
if (shouldSkipTracingTest()) {
9+
sentryTest.skip();
10+
}
11+
const url = await getLocalTestPath({ testDir: __dirname });
12+
13+
await page.goto(url);
14+
await page.locator('#go-background').click();
15+
16+
const pageloadTransaction = await getFirstSentryEnvelopeRequest<Event>(page);
17+
18+
expect(pageloadTransaction.contexts?.trace?.op).toBe('pageload');
19+
expect(pageloadTransaction.contexts?.trace?.status).toBe('cancelled');
20+
expect(pageloadTransaction.contexts?.trace?.tags).toMatchObject({
21+
visibilitychange: 'document.hidden',
22+
});
23+
});
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+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
integrations: [
8+
Sentry.browserTracingIntegration({
9+
idleTimeout: 1000,
10+
_experiments: {
11+
enableHTTPTimings: true,
12+
},
13+
}),
14+
],
15+
tracesSampleRate: 1,
16+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fetch('http://example.com/0').then(fetch('http://example.com/1').then(fetch('http://example.com/2')));

0 commit comments

Comments
 (0)