Skip to content

Commit caf8761

Browse files
authored
Merge pull request #13228 from getsentry/prepare-release/8.23.0
2 parents fb1e785 + 70eae3d commit caf8761

File tree

98 files changed

+2030
-739
lines changed

Some content is hidden

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

98 files changed

+2030
-739
lines changed

.craft.yml

+2
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ targets:
183183
format: base64
184184
'npm:@sentry/bun':
185185
onlyIfPresent: /^sentry-bun-\d.*\.tgz$/
186+
'npm:@sentry/cloudflare':
187+
onlyIfPresent: /^sentry-cloudflare-\d.*\.tgz$/
186188
'npm:@sentry/deno':
187189
onlyIfPresent: /^sentry-deno-\d.*\.tgz$/
188190
'npm:@sentry/ember':

.github/workflows/build.yml

+42-15
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ jobs:
126126
- *shared
127127
- *node
128128
- 'dev-packages/node-integration-tests/**'
129+
- 'packages/nestjs/**'
129130
nextjs:
130131
- *shared
131132
- *browser
@@ -408,10 +409,11 @@ jobs:
408409
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
409410

410411
- name: Extract Profiling Node Prebuilt Binaries
411-
uses: actions/download-artifact@v3
412+
uses: actions/download-artifact@v4
412413
with:
413-
name: profiling-node-binaries-${{ github.sha }}
414+
pattern: profiling-node-binaries-${{ github.sha }}-*
414415
path: ${{ github.workspace }}/packages/profiling-node/lib/
416+
merge-multiple: true
415417

416418
- name: Pack tarballs
417419
run: yarn build:tarball
@@ -901,16 +903,15 @@ jobs:
901903
run: yarn lerna run build:lib --scope @sentry/profiling-node
902904

903905
- name: Extract Profiling Node Prebuilt Binaries
904-
# @TODO: v4 breaks convenient merging of same name artifacts
905-
# https://github.com/actions/upload-artifact/issues/478
906906
if: |
907907
(needs.job_get_metadata.outputs.changed_profiling_node_bindings == 'true') ||
908908
(needs.job_get_metadata.outputs.is_release == 'true') ||
909909
(github.event_name != 'pull_request')
910-
uses: actions/download-artifact@v3
910+
uses: actions/download-artifact@v4
911911
with:
912-
name: profiling-node-binaries-${{ github.sha }}
912+
pattern: profiling-node-binaries-${{ github.sha }}-*
913913
path: ${{ github.workspace }}/packages/profiling-node/lib/
914+
merge-multiple: true
914915

915916
- name: Build Profiling tarball
916917
run: yarn build:tarball
@@ -1230,11 +1231,11 @@ jobs:
12301231
- name: Build Profiling Node
12311232
run: yarn lerna run build:lib --scope @sentry/profiling-node
12321233
- name: Extract Profiling Node Prebuilt Binaries
1233-
uses: actions/download-artifact@v3
1234+
uses: actions/download-artifact@v4
12341235
with:
1235-
name: profiling-node-binaries-${{ github.sha }}
1236+
pattern: profiling-node-binaries-${{ github.sha }}-*
12361237
path: ${{ github.workspace }}/packages/profiling-node/lib/
1237-
1238+
merge-multiple: true
12381239
- name: Restore tarball cache
12391240
uses: actions/cache/restore@v4
12401241
with:
@@ -1358,104 +1359,132 @@ jobs:
13581359
# x64 glibc
13591360
- os: ubuntu-20.04
13601361
node: 16
1362+
binary: linux-x64-glibc-93
13611363
- os: ubuntu-20.04
13621364
node: 18
1365+
binary: linux-x64-glibc-108
13631366
- os: ubuntu-20.04
13641367
node: 20
1368+
binary: linux-x64-glibc-115
13651369
- os: ubuntu-20.04
13661370
node: 22
1371+
binary: linux-x64-glibc-127
13671372

13681373
# x64 musl
13691374
- os: ubuntu-20.04
13701375
container: node:16-alpine3.16
1376+
binary: linux-x64-musl-93
13711377
node: 16
13721378
- os: ubuntu-20.04
13731379
container: node:18-alpine3.17
13741380
node: 18
1381+
binary: linux-x64-musl-108
13751382
- os: ubuntu-20.04
13761383
container: node:20-alpine3.17
13771384
node: 20
1385+
binary: linux-x64-musl-115
13781386
- os: ubuntu-20.04
13791387
container: node:22-alpine3.18
13801388
node: 22
1389+
binary: linux-x64-musl-127
13811390

13821391
# arm64 glibc
13831392
- os: ubuntu-20.04
13841393
arch: arm64
13851394
node: 16
1395+
binary: linux-arm64-glibc-93
13861396
- os: ubuntu-20.04
13871397
arch: arm64
13881398
node: 18
1399+
binary: linux-arm64-glibc-108
13891400
- os: ubuntu-20.04
13901401
arch: arm64
13911402
node: 20
1403+
binary: linux-arm64-glibc-115
13921404
- os: ubuntu-20.04
13931405
arch: arm64
13941406
node: 22
1407+
binary: linux-arm64-glibc-127
13951408

13961409
# arm64 musl
13971410
- os: ubuntu-20.04
13981411
container: node:16-alpine3.16
13991412
arch: arm64
14001413
node: 16
1414+
binary: linux-arm64-musl-93
14011415
- os: ubuntu-20.04
14021416
arch: arm64
14031417
container: node:18-alpine3.17
14041418
node: 18
1419+
binary: linux-arm64-musl-108
14051420
- os: ubuntu-20.04
14061421
arch: arm64
14071422
container: node:20-alpine3.17
14081423
node: 20
1424+
binary: linux-arm64-musl-115
14091425
- os: ubuntu-20.04
14101426
arch: arm64
14111427
container: node:22-alpine3.18
14121428
node: 22
1429+
binary: linux-arm64-musl-127
14131430

14141431
# macos x64
14151432
- os: macos-13
14161433
node: 16
14171434
arch: x64
1435+
binary: darwin-x64-93
14181436
- os: macos-13
14191437
node: 18
14201438
arch: x64
1439+
binary: darwin-x64-108
14211440
- os: macos-13
14221441
node: 20
14231442
arch: x64
1443+
binary: darwin-x64-115
14241444
- os: macos-13
14251445
node: 22
14261446
arch: x64
1447+
binary: darwin-x64-127
14271448

14281449
# macos arm64
14291450
- os: macos-13
14301451
arch: arm64
14311452
node: 16
14321453
target_platform: darwin
1454+
binary: darwin-arm64-93
14331455
- os: macos-13
14341456
arch: arm64
14351457
node: 18
14361458
target_platform: darwin
1459+
binary: darwin-arm64-108
14371460
- os: macos-13
14381461
arch: arm64
14391462
node: 20
14401463
target_platform: darwin
1464+
binary: darwin-arm64-115
14411465
- os: macos-13
14421466
arch: arm64
14431467
node: 22
14441468
target_platform: darwin
1469+
binary: darwin-arm64-127
14451470

14461471
# windows x64
14471472
- os: windows-2022
14481473
node: 16
14491474
arch: x64
1475+
binary: win32-x64-93
14501476
- os: windows-2022
14511477
node: 18
14521478
arch: x64
1479+
binary: win32-x64-108
14531480
- os: windows-2022
14541481
node: 20
14551482
arch: x64
1483+
binary: win32-x64-115
14561484
- os: windows-2022
14571485
node: 22
14581486
arch: x64
1487+
binary: win32-x64-127
14591488

14601489
steps:
14611490
- name: Setup (alpine)
@@ -1587,10 +1616,8 @@ jobs:
15871616
yarn lerna run test --scope @sentry/profiling-node
15881617
15891618
- name: Archive Binary
1590-
# @TODO: v4 breaks convenient merging of same name artifacts
1591-
# https://github.com/actions/upload-artifact/issues/478
1592-
uses: actions/upload-artifact@v3
1619+
uses: actions/upload-artifact@v4
15931620
with:
1594-
name: profiling-node-binaries-${{ github.sha }}
1595-
path: |
1596-
${{ github.workspace }}/packages/profiling-node/lib/*.node
1621+
name: profiling-node-binaries-${{ github.sha }}-${{ matrix.binary }}
1622+
path: ${{ github.workspace }}/packages/profiling-node/lib/sentry_cpu_profiler-${{matrix.binary}}.node
1623+
if-no-files-found: error

CHANGELOG.md

+31-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,50 @@
11
# Changelog
22

3-
> [!IMPORTANT] Important
4-
>
3+
<!-- prettier-ignore-start -->
4+
> [!IMPORTANT]
55
> If you are upgrading to the `8.x` versions of the SDK from `7.x` or below, make sure you follow our
66
> [migration guide](https://docs.sentry.io/platforms/javascript/migration/) first.
7+
<!-- prettier-ignore-end -->
78
89
## Unreleased
910

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

1213
## 8.23.0
1314

14-
- feat(cloudflare): Add Cloudflare D1 instrumentation (#13142)
15+
### Important Changes
16+
17+
- **feat(cloudflare): Add Cloudflare D1 instrumentation (#13142)**
18+
19+
This release includes support for Cloudflare D1, Cloudflare's serverless SQL database. To instrument your Cloudflare D1
20+
database, use the `instrumentD1WithSentry` method as follows:
21+
22+
```ts
23+
// env.DB is the D1 DB binding configured in your `wrangler.toml`
24+
const db = instrumentD1WithSentry(env.DB);
25+
// Now you can use the database as usual
26+
await db.prepare('SELECT * FROM table WHERE id = ?').bind(1).run();
27+
```
28+
29+
### Other Changes
30+
31+
- feat(cloudflare): Allow users to pass handler to sentryPagesPlugin (#13192)
32+
- feat(cloudflare): Instrument scheduled handler (#13114)
33+
- feat(core): Add `getTraceData` function (#13134)
1534
- feat(nestjs): Automatic instrumentation of nestjs interceptors before route execution (#13153)
1635
- feat(nestjs): Automatic instrumentation of nestjs pipes (#13137)
1736
- feat(nuxt): Filter out Nuxt build assets (#13148)
18-
- feat(profiling): attach sdk info to chunks (#13145)
37+
- feat(profiling): Attach sdk info to chunks (#13145)
38+
- feat(solidstart): Add sentry `onBeforeResponse` middleware to enable distributed tracing (#13221)
39+
- feat(solidstart): Filter out low quality transactions for build assets (#13222)
1940
- fix(browser): Avoid showing browser extension error message in non-`window` global scopes (#13156)
41+
- fix(feedback): Call dialog.close() in dialog close callbacks in `\_loadAndRenderDialog` (#13203)
2042
- fix(nestjs): Inline Observable type to resolve missing 'rxjs' dependency (#13166)
43+
- fix(nuxt): Detect pageload by adding flag in Vue router (#13171)
44+
- fix(utils): Handle when requests get aborted in fetch instrumentation (#13202)
45+
- ref(browser): Improve browserMetrics collection (#13062)
46+
47+
Work in this release was contributed by @horochx. Thank you for your contribution!
2148

2249
## 8.22.0
2350

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ faster, so we can get back to enjoying technology. If you want to join us
1515

1616
# Official Sentry SDKs for JavaScript
1717

18+
<a href="https://docs.sentry.io/platforms/javascript/" target="_blank">
19+
<img src="https://github.com/user-attachments/assets/aedc2b46-9959-4b9e-8a23-6240062cefc5" alt="Sentry for JavaScript">
20+
</a>
21+
1822
This is the next line of Sentry JavaScript SDKs, comprised in the `@sentry/` namespace. It will provide a more
1923
convenient interface and improved consistency between various JavaScript environments.
2024

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
tracesSampleRate: 1,
8+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
let controller;
2+
3+
const startFetch = e => {
4+
controller = new AbortController();
5+
const { signal } = controller;
6+
7+
Sentry.startSpan(
8+
{
9+
name: 'with-abort-controller',
10+
forceTransaction: true,
11+
},
12+
async () => {
13+
await fetch('http://localhost:7654/foo', { signal })
14+
.then(response => response.json())
15+
.then(data => {
16+
console.log('Fetch succeeded:', data);
17+
})
18+
.catch(err => {
19+
if (err.name === 'AbortError') {
20+
console.log('Fetch aborted');
21+
} else {
22+
console.error('Fetch error:', err);
23+
}
24+
});
25+
},
26+
);
27+
};
28+
29+
const abortFetch = e => {
30+
if (controller) {
31+
controller.abort();
32+
}
33+
};
34+
35+
document.querySelector('[data-test-id=start-button]').addEventListener('click', startFetch);
36+
document.querySelector('[data-test-id=abort-button]').addEventListener('click', abortFetch);
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 data-test-id="start-button">Start fetch</button>
8+
<button data-test-id="abort-button">Abort fetch</button>
9+
</body>
10+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event as SentryEvent } from '@sentry/types';
3+
import { sentryTest } from '../../../../../utils/fixtures';
4+
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../../utils/helpers';
5+
6+
sentryTest('should handle aborted fetch calls', async ({ getLocalTestPath, page }) => {
7+
if (shouldSkipTracingTest()) {
8+
sentryTest.skip();
9+
}
10+
11+
const url = await getLocalTestPath({ testDir: __dirname });
12+
13+
await page.route('**/foo', async () => {
14+
// never fulfil this route because we abort the request as part of the test
15+
});
16+
17+
const transactionEventPromise = getFirstSentryEnvelopeRequest<SentryEvent>(page);
18+
19+
const hasAbortedFetchPromise = new Promise<void>(resolve => {
20+
page.on('console', msg => {
21+
if (msg.type() === 'log' && msg.text() === 'Fetch aborted') {
22+
resolve();
23+
}
24+
});
25+
});
26+
27+
await page.goto(url);
28+
29+
await page.locator('[data-test-id=start-button]').click();
30+
await page.locator('[data-test-id=abort-button]').click();
31+
32+
const transactionEvent = await transactionEventPromise;
33+
34+
// assert that fetch calls do not return undefined
35+
const fetchBreadcrumbs = transactionEvent.breadcrumbs?.filter(
36+
({ category, data }) => category === 'fetch' && data === undefined,
37+
);
38+
expect(fetchBreadcrumbs).toHaveLength(0);
39+
40+
await expect(hasAbortedFetchPromise).resolves.toBeUndefined();
41+
});

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-lcp/test.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ sentryTest('should capture a LCP vital with element details.', async ({ browserN
2525
expect(eventData.measurements).toBeDefined();
2626
expect(eventData.measurements?.lcp?.value).toBeDefined();
2727

28-
expect(eventData.contexts?.trace?.data?.['lcp.element']).toBe('body > img');
29-
expect(eventData.contexts?.trace?.data?.['lcp.size']).toBe(107400);
30-
expect(eventData.contexts?.trace?.data?.['lcp.url']).toBe('https://example.com/path/to/image.png');
28+
// XXX: This should be body > img, but it can be flakey as sometimes it will report
29+
// the button as LCP.
30+
expect(eventData.contexts?.trace?.data?.['lcp.element'].startsWith('body >')).toBe(true);
31+
expect(eventData.contexts?.trace?.data?.['lcp.size']).toBeGreaterThan(0);
3132
});

0 commit comments

Comments
 (0)