Skip to content

Commit 75e898f

Browse files
authored
Merge pull request #13619 from getsentry/prepare-release/8.29.0
meta(changelog): Update changelog for 8.29.0
2 parents 7a4eb82 + d28a0e5 commit 75e898f

File tree

84 files changed

+1929
-865
lines changed

Some content is hidden

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

84 files changed

+1929
-865
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,15 @@ jobs:
10041004
timeout-minutes: 5
10051005
run: pnpm test:assert
10061006

1007+
- name: Upload Playwright Traces
1008+
uses: actions/upload-artifact@v4
1009+
if: failure()
1010+
with:
1011+
name: playwright-traces-job_e2e_playwright_tests-${{ matrix.test-application}}
1012+
path: dev-packages/e2e-tests/test-applications/${{ matrix.test-application}}/test-results
1013+
overwrite: true
1014+
retention-days: 7
1015+
10071016
job_optional_e2e_tests:
10081017
name: E2E ${{ matrix.label || matrix.test-application }} Test
10091018
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks

.size-limit.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,31 @@ module.exports = [
1010
gzip: true,
1111
limit: '24 KB',
1212
},
13+
{
14+
name: '@sentry/browser - with treeshaking flags',
15+
path: 'packages/browser/build/npm/esm/index.js',
16+
import: createImport('init'),
17+
gzip: true,
18+
limit: '24 KB',
19+
modifyWebpackConfig: function (config) {
20+
const webpack = require('webpack');
21+
const TerserPlugin = require('terser-webpack-plugin');
22+
23+
config.plugins.push(
24+
new webpack.DefinePlugin({
25+
__SENTRY_DEBUG__: false,
26+
__RRWEB_EXCLUDE_SHADOW_DOM__: true,
27+
__RRWEB_EXCLUDE_IFRAME__: true,
28+
__SENTRY_EXCLUDE_REPLAY_WORKER__: true,
29+
}),
30+
);
31+
32+
config.optimization.minimize = true;
33+
config.optimization.minimizer = [new TerserPlugin()];
34+
35+
return config;
36+
},
37+
},
1338
{
1439
name: '@sentry/browser (incl. Tracing)',
1540
path: 'packages/browser/build/npm/esm/index.js',
@@ -32,6 +57,8 @@ module.exports = [
3257
limit: '68 KB',
3358
modifyWebpackConfig: function (config) {
3459
const webpack = require('webpack');
60+
const TerserPlugin = require('terser-webpack-plugin');
61+
3562
config.plugins.push(
3663
new webpack.DefinePlugin({
3764
__SENTRY_DEBUG__: false,
@@ -40,6 +67,10 @@ module.exports = [
4067
__SENTRY_EXCLUDE_REPLAY_WORKER__: true,
4168
}),
4269
);
70+
71+
config.optimization.minimize = true;
72+
config.optimization.minimizer = [new TerserPlugin()];
73+
4374
return config;
4475
},
4576
},
@@ -222,11 +253,17 @@ module.exports = [
222253
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
223254
modifyWebpackConfig: function (config) {
224255
const webpack = require('webpack');
256+
const TerserPlugin = require('terser-webpack-plugin');
257+
225258
config.plugins.push(
226259
new webpack.DefinePlugin({
227260
__SENTRY_TRACING__: false,
228261
}),
229262
);
263+
264+
config.optimization.minimize = true;
265+
config.optimization.minimizer = [new TerserPlugin()];
266+
230267
return config;
231268
},
232269
},

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,57 @@
1010

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

13+
## 8.29.0
14+
15+
### Important Changes
16+
17+
- **Beta releases of official Solid and SolidStart Sentry SDKs**
18+
19+
This release marks the beta releases of the `@sentry/solid` and `@sentry/solidstart` Sentry SDKs. For details on how to
20+
use them, check out the
21+
[Sentry Solid SDK README](https://github.com/getsentry/sentry-javascript/tree/develop/packages/solid) and the
22+
[Sentry SolidStart SDK README](https://github.com/getsentry/sentry-javascript/tree/develop/packages/solidstart)
23+
respectively. Please reach out on [GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have
24+
any feedback or concerns.
25+
26+
- **feat(node): Option to only wrap instrumented modules (#13139)**
27+
28+
Adds the SDK option to only wrap ES modules with `import-in-the-middle` that specifically need to be instrumented.
29+
30+
```javascript
31+
import * as Sentry from '@sentry/node';
32+
33+
Sentry.init({
34+
dsn: '__PUBLIC_DSN__',
35+
registerEsmLoaderHooks: { onlyHookedModules: true },
36+
});
37+
```
38+
39+
- **feat(node): Update OpenTelemetry packages to instrumentation v0.53.0 (#13587)**
40+
41+
All internal OpenTelemetry instrumentation was updated to their latest version. This adds support for Mongoose v7 and v8
42+
and fixes various bugs related to ESM mode.
43+
44+
### Other Changes
45+
46+
- feat(nextjs): Emit warning when using turbopack (#13566)
47+
- feat(nextjs): Future-proof Next.js config options overriding (#13586)
48+
- feat(node): Add `generic-pool` integration (#13465)
49+
- feat(nuxt): Upload sourcemaps generated by Nitro (#13382)
50+
- feat(solidstart): Add `browserTracingIntegration` by default (#13561)
51+
- feat(solidstart): Add `sentrySolidStartVite` plugin to simplify source maps upload (#13493)
52+
- feat(vue): Only start UI spans if parent is available (#13568)
53+
- fix(cloudflare): Guard `context.waitUntil` call in request handler (#13549)
54+
- fix(gatsby): Fix assets path for sourcemaps upload (#13592)
55+
- fix(nextjs): Use posix paths for sourcemap uploads (#13603)
56+
- fix(node-fetch): Use stringified origin url (#13581)
57+
- fix(node): Replace dashes in `generic-pool` span origins with underscores (#13579)
58+
- fix(replay): Fix types in WebVitalData (#13573)
59+
- fix(replay): Improve replay web vital types (#13602)
60+
- fix(utils): Keep logger on carrier (#13570)
61+
62+
Work in this release was contributed by @Zen-cronic. Thank you for your contribution!
63+
1364
## 8.28.0
1465

1566
### Important Changes

dev-packages/browser-integration-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"babel-loader": "^8.2.2",
4949
"html-webpack-plugin": "^5.5.0",
5050
"pako": "^2.1.0",
51-
"webpack": "^5.90.3"
51+
"webpack": "^5.94.0"
5252
},
5353
"devDependencies": {
5454
"@types/glob": "8.0.0",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import * as Sentry from '@sentry/browser';
2+
// Import this separately so that generatePlugin can handle it for CDN scenarios
3+
import { feedbackIntegration } from '@sentry/browser';
4+
5+
const feedback = feedbackIntegration({
6+
autoInject: false,
7+
});
8+
9+
window.Sentry = Sentry;
10+
window.feedback = feedback;
11+
12+
Sentry.init({
13+
dsn: 'https://[email protected]/1337',
14+
integrations: [feedback],
15+
});
16+
17+
feedback.attachTo('#custom-feedback-buttom');
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 type="button" id="custom-feedback-buttom">Show feedback!</button>
8+
</body>
9+
</html>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { TEST_HOST, sentryTest } from '../../../utils/fixtures';
4+
import { envelopeRequestParser, getEnvelopeType, shouldSkipFeedbackTest } from '../../../utils/helpers';
5+
6+
sentryTest('should capture feedback with custom button', async ({ getLocalTestUrl, page }) => {
7+
if (shouldSkipFeedbackTest()) {
8+
sentryTest.skip();
9+
}
10+
11+
const feedbackRequestPromise = page.waitForResponse(res => {
12+
const req = res.request();
13+
14+
const postData = req.postData();
15+
if (!postData) {
16+
return false;
17+
}
18+
19+
try {
20+
return getEnvelopeType(req) === 'feedback';
21+
} catch (err) {
22+
return false;
23+
}
24+
});
25+
26+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
27+
return route.fulfill({
28+
status: 200,
29+
contentType: 'application/json',
30+
body: JSON.stringify({ id: 'test-id' }),
31+
});
32+
});
33+
34+
const url = await getLocalTestUrl({ testDir: __dirname });
35+
36+
await page.goto(url);
37+
await page.locator('#custom-feedback-buttom').click();
38+
await page.waitForSelector(':visible:text-is("Report a Bug")');
39+
40+
expect(await page.locator(':visible:text-is("Report a Bug")').count()).toEqual(1);
41+
await page.locator('[name="name"]').fill('Jane Doe');
42+
await page.locator('[name="email"]').fill('[email protected]');
43+
await page.locator('[name="message"]').fill('my example feedback');
44+
await page.locator('[data-sentry-feedback] .btn--primary').click();
45+
46+
const feedbackEvent = envelopeRequestParser((await feedbackRequestPromise).request());
47+
expect(feedbackEvent).toEqual({
48+
type: 'feedback',
49+
breadcrumbs: expect.any(Array),
50+
contexts: {
51+
feedback: {
52+
contact_email: '[email protected]',
53+
message: 'my example feedback',
54+
name: 'Jane Doe',
55+
source: 'widget',
56+
url: `${TEST_HOST}/index.html`,
57+
},
58+
trace: {
59+
trace_id: expect.stringMatching(/\w{32}/),
60+
span_id: expect.stringMatching(/\w{16}/),
61+
},
62+
},
63+
level: 'info',
64+
timestamp: expect.any(Number),
65+
event_id: expect.stringMatching(/\w{32}/),
66+
environment: 'production',
67+
tags: {},
68+
sdk: {
69+
integrations: expect.arrayContaining(['Feedback']),
70+
version: expect.any(String),
71+
name: 'sentry.javascript.browser',
72+
packages: expect.anything(),
73+
},
74+
request: {
75+
url: `${TEST_HOST}/index.html`,
76+
headers: {
77+
'User-Agent': expect.stringContaining(''),
78+
},
79+
},
80+
platform: 'javascript',
81+
});
82+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import * as Sentry from '@sentry/browser';
2+
// Import this separately so that generatePlugin can handle it for CDN scenarios
3+
import { feedbackIntegration } from '@sentry/browser';
4+
5+
const feedback = feedbackIntegration({
6+
autoInject: false,
7+
});
8+
9+
window.Sentry = Sentry;
10+
window.feedback = feedback;
11+
12+
Sentry.init({
13+
dsn: 'https://[email protected]/1337',
14+
debug: true,
15+
integrations: [feedback],
16+
});
17+
18+
// This should log an error!
19+
feedback.attachTo('#does-not-exist');
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { sentryTest } from '../../../utils/fixtures';
4+
import { shouldSkipFeedbackTest } from '../../../utils/helpers';
5+
6+
/**
7+
* This test is mostly relevant for ensuring that the logger works in all combinations of CDN bundles.
8+
* Even if feedback is included via the CDN, this test ensures that the logger is working correctly.
9+
*/
10+
sentryTest('should log error correctly', async ({ getLocalTestUrl, page }) => {
11+
// In minified bundles we do not have logger messages, so we skip the test
12+
if (shouldSkipFeedbackTest() || (process.env.PW_BUNDLE || '').includes('_min')) {
13+
sentryTest.skip();
14+
}
15+
16+
const messages: string[] = [];
17+
18+
page.on('console', message => {
19+
messages.push(message.text());
20+
});
21+
22+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
23+
return route.fulfill({
24+
status: 200,
25+
contentType: 'application/json',
26+
body: JSON.stringify({ id: 'test-id' }),
27+
});
28+
});
29+
30+
const url = await getLocalTestUrl({ testDir: __dirname });
31+
32+
await page.goto(url);
33+
34+
expect(messages).toContain('Sentry Logger [log]: Integration installed: Feedback');
35+
expect(messages).toContain('Sentry Logger [error]: [Feedback] Unable to attach to target element');
36+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
const integrations = Sentry.getDefaultIntegrations({}).filter(
6+
defaultIntegration => defaultIntegration.name === 'HttpContext',
7+
);
8+
9+
const client = new Sentry.BrowserClient({
10+
dsn: 'https://[email protected]/1337',
11+
transport: Sentry.makeFetchTransport,
12+
stackParser: Sentry.defaultStackParser,
13+
integrations: integrations,
14+
});
15+
16+
const scope = new Sentry.Scope();
17+
scope.setClient(client);
18+
client.init();
19+
20+
window._sentryScope = scope;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
window._sentryScope.captureException(new Error('client init'));
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event } from '@sentry/types';
3+
4+
import { sentryTest } from '../../../utils/fixtures';
5+
import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers';
6+
7+
sentryTest('httpContextIntegration captures user-agent and referrer', async ({ getLocalTestPath, page }) => {
8+
const url = await getLocalTestPath({ testDir: __dirname });
9+
10+
const errorEventPromise = getFirstSentryEnvelopeRequest<Event>(page);
11+
12+
// Simulate document.referrer being set to test full functionality of the integration
13+
await page.goto(url, { referer: 'https://sentry.io/' });
14+
15+
const errorEvent = await errorEventPromise;
16+
17+
expect(errorEvent.exception?.values).toHaveLength(1);
18+
19+
expect(errorEvent.request).toEqual({
20+
headers: {
21+
'User-Agent': expect.any(String),
22+
Referer: 'https://sentry.io/',
23+
},
24+
url: expect.any(String),
25+
});
26+
});

dev-packages/browser-integration-tests/suites/integrations/httpclient/httpClientIntegration/init.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/integrations/httpclient/httpClientIntegration/subject.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)