Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta: Update CHANGELOG for 7.77.0 #9417

Merged
merged 16 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = [
__RRWEB_EXCLUDE_CANVAS__: true,
__RRWEB_EXCLUDE_SHADOW_DOM__: true,
__RRWEB_EXCLUDE_IFRAME__: true,
__SENTRY_EXCLUDE_REPLAY_WORKER__: true,
}),
);
return config;
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

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

## 7.77.0

- feat: Move LinkedErrors integration to @sentry/core (#9404)
- feat(remix): Update sentry-cli version to ^2.21.2 (#9401)
- feat(replay): Allow to treeshake & configure compression worker URL (#9409)
- fix(angular-ivy): Adjust package entry points to support Angular 17 with SSR config (#9412)
- fix(feedback): Fixing feedback import (#9403)
- fix(nextjs): Match only numbers as orgid in tunnelRoute (#9416)
- fix(nextjs): Strictly validate tunnel target parameters (#9415)
- fix(utils): Avoid keeping a reference of last used event (#9387)

## 7.76.0

### Important Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/angular-ivy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"build:watch": "yarn build:syncSymlinks && yarn build:transpile:watch",
"build:dev:watch": "yarn build:watch",
"build:transpile:watch": "ng build --watch",
"build:tarball": "npm pack ./build",
"build:tarball": "ts-node ./scripts/prepack.ts && npm pack ./build",
"build:syncSymlinks": "ts-node ./scripts/syncSourceFiles.ts",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf build coverage sentry-angular-ivy-*.tgz",
Expand All @@ -56,7 +56,7 @@
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"yalc:publish": "yalc publish build --push --sig"
"yalc:publish": "ts-node ./scripts/prepack.ts && yalc publish build --push --sig"
},
"volta": {
"extends": "../../package.json"
Expand Down
27 changes: 27 additions & 0 deletions packages/angular-ivy/scripts/prepack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as fs from 'fs';
import * as path from 'path';

type PackageJson = {
main?: string;
type?: string;
nx?: string;
volta?: any;
};

const buildDir = path.join(process.cwd(), 'build');
const pkjJsonPath = path.join(buildDir, 'package.json');
const pkgJson: PackageJson = JSON.parse(fs.readFileSync(pkjJsonPath).toString());

// This is necessary for Angular 17+ compatibility when SSR is configured which switches dev mode to using Vite.
// Deleting "main" and adding "type": "module" will direct Vite to
// use the fesm2015 bundle instead of the UMD bundle.
delete pkgJson.main;
pkgJson.type = 'module';

// no need to keep around other properties that are only relevant for our reop:
delete pkgJson.nx;
delete pkgJson.volta;

fs.writeFileSync(pkjJsonPath, JSON.stringify(pkgJson, null, 2));

console.log('Adjusted package.json for Angular 17+ compatibility.');
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<button id="button1" type="button">Button 1</button>
<button id="button2" type="button">Button 2</button>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

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

sentryTest('captures Breadcrumb for clicks & debounces them for a second', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });

await page.route('**/foo', route => {
return route.fulfill({
status: 200,
body: JSON.stringify({
userNames: ['John', 'Jane'],
}),
headers: {
'Content-Type': 'application/json',
},
});
});

const promise = getFirstSentryEnvelopeRequest<Event>(page);

await page.goto(url);

await page.click('#button1');
// not debounced because other target
await page.click('#button2');
// This should be debounced
await page.click('#button2');

// Wait a second for the debounce to finish
await page.waitForTimeout(1000);
await page.click('#button2');

await page.evaluate('Sentry.captureException("test exception")');

const eventData = await promise;

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

expect(eventData.breadcrumbs).toEqual([
{
timestamp: expect.any(Number),
category: 'ui.click',
message: 'body > button#button1[type="button"]',
},
{
timestamp: expect.any(Number),
category: 'ui.click',
message: 'body > button#button2[type="button"]',
},
{
timestamp: expect.any(Number),
category: 'ui.click',
message: 'body > button#button2[type="button"]',
},
]);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
defaultIntegrations: false,
integrations: [new Sentry.Integrations.Breadcrumbs()],
sampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<input id="input1" type="text" />
<input id="input2" type="text" />
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

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

sentryTest('captures Breadcrumb for events on inputs & debounced them', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });

await page.route('**/foo', route => {
return route.fulfill({
status: 200,
body: JSON.stringify({
userNames: ['John', 'Jane'],
}),
headers: {
'Content-Type': 'application/json',
},
});
});

const promise = getFirstSentryEnvelopeRequest<Event>(page);

await page.goto(url);

await page.click('#input1');
// Not debounced because other event type
await page.type('#input1', 'John', { delay: 1 });
// This should be debounced
await page.type('#input1', 'Abby', { delay: 1 });
// not debounced because other target
await page.type('#input2', 'Anne', { delay: 1 });

// Wait a second for the debounce to finish
await page.waitForTimeout(1000);
await page.type('#input2', 'John', { delay: 1 });

await page.evaluate('Sentry.captureException("test exception")');

const eventData = await promise;

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

expect(eventData.breadcrumbs).toEqual([
{
timestamp: expect.any(Number),
category: 'ui.click',
message: 'body > input#input1[type="text"]',
},
{
timestamp: expect.any(Number),
category: 'ui.input',
message: 'body > input#input1[type="text"]',
},
{
timestamp: expect.any(Number),
category: 'ui.input',
message: 'body > input#input2[type="text"]',
},
{
timestamp: expect.any(Number),
category: 'ui.input',
message: 'body > input#input2[type="text"]',
},
]);
});

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import { getExpectedReplayEvent } from '../../../utils/replayEventTemplates';
import {
getFullRecordingSnapshots,
getReplayEvent,
replayEnvelopeIsCompressed,
shouldSkipReplayTest,
waitForReplayRequest,
} from '../../../utils/replayHelpers';

sentryTest('replay recording should be compressed by default', async ({ getLocalTestPath, page }) => {
sentryTest('replay recording should be compressed by default', async ({ getLocalTestPath, page, forceFlushReplay }) => {
if (shouldSkipReplayTest()) {
sentryTest.skip();
}
Expand All @@ -27,10 +28,16 @@ sentryTest('replay recording should be compressed by default', async ({ getLocal
const url = await getLocalTestPath({ testDir: __dirname });

await page.goto(url);
const replayEvent0 = getReplayEvent(await reqPromise0);
await forceFlushReplay();

const req0 = await reqPromise0;

const replayEvent0 = getReplayEvent(req0);
expect(replayEvent0).toEqual(getExpectedReplayEvent());

const snapshots = getFullRecordingSnapshots(await reqPromise0);
expect(replayEnvelopeIsCompressed(req0)).toEqual(true);

const snapshots = getFullRecordingSnapshots(req0);
expect(snapshots.length).toEqual(1);

const stringifiedSnapshot = JSON.stringify(snapshots[0]);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
useCompression: false,
});

Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
sampleRate: 0,
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 0.0,

integrations: [window.Replay],
});
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 id="go-background">New Tab</button>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../utils/fixtures';
import { getExpectedReplayEvent } from '../../../utils/replayEventTemplates';
import {
getFullRecordingSnapshots,
getReplayEvent,
replayEnvelopeIsCompressed,
shouldSkipReplayTest,
waitForReplayRequest,
} from '../../../utils/replayHelpers';

sentryTest(
'replay recording should allow to disable compression',
async ({ getLocalTestPath, page, forceFlushReplay }) => {
if (shouldSkipReplayTest()) {
sentryTest.skip();
}

const reqPromise0 = waitForReplayRequest(page, 0);

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 getLocalTestPath({ testDir: __dirname });

await page.goto(url);
await forceFlushReplay();

const req0 = await reqPromise0;

const replayEvent0 = getReplayEvent(req0);
expect(replayEvent0).toEqual(getExpectedReplayEvent());

expect(replayEnvelopeIsCompressed(req0)).toEqual(false);

const snapshots = getFullRecordingSnapshots(req0);
expect(snapshots.length).toEqual(1);

const stringifiedSnapshot = JSON.stringify(snapshots[0]);
expect(stringifiedSnapshot).toContain('"tagName":"body"');
expect(stringifiedSnapshot).toContain('"tagName":"html"');
expect(stringifiedSnapshot).toContain('"tagName":"button"');
expect(stringifiedSnapshot).toContain('"textContent":"*** ***"');
expect(stringifiedSnapshot).toContain('"id":"go-background"');
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
useCompression: true,
workerUrl: `${window.location.origin}/my-test-worker.js`,
});

Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
sampleRate: 0,
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 0.0,

integrations: [window.Replay],
});
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 id="go-background">New Tab</button>
</body>
</html>
Loading