Skip to content

Commit

Permalink
Merge pull request #13619 from getsentry/prepare-release/8.29.0
Browse files Browse the repository at this point in the history
meta(changelog): Update changelog for 8.29.0
  • Loading branch information
andreiborza authored Sep 9, 2024
2 parents 7a4eb82 + d28a0e5 commit 75e898f
Show file tree
Hide file tree
Showing 84 changed files with 1,929 additions and 865 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,15 @@ jobs:
timeout-minutes: 5
run: pnpm test:assert

- name: Upload Playwright Traces
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-traces-job_e2e_playwright_tests-${{ matrix.test-application}}
path: dev-packages/e2e-tests/test-applications/${{ matrix.test-application}}/test-results
overwrite: true
retention-days: 7

job_optional_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test
# 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
Expand Down
37 changes: 37 additions & 0 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@ module.exports = [
gzip: true,
limit: '24 KB',
},
{
name: '@sentry/browser - with treeshaking flags',
path: 'packages/browser/build/npm/esm/index.js',
import: createImport('init'),
gzip: true,
limit: '24 KB',
modifyWebpackConfig: function (config) {
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');

config.plugins.push(
new webpack.DefinePlugin({
__SENTRY_DEBUG__: false,
__RRWEB_EXCLUDE_SHADOW_DOM__: true,
__RRWEB_EXCLUDE_IFRAME__: true,
__SENTRY_EXCLUDE_REPLAY_WORKER__: true,
}),
);

config.optimization.minimize = true;
config.optimization.minimizer = [new TerserPlugin()];

return config;
},
},
{
name: '@sentry/browser (incl. Tracing)',
path: 'packages/browser/build/npm/esm/index.js',
Expand All @@ -32,6 +57,8 @@ module.exports = [
limit: '68 KB',
modifyWebpackConfig: function (config) {
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');

config.plugins.push(
new webpack.DefinePlugin({
__SENTRY_DEBUG__: false,
Expand All @@ -40,6 +67,10 @@ module.exports = [
__SENTRY_EXCLUDE_REPLAY_WORKER__: true,
}),
);

config.optimization.minimize = true;
config.optimization.minimizer = [new TerserPlugin()];

return config;
},
},
Expand Down Expand Up @@ -222,11 +253,17 @@ module.exports = [
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
modifyWebpackConfig: function (config) {
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');

config.plugins.push(
new webpack.DefinePlugin({
__SENTRY_TRACING__: false,
}),
);

config.optimization.minimize = true;
config.optimization.minimizer = [new TerserPlugin()];

return config;
},
},
Expand Down
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,57 @@

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

## 8.29.0

### Important Changes

- **Beta releases of official Solid and SolidStart Sentry SDKs**

This release marks the beta releases of the `@sentry/solid` and `@sentry/solidstart` Sentry SDKs. For details on how to
use them, check out the
[Sentry Solid SDK README](https://github.com/getsentry/sentry-javascript/tree/develop/packages/solid) and the
[Sentry SolidStart SDK README](https://github.com/getsentry/sentry-javascript/tree/develop/packages/solidstart)
respectively. Please reach out on [GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have
any feedback or concerns.

- **feat(node): Option to only wrap instrumented modules (#13139)**

Adds the SDK option to only wrap ES modules with `import-in-the-middle` that specifically need to be instrumented.

```javascript
import * as Sentry from '@sentry/node';

Sentry.init({
dsn: '__PUBLIC_DSN__',
registerEsmLoaderHooks: { onlyHookedModules: true },
});
```

- **feat(node): Update OpenTelemetry packages to instrumentation v0.53.0 (#13587)**

All internal OpenTelemetry instrumentation was updated to their latest version. This adds support for Mongoose v7 and v8
and fixes various bugs related to ESM mode.

### Other Changes

- feat(nextjs): Emit warning when using turbopack (#13566)
- feat(nextjs): Future-proof Next.js config options overriding (#13586)
- feat(node): Add `generic-pool` integration (#13465)
- feat(nuxt): Upload sourcemaps generated by Nitro (#13382)
- feat(solidstart): Add `browserTracingIntegration` by default (#13561)
- feat(solidstart): Add `sentrySolidStartVite` plugin to simplify source maps upload (#13493)
- feat(vue): Only start UI spans if parent is available (#13568)
- fix(cloudflare): Guard `context.waitUntil` call in request handler (#13549)
- fix(gatsby): Fix assets path for sourcemaps upload (#13592)
- fix(nextjs): Use posix paths for sourcemap uploads (#13603)
- fix(node-fetch): Use stringified origin url (#13581)
- fix(node): Replace dashes in `generic-pool` span origins with underscores (#13579)
- fix(replay): Fix types in WebVitalData (#13573)
- fix(replay): Improve replay web vital types (#13602)
- fix(utils): Keep logger on carrier (#13570)

Work in this release was contributed by @Zen-cronic. Thank you for your contribution!

## 8.28.0

### Important Changes
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"babel-loader": "^8.2.2",
"html-webpack-plugin": "^5.5.0",
"pako": "^2.1.0",
"webpack": "^5.90.3"
"webpack": "^5.94.0"
},
"devDependencies": {
"@types/glob": "8.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as Sentry from '@sentry/browser';
// Import this separately so that generatePlugin can handle it for CDN scenarios
import { feedbackIntegration } from '@sentry/browser';

const feedback = feedbackIntegration({
autoInject: false,
});

window.Sentry = Sentry;
window.feedback = feedback;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [feedback],
});

feedback.attachTo('#custom-feedback-buttom');
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<button type="button" id="custom-feedback-buttom">Show feedback!</button>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import { expect } from '@playwright/test';

import { TEST_HOST, sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser, getEnvelopeType, shouldSkipFeedbackTest } from '../../../utils/helpers';

sentryTest('should capture feedback with custom button', async ({ getLocalTestUrl, page }) => {
if (shouldSkipFeedbackTest()) {
sentryTest.skip();
}

const feedbackRequestPromise = page.waitForResponse(res => {
const req = res.request();

const postData = req.postData();
if (!postData) {
return false;
}

try {
return getEnvelopeType(req) === 'feedback';
} catch (err) {
return false;
}
});

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });

await page.goto(url);
await page.locator('#custom-feedback-buttom').click();
await page.waitForSelector(':visible:text-is("Report a Bug")');

expect(await page.locator(':visible:text-is("Report a Bug")').count()).toEqual(1);
await page.locator('[name="name"]').fill('Jane Doe');
await page.locator('[name="email"]').fill('[email protected]');
await page.locator('[name="message"]').fill('my example feedback');
await page.locator('[data-sentry-feedback] .btn--primary').click();

const feedbackEvent = envelopeRequestParser((await feedbackRequestPromise).request());
expect(feedbackEvent).toEqual({
type: 'feedback',
breadcrumbs: expect.any(Array),
contexts: {
feedback: {
contact_email: '[email protected]',
message: 'my example feedback',
name: 'Jane Doe',
source: 'widget',
url: `${TEST_HOST}/index.html`,
},
trace: {
trace_id: expect.stringMatching(/\w{32}/),
span_id: expect.stringMatching(/\w{16}/),
},
},
level: 'info',
timestamp: expect.any(Number),
event_id: expect.stringMatching(/\w{32}/),
environment: 'production',
tags: {},
sdk: {
integrations: expect.arrayContaining(['Feedback']),
version: expect.any(String),
name: 'sentry.javascript.browser',
packages: expect.anything(),
},
request: {
url: `${TEST_HOST}/index.html`,
headers: {
'User-Agent': expect.stringContaining(''),
},
},
platform: 'javascript',
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Sentry from '@sentry/browser';
// Import this separately so that generatePlugin can handle it for CDN scenarios
import { feedbackIntegration } from '@sentry/browser';

const feedback = feedbackIntegration({
autoInject: false,
});

window.Sentry = Sentry;
window.feedback = feedback;

Sentry.init({
dsn: 'https://[email protected]/1337',
debug: true,
integrations: [feedback],
});

// This should log an error!
feedback.attachTo('#does-not-exist');
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../utils/fixtures';
import { shouldSkipFeedbackTest } from '../../../utils/helpers';

/**
* This test is mostly relevant for ensuring that the logger works in all combinations of CDN bundles.
* Even if feedback is included via the CDN, this test ensures that the logger is working correctly.
*/
sentryTest('should log error correctly', async ({ getLocalTestUrl, page }) => {
// In minified bundles we do not have logger messages, so we skip the test
if (shouldSkipFeedbackTest() || (process.env.PW_BUNDLE || '').includes('_min')) {
sentryTest.skip();
}

const messages: string[] = [];

page.on('console', message => {
messages.push(message.text());
});

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

const url = await getLocalTestUrl({ testDir: __dirname });

await page.goto(url);

expect(messages).toContain('Sentry Logger [log]: Integration installed: Feedback');
expect(messages).toContain('Sentry Logger [error]: [Feedback] Unable to attach to target element');
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

const integrations = Sentry.getDefaultIntegrations({}).filter(
defaultIntegration => defaultIntegration.name === 'HttpContext',
);

const client = new Sentry.BrowserClient({
dsn: 'https://[email protected]/1337',
transport: Sentry.makeFetchTransport,
stackParser: Sentry.defaultStackParser,
integrations: integrations,
});

const scope = new Sentry.Scope();
scope.setClient(client);
client.init();

window._sentryScope = scope;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
window._sentryScope.captureException(new Error('client init'));
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

import { sentryTest } from '../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers';

sentryTest('httpContextIntegration captures user-agent and referrer', async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });

const errorEventPromise = getFirstSentryEnvelopeRequest<Event>(page);

// Simulate document.referrer being set to test full functionality of the integration
await page.goto(url, { referer: 'https://sentry.io/' });

const errorEvent = await errorEventPromise;

expect(errorEvent.exception?.values).toHaveLength(1);

expect(errorEvent.request).toEqual({
headers: {
'User-Agent': expect.any(String),
Referer: 'https://sentry.io/',
},
url: expect.any(String),
});
});

This file was deleted.

This file was deleted.

Loading

0 comments on commit 75e898f

Please sign in to comment.