Skip to content

Commit e775104

Browse files
authored
Merge pull request #8042 from getsentry/prepare-release/7.51.0
meta(changelog): Update CHANGELOG for 7.51.0
2 parents 99c7a34 + ba9e198 commit e775104

File tree

128 files changed

+2029
-29917
lines changed

Some content is hidden

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

128 files changed

+2029
-29917
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193
steps:
194194
- name: PR is opened against master
195195
uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1
196-
if: ${{ github.base_ref == 'master' && !startsWith(github.ref, 'refs/heads/prepare-release/') }}
196+
if: ${{ github.base_ref == 'master' && !startsWith(github.head_ref, 'prepare-release/') }}
197197
with:
198198
message: |
199199
⚠️ This PR is opened against **master**. You probably want to open it against **develop**.
@@ -770,7 +770,7 @@ jobs:
770770
ref: ${{ env.HEAD_COMMIT }}
771771
- uses: pnpm/action-setup@v2
772772
with:
773-
version: 7
773+
version: 8.3.1
774774
- name: Set up Node
775775
uses: actions/setup-node@v3
776776
with:

.github/workflows/canary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
ref: ${{ env.HEAD_COMMIT }}
2929
- uses: pnpm/action-setup@v2
3030
with:
31-
version: 7
31+
version: 8.3.1
3232
- name: Set up Node
3333
uses: actions/setup-node@v3
3434
with:

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
*.md
22
.nxcache
3-
packages/browser-integration-tests/fixtures

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,70 @@
44

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

7+
## 7.51.0
8+
9+
### Important Changes
10+
11+
- **feat(sveltekit): Auto-wrap `load` functions with proxy module (#7994)**
12+
13+
`@sentry/sveltekit` now auto-wraps `load` functions in
14+
15+
* `+(page|layout).(ts|js)` files (universal loads)
16+
* `+(page|layout).server.(ts|js)` files (server-only loads)
17+
18+
This means that you don't have to manually add the `wrapLoadWithSentry` and `wrapServerLoadWithSentry` functions around your load functions. The SDK will not interfere with already wrapped `load` functions.
19+
20+
For more details, take a look at the [Readme](https://github.com/getsentry/sentry-javascript/blob/develop/packages/sveltekit/README.md#configure-auto-instrumentation)
21+
22+
- **chore(angular): Upgrade `peerDependencies` to Angular 16 (#8035)**
23+
24+
We now officially support Angular 16 in `@sentry/angular-ivy`.
25+
Note that `@sentry/angular` _does not_ support Angular 16.
26+
27+
- **feat(node): Add ability to send cron monitor check ins (#8039)**
28+
29+
This release adds [Sentry cron monitoring](https://docs.sentry.io/product/crons/) support to the Node SDK.
30+
31+
To monitor your cron jobs, send check-ins everytime you execute your cron jobs to Sentry. You can do this with the `captureCheckIn` method exported from the SDK. First you must send an `in_progress`, checkin, then you can send one with status `ok` or `error` based on what happened with your cron job.
32+
33+
```ts
34+
const Sentry = require('@sentry/node');
35+
36+
// ...
37+
38+
Sentry.captureCheckIn({
39+
// make sure this is the same slug as what you set up your
40+
// Sentry cron monitor with.
41+
monitorSlug: 'dailyEmail',
42+
status: 'in_progress',
43+
});
44+
45+
const startTime = timeInSeconds();
46+
47+
runTask();
48+
49+
Sentry.captureCheckIn({
50+
monitorSlug: 'dailyEmail',
51+
status: 'ok',
52+
duration: timeInSeconds() - startTime,
53+
});
54+
```
55+
56+
### Additional Features and Fixes
57+
58+
- feat(browser): Export makeMultiplexedTransport from browser SDK (#8012)
59+
- feat(node): Add `http.method` to node http spans (#7991)
60+
- feat(tracing): add body size for fetch requests (#7935)
61+
- feat(tracing): Use http.method for span data (#7990)
62+
- fix(integrations): Handle windows paths with no prefix or backslash prefix in `RewriteFrames` (#7995)
63+
- fix(node): Mark stack frames with url protocol as in-app frames (#8008)
64+
- fix(remix): Export `Integration` type declaration as union type (#8016)
65+
- fix(replay): Do not add replay_id to DSC while buffering (#8020)
66+
- fix(tracing): Don't set method multiple times (#8014)
67+
- fix(utils): Normalize `undefined` to `undefined` instead of `"[undefined]"` (#8017)
68+
69+
Work in this release contributed by @srubin and @arjenbrandenburgh. Thank you for your contributions!
70+
771
## 7.50.0
872

973
### Important Changes

packages/angular-ivy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
## Angular Version Compatibility
1818

19-
This SDK officially supports Angular 12-15 with Angular's new rendering engine, Ivy.
19+
This SDK officially supports Angular 12 to 16 with Angular's new rendering engine, Ivy.
2020

2121
If you're using Angular 10, 11 or a newer Angular version with View Engine instead of Ivy, please use [`@sentry/angular`](https://github.com/getsentry/sentry-javascript/blob/develop/packages/angular/README.md).
2222

packages/angular-ivy/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"access": "public"
1616
},
1717
"peerDependencies": {
18-
"@angular/common": ">= 12.x <= 15.x",
19-
"@angular/core": ">= 12.x <= 15.x",
20-
"@angular/router": ">= 12.x <= 15.x",
18+
"@angular/common": ">= 12.x <= 16.x",
19+
"@angular/core": ">= 12.x <= 16.x",
20+
"@angular/router": ">= 12.x <= 16.x",
2121
"rxjs": "^6.5.5 || ^7.x"
2222
},
2323
"dependencies": {

packages/angular/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717

1818
## Angular Version Compatibility
1919

20-
The latest version of this SDK officially supports Angular 10-13. If you are using an older version of Angular and experience problems with the Angular SDK, we recommend downgrading the SDK to version 6.x.
20+
**Important**: This package is not compatible with Angular 16 or newer. Please use [`@sentry/angular-ivy`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy) instead.
21+
22+
If you're using Angular 12 or newer, we recommend using `@sentry/angular-ivy` for native support with Angular's rendering engine Ivy.
23+
24+
This SDK stilll officially supports Angular 10-15. If you are using an older version of Angular and experience problems with the Angular SDK, we recommend downgrading the SDK to version 6.x.
2125

2226
## General
2327

packages/browser-integration-tests/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = {
1111
'loader-suites/**/subject.js',
1212
'scripts/**',
1313
'fixtures/**',
14+
'tmp/**',
1415
],
1516
parserOptions: {
1617
sourceType: 'module',
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
test-results
2+
tmp
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tmp
2+
fixtures

packages/browser-integration-tests/fixtures/loader.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
setTimeout(() => {
2+
const cdnScript = document.createElement('script');
3+
cdnScript.src = '/cdn.bundle.js';
4+
5+
cdnScript.addEventListener('load', () => {
6+
window.Sentry.init({
7+
dsn: 'https://[email protected]/1337',
8+
replaysSessionSampleRate: 0.42,
9+
});
10+
11+
setTimeout(() => {
12+
window.doSomethingWrong();
13+
}, 500);
14+
});
15+
16+
document.head.appendChild(cdnScript);
17+
}, 100);
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import { expect } from '@playwright/test';
2+
import fs from 'fs';
3+
import path from 'path';
4+
5+
import { sentryTest, TEST_HOST } from '../../../../utils/fixtures';
6+
import { LOADER_CONFIGS } from '../../../../utils/generatePlugin';
7+
import { envelopeRequestParser, waitForErrorRequest } from '../../../../utils/helpers';
8+
9+
const bundle = process.env.PW_BUNDLE || '';
10+
const isLazy = LOADER_CONFIGS[bundle]?.lazy;
11+
12+
sentryTest('it does not download the SDK if the SDK was loaded in the meanwhile', async ({ getLocalTestUrl, page }) => {
13+
// When the loader is eager, this does not work and makes no sense
14+
if (isLazy !== true) {
15+
sentryTest.skip();
16+
}
17+
18+
let cdnLoadedCount = 0;
19+
let sentryEventCount = 0;
20+
21+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
22+
sentryEventCount++;
23+
24+
return route.fulfill({
25+
status: 200,
26+
contentType: 'application/json',
27+
body: JSON.stringify({ id: 'test-id' }),
28+
});
29+
});
30+
31+
await page.route(`${TEST_HOST}/*.*`, route => {
32+
const file = route.request().url().split('/').pop();
33+
34+
if (file === 'cdn.bundle.js') {
35+
cdnLoadedCount++;
36+
}
37+
38+
const filePath = path.resolve(__dirname, `./dist/${file}`);
39+
40+
return fs.existsSync(filePath) ? route.fulfill({ path: filePath }) : route.continue();
41+
});
42+
43+
const req = waitForErrorRequest(page);
44+
45+
const url = await getLocalTestUrl({ testDir: __dirname, skipRouteHandler: true });
46+
47+
await page.goto(url);
48+
49+
const eventData = envelopeRequestParser(await req);
50+
51+
await waitForFunction(() => cdnLoadedCount === 2);
52+
53+
// Still loaded the CDN bundle twice
54+
expect(cdnLoadedCount).toBe(2);
55+
56+
// But only sent to Sentry once
57+
expect(sentryEventCount).toBe(1);
58+
59+
// Ensure loader does not overwrite init/config
60+
const options = await page.evaluate(() => (window as any).Sentry.getCurrentHub().getClient()?.getOptions());
61+
expect(options?.replaysSessionSampleRate).toBe(0.42);
62+
63+
expect(eventData.exception?.values?.length).toBe(1);
64+
expect(eventData.exception?.values?.[0]?.value).toBe('window.doSomethingWrong is not a function');
65+
});
66+
67+
async function waitForFunction(cb: () => boolean, timeout = 2000, increment = 100) {
68+
while (timeout > 0 && !cb()) {
69+
await new Promise(resolve => setTimeout(resolve, increment));
70+
await waitForFunction(cb, timeout - increment, increment);
71+
}
72+
}

packages/browser-integration-tests/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"private": true,
1010
"scripts": {
11-
"clean": "rimraf -g suites/**/dist loader-suites/**/dist",
11+
"clean": "rimraf -g suites/**/dist loader-suites/**/dist tmp",
1212
"install-browsers": "playwright install --with-deps",
1313
"lint": "run-s lint:prettier lint:eslint",
1414
"lint:eslint": "eslint . --format stylish",
@@ -58,6 +58,7 @@
5858
},
5959
"devDependencies": {
6060
"@types/glob": "8.0.0",
61+
"@types/node": "^14.6.4",
6162
"glob": "8.0.3"
6263
},
6364
"volta": {

packages/browser-integration-tests/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ const config: PlaywrightTestConfig = {
77
// Use 3 workers on CI, else use defaults (based on available CPU cores)
88
// Note that 3 is a random number selected to work well with our CI setup
99
workers: process.env.CI ? 3 : undefined,
10+
11+
globalSetup: require.resolve('./playwright.setup.ts'),
1012
};
13+
1114
export default config;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import setupStaticAssets from './utils/staticAssets';
2+
3+
export default function globalSetup(): Promise<void> {
4+
return setupStaticAssets();
5+
}

packages/browser-integration-tests/suites/public-api/setContext/multiple_contexts/test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ sentryTest('should record multiple contexts', async ({ getLocalTestPath, page })
1616
baz: { qux: 'quux' },
1717
},
1818
context_2: { 1: 'foo', bar: false },
19-
context_4: '[undefined]',
2019
context_5: '[NaN]',
2120
context_6: 3.141592653589793,
2221
});

packages/browser-integration-tests/suites/replay/bufferMode/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ sentryTest(
9494

9595
// 2 errors, 1 flush
9696
await reqErrorPromise;
97-
expect(callsToSentry).toEqual(3);
97+
expect(callsToSentry).toBeGreaterThanOrEqual(3);
9898

9999
await page.click('#log');
100100
await page.click('#go-background');
101101

102102
// Switches to session mode and then goes to background
103103
const req1 = await reqPromise1;
104104
const req2 = await reqPromise2;
105-
expect(callsToSentry).toEqual(5);
105+
expect(callsToSentry).toBeGreaterThanOrEqual(5);
106106

107107
const event0 = getReplayEvent(req0);
108108
const content0 = getReplayRecordingContent(req0);

packages/browser-integration-tests/suites/replay/dsc/init.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Sentry.init({
1313
integrations: [new Integrations.BrowserTracing({ tracingOrigins: [/.*/] }), window.Replay],
1414
environment: 'production',
1515
tracesSampleRate: 1,
16+
// Needs manual start!
1617
replaysSessionSampleRate: 0.0,
17-
replaysOnErrorSampleRate: 1.0,
18+
replaysOnErrorSampleRate: 0.0,
1819
});

0 commit comments

Comments
 (0)