Skip to content

Commit 6932272

Browse files
authored
Merge branch 'develop' into feat/per-pr-bundle-size-check
2 parents 65b960d + cc2bde7 commit 6932272

584 files changed

Lines changed: 12530 additions & 6311 deletions

File tree

Some content is hidden

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

‎.github/workflows/build.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,8 +1055,8 @@ jobs:
10551055
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
10561056
- name: Set up Bun
10571057
if:
1058-
contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", "elysia-bun-static", "hono-4",
1059-
"bun-bytecode", "bun-mysql"]'), matrix.test-application)
1058+
matrix.test-application == 'node-exports-test-app' || contains(matrix.test-application, 'bun') ||
1059+
contains(matrix.label, 'bun')
10601060
uses: oven-sh/setup-bun@v2
10611061
with:
10621062
bun-version: '1.3.14'
@@ -1067,7 +1067,7 @@ jobs:
10671067
use-installer: true
10681068
token: ${{ secrets.GITHUB_TOKEN }}
10691069
- name: Set up Deno
1070-
if: matrix.test-application == 'deno' || matrix.test-application == 'hono-4'
1070+
if: contains(matrix.test-application, 'deno') || contains(matrix.label, 'deno')
10711071
uses: denoland/setup-deno@v2.0.5
10721072
with:
10731073
deno-version: ${{ matrix.deno-version || 'v2.8.3' }}

‎.github/workflows/cleanup-e2e-workers.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
1717
strategy:
1818
matrix:
19-
# Name prefix of every E2E app that deploys a real worker, see the app's global-setup.mjs
19+
# Name prefix of every E2E app that deploys a real worker, see the app's global-setup.ts
2020
worker-prefix:
2121
- e2e-send-to-sentry
2222
steps:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'Automation: Label external PRs'
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
7+
jobs:
8+
label_external_pr:
9+
name: Add external label
10+
permissions:
11+
pull-requests: write
12+
runs-on: ubuntu-24.04
13+
if: |
14+
github.event.pull_request.author_association != 'COLLABORATOR'
15+
&& github.event.pull_request.author_association != 'MEMBER'
16+
&& github.event.pull_request.author_association != 'OWNER'
17+
&& endsWith(github.event.pull_request.user.login, '[bot]') == false
18+
steps:
19+
- name: Add external label
20+
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1.1.3
21+
with:
22+
labels: external

‎.version.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"_comment": "Auto-generated by scripts/bump-version.js. Used by the gitflow sync workflow to detect version bumps. Do not edit manually.",
3-
"version": "11.1.0"
3+
"version": "11.2.0"
44
}

‎CHANGELOG.md‎

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

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

7+
## 11.2.0
8+
9+
### Important Changes
10+
11+
- **feat(hono): add orchestrion-based auto-instrumentation ([#24497](https://github.com/getsentry/sentry-javascript/pull/24497))**
12+
13+
Hono is now instrumented automatically. Request spans are named after the matched Hono route, each middleware gets its own span, and errors thrown in handlers are captured.
14+
15+
- **feat(node/bun): Enable dedupeIntegration by default ([#24794](https://github.com/getsentry/sentry-javascript/pull/24794))**
16+
17+
`@sentry/node` and `@sentry/bun` now include `dedupeIntegration` in their default integrations, like the browser, Deno, Vercel Edge and Cloudflare SDKs. When the same error is captured two times in a row, only the first event is sent. To keep the previous behavior, remove the integration: `integrations: defaults => defaults.filter(integration => integration.name !== 'Dedupe')`.
18+
19+
- **feat(remix): Instrument Remix 3 server requests via fetch-router ([#24801](https://github.com/getsentry/sentry-javascript/pull/24801))**
20+
21+
On Remix 3, the SDK now adds the matched route as `http.route`, the response status and a low-cardinality name to the `http.server` span of each `fetch-router` request. Start the app with `--import @sentry/remix/v3/node` in place of `--import remix/node-tsx`.
22+
23+
### Other Changes
24+
25+
- chore(bundler-plugins): Allow magic-string 1.x ([#24768](https://github.com/getsentry/sentry-javascript/pull/24768))
26+
- feat(deps): Bump oxc-parser to 0.152.0 and sentry to 0.45.0 ([#24823](https://github.com/getsentry/sentry-javascript/pull/24823))
27+
- feat(elysia): Export `bunRuntimeMetricsIntegration` ([#24892](https://github.com/getsentry/sentry-javascript/pull/24892))
28+
- feat(react-router): Support request-scoped CSP nonces in createSentryHandleRequest ([#24826](https://github.com/getsentry/sentry-javascript/pull/24826))
29+
- fix(aws-serverless): Keep Lambda extension polling past 300s ([#24811](https://github.com/getsentry/sentry-javascript/pull/24811))
30+
- fix(browser-utils): Stop leaking DOM instrumentation listeners on mismatched removals ([#24727](https://github.com/getsentry/sentry-javascript/pull/24727))
31+
- fix(core): Resolve escape sequences in `fmt` / `parameterize` messages ([#24770](https://github.com/getsentry/sentry-javascript/pull/24770))
32+
- fix(deno): Flush buffered metrics and logs before process exit ([#24807](https://github.com/getsentry/sentry-javascript/pull/24807))
33+
- fix(node): End Express layer spans when `next` is called ([#24854](https://github.com/getsentry/sentry-javascript/pull/24854))
34+
- fix(node): Flush buffered metrics on process exit ([#24806](https://github.com/getsentry/sentry-javascript/pull/24806))
35+
- fix(nuxt): Fix CommonJS interop for force-inlined instrumented packages ([#24799](https://github.com/getsentry/sentry-javascript/pull/24799))
36+
- fix(server-utils): Preserve raw Anthropic response bodies ([#24902](https://github.com/getsentry/sentry-javascript/pull/24902))
37+
- fix(server-utils): Preserve raw Groq and Together response bodies ([#24906](https://github.com/getsentry/sentry-javascript/pull/24906))
38+
- fix(server-utils): Preserve raw OpenAI embeddings and conversation responses ([#24908](https://github.com/getsentry/sentry-javascript/pull/24908))
39+
- fix(server-utils): Preserve response bodies for OpenAI parse helpers ([#24783](https://github.com/getsentry/sentry-javascript/pull/24783))
40+
- fix(solidstart): Support `rolldownOptions` in instrumentation file plugin ([#24863](https://github.com/getsentry/sentry-javascript/pull/24863))
41+
- fix(sveltekit): Skip trace meta tags when prerendering ([#24777](https://github.com/getsentry/sentry-javascript/pull/24777))
42+
- fix(vue): Share one root render span debounce timer across components ([#24868](https://github.com/getsentry/sentry-javascript/pull/24868))
43+
- perf(server-utils): Avoid quadratic SQL sanitizer output handling ([#24834](https://github.com/getsentry/sentry-javascript/pull/24834))
44+
45+
<details>
46+
<summary> <strong>Internal Changes</strong> </summary>
47+
48+
- chore: Add external contributor to CHANGELOG.md ([#24822](https://github.com/getsentry/sentry-javascript/pull/24822))
49+
- chore: Add external contributor to CHANGELOG.md ([#24827](https://github.com/getsentry/sentry-javascript/pull/24827))
50+
- chore: Add external contributor to CHANGELOG.md ([#24835](https://github.com/getsentry/sentry-javascript/pull/24835))
51+
- chore: Add external contributor to CHANGELOG.md ([#24850](https://github.com/getsentry/sentry-javascript/pull/24850))
52+
- chore: Add external contributor to CHANGELOG.md ([#24851](https://github.com/getsentry/sentry-javascript/pull/24851))
53+
- chore: Add external contributor to CHANGELOG.md ([#24914](https://github.com/getsentry/sentry-javascript/pull/24914))
54+
- chore(deps): Update to Vitest 4 and Vite 8 ([#24746](https://github.com/getsentry/sentry-javascript/pull/24746))
55+
- chore(github): Add `external` label on PRs of external contributors ([#24825](https://github.com/getsentry/sentry-javascript/pull/24825))
56+
- chore(solidstart): Remove unused Vitest setup from e2e apps ([#24789](https://github.com/getsentry/sentry-javascript/pull/24789))
57+
- ci: shard Bun integration tests ([#24771](https://github.com/getsentry/sentry-javascript/pull/24771))
58+
- ci: shard Deno shared integration tests ([#24772](https://github.com/getsentry/sentry-javascript/pull/24772))
59+
- docs(core): Clarify error object dedupe and `dedupeIntegration` ([#24893](https://github.com/getsentry/sentry-javascript/pull/24893))
60+
- feat(deps): bump axios from 1.18.0 to 1.20.0 ([#24918](https://github.com/getsentry/sentry-javascript/pull/24918))
61+
- feat(deps): bump fast-uri from 3.1.7 to 3.1.8 ([#24889](https://github.com/getsentry/sentry-javascript/pull/24889))
62+
- feat(deps): bump fastify from 5.12.1 to 5.12.5 ([#24917](https://github.com/getsentry/sentry-javascript/pull/24917))
63+
- feat(deps): bump hono from 4.13.5 to 4.13.7 ([#24916](https://github.com/getsentry/sentry-javascript/pull/24916))
64+
- feat(deps): bump ip-address from 10.4.0 to 10.7.2 ([#24810](https://github.com/getsentry/sentry-javascript/pull/24810))
65+
- feat(deps): bump moment from 2.30.1 to 2.31.0 ([#24890](https://github.com/getsentry/sentry-javascript/pull/24890))
66+
- fix(deps): runtime dependency security fixes ([#24911](https://github.com/getsentry/sentry-javascript/pull/24911))
67+
- ref(hono): move shared Hono instrumentation into @sentry/server-utils ([#24496](https://github.com/getsentry/sentry-javascript/pull/24496))
68+
- test(browser): Fix flaky reportPageLoaded duration assertion ([#24814](https://github.com/getsentry/sentry-javascript/pull/24814))
69+
- test(bun): Run the auto-instrumentation suites with bundled scenarios ([#24612](https://github.com/getsentry/sentry-javascript/pull/24612))
70+
- test(cloudflare): Add shared streamed-span helpers to the integration test runner ([#24176](https://github.com/getsentry/sentry-javascript/pull/24176))
71+
- test(cloudflare): Assert Workers AI gen_ai spans in the send-to-sentry E2E test ([#24515](https://github.com/getsentry/sentry-javascript/pull/24515))
72+
- test(cloudflare): Port the binding suites to span streaming ([#24190](https://github.com/getsentry/sentry-javascript/pull/24190))
73+
- test(cloudflare): Port the http-server integration suites to span streaming ([#24195](https://github.com/getsentry/sentry-javascript/pull/24195))
74+
- test(cloudflare): Port the request handler suites to span streaming ([#24196](https://github.com/getsentry/sentry-javascript/pull/24196))
75+
- test(cloudflare): Port the tracing propagation suites to span streaming ([#24185](https://github.com/getsentry/sentry-javascript/pull/24185))
76+
- test(cloudflare): Port the tracing suites to span streaming ([#24179](https://github.com/getsentry/sentry-javascript/pull/24179))
77+
- test(cloudflare): Port the vite-autoinstrument suites to span streaming ([#24189](https://github.com/getsentry/sentry-javascript/pull/24189))
78+
- test(e2e): Add Bun Express test app ([#24306](https://github.com/getsentry/sentry-javascript/pull/24306))
79+
- test(e2e): Add trace test for background use cache revalidation ([#24740](https://github.com/getsentry/sentry-javascript/pull/24740))
80+
- test(e2e): Mark supabase-nextjs as optional ([#24898](https://github.com/getsentry/sentry-javascript/pull/24898))
81+
- test(e2e): Retry a hung SAM start in aws-serverless tests ([#24879](https://github.com/getsentry/sentry-javascript/pull/24879))
82+
- test(nextjs): Add tests for low-cardinality span names for cache spans ([#24819](https://github.com/getsentry/sentry-javascript/pull/24819))
83+
- test(nextjs): Add UI components for cached/dynamic content ([#24874](https://github.com/getsentry/sentry-javascript/pull/24874))
84+
- test(nuxt): Remove version pin for @nuxt/cli in Nuxt 5 E2E ([#24798](https://github.com/getsentry/sentry-javascript/pull/24798))
85+
- test(replay): De-flake mutationLimit large-mutations test ([#24784](https://github.com/getsentry/sentry-javascript/pull/24784))
86+
- test(sveltekit): Add missing prerender e2e test ([#24921](https://github.com/getsentry/sentry-javascript/pull/24921))
87+
- test(test-utils): Add fetchSpanAttributes to read span attributes via the sentry CLI ([#24514](https://github.com/getsentry/sentry-javascript/pull/24514))
88+
- test(test-utils): Extract Cloudflare Worker deploys into `test-utils/cloudflare` ([#24815](https://github.com/getsentry/sentry-javascript/pull/24815))
89+
90+
</details>
91+
92+
Work in this release was contributed by @nabi-noor, @LuccaRebelloToledo, @andasan, @breken-ai, @EmileBrunelle, and @diobriggs. Thank you for your contributions!
93+
794
## 11.1.0
895

996
### Important Changes

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "11.1.0",
3+
"version": "11.2.0",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -60,12 +60,12 @@
6060
"@babel/preset-typescript": "^7.16.7",
6161
"@playwright/test": "~1.63.0",
6262
"@sentry/rrweb": "2.43.2",
63-
"@sentry/browser": "11.1.0",
64-
"@sentry/replay": "11.1.0",
65-
"@sentry/opentelemetry": "11.1.0",
63+
"@sentry/browser": "11.2.0",
64+
"@sentry/replay": "11.2.0",
65+
"@sentry/opentelemetry": "11.2.0",
6666
"@sentry/conventions": "0.24.0",
6767
"@supabase/supabase-js": "2.109.0",
68-
"axios": "1.18.0",
68+
"axios": "1.20.0",
6969
"babel-loader": "^10.1.1",
7070
"fflate": "0.8.3",
7171
"html-webpack-plugin": "^5.5.0",

‎dev-packages/browser-integration-tests/suites/replay/largeMutations/mutationLimit/test.ts‎

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { expect } from '@playwright/test';
2+
import { EventType } from '@sentry/rrweb';
23
import { sentryTest } from '../../../../utils/fixtures';
34
import {
5+
collectReplayRequests,
6+
getReplayBreadcrumbs,
47
getReplayRecordingContent,
58
getReplaySnapshot,
69
shouldSkipReplayTest,
@@ -25,14 +28,20 @@ sentryTest(
2528
const [res0] = await Promise.all([waitForReplayRequest(page, 0), gotoPageAndClick()]);
2629
await forceFlushReplay();
2730

28-
const [res1] = await Promise.all([
29-
waitForReplayRequest(page, (_event, res) => {
30-
const parsed = getReplayRecordingContent(res);
31-
return !!parsed.incrementalSnapshots.length || !!parsed.fullSnapshots.length;
32-
}),
33-
page.locator('#button-add').click(),
34-
forceFlushReplay(),
35-
]);
31+
// The `replay.mutations` breadcrumb is added asynchronously (once rrweb's
32+
// MutationObserver fires) and can land in a different flush than the
33+
// incremental snapshots and the `ui.click` breadcrumb. Collect across
34+
// requests until the mutation breadcrumb has arrived rather than betting on
35+
// a single request containing everything.
36+
const requestsPromise = collectReplayRequests(
37+
page,
38+
recordingSnapshots => getReplayBreadcrumbs(recordingSnapshots, 'replay.mutations').length > 0,
39+
);
40+
41+
await page.locator('#button-add').click();
42+
await forceFlushReplay();
43+
44+
const { replayRecordingSnapshots } = await requestsPromise;
3645

3746
// replay should be stopped due to mutation limit
3847
let replay = await getReplaySnapshot(page);
@@ -48,11 +57,21 @@ sentryTest(
4857
const replayData0 = getReplayRecordingContent(res0);
4958
expect(replayData0.fullSnapshots.length).toBe(1);
5059

60+
const fullSnapshots = replayRecordingSnapshots.filter(snapshot => snapshot.type === EventType.FullSnapshot);
61+
const incrementalSnapshots = replayRecordingSnapshots.filter(
62+
snapshot => snapshot.type === EventType.IncrementalSnapshot,
63+
);
64+
// A still-in-flight envelope from the setup flush can re-deliver the
65+
// `#noop` `ui.click` breadcrumb into the collected set, so assert on the
66+
// unique categories rather than the raw (potentially duplicated) list.
67+
const breadcrumbCategories = [
68+
...new Set(getReplayBreadcrumbs(replayRecordingSnapshots).map(({ category }) => category)),
69+
].sort();
70+
5171
// Breadcrumbs (click and mutation);
52-
const replayData1 = getReplayRecordingContent(res1);
53-
expect(replayData1.fullSnapshots.length).toBe(0);
54-
expect(replayData1.incrementalSnapshots.length).toBeGreaterThan(0);
55-
expect(replayData1.breadcrumbs.map(({ category }) => category).sort()).toEqual(['replay.mutations', 'ui.click']);
72+
expect(fullSnapshots.length).toBe(0);
73+
expect(incrementalSnapshots.length).toBeGreaterThan(0);
74+
expect(breadcrumbCategories).toEqual(['replay.mutations', 'ui.click']);
5675

5776
replay = await getReplaySnapshot(page);
5877
expect(replay.session).toBe(undefined);

‎dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/reportPageLoaded-streamed/default/test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ sentryTest(
3333
[SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]: { type: 'string', value: 'reportPageLoaded' },
3434
});
3535

36-
// We wait for 2.5 seconds before calling Sentry.reportPageLoaded()
37-
// the margins are to account for timing weirdness in CI to avoid flakes
36+
// We wait for 2.5 seconds before calling Sentry.reportPageLoaded(). The span starts at navigation start,
37+
// but the timeout only starts once the bundle has executed, so allow generous upper headroom for slow CI.
3838
expect(spanDurationSeconds).toBeGreaterThan(2);
39-
expect(spanDurationSeconds).toBeLessThan(3);
39+
expect(spanDurationSeconds).toBeLessThan(4);
4040
},
4141
);

‎dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/reportPageLoaded/default/test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ sentryTest(
3434
['sentry.idle_span_finish_reason']: 'reportPageLoaded',
3535
});
3636

37-
// We wait for 2.5 seconds before calling Sentry.reportPageLoaded()
38-
// the margins are to account for timing weirdness in CI to avoid flakes
37+
// We wait for 2.5 seconds before calling Sentry.reportPageLoaded(). The span starts at navigation start,
38+
// but the timeout only starts once the bundle has executed, so allow generous upper headroom for slow CI.
3939
expect(spanDurationSeconds).toBeGreaterThan(2);
40-
expect(spanDurationSeconds).toBeLessThan(3);
40+
expect(spanDurationSeconds).toBeLessThan(4);
4141
},
4242
);
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Bundles one Node suite scenario with `@sentry/bun/plugin`, so the plugin can inject the
2+
// diagnostics channels into the libraries the scenario uses. The runner calls this script with the
3+
// scenario path when `RUNTIME_BUILD_SCRIPT` points to it, and runs the printed output file instead.
4+
import { sentryBunPlugin } from '@sentry/bun/plugin';
5+
import { dirname, join, relative } from 'node:path';
6+
7+
const NODE_SUITES_ROOT = join(import.meta.dir, '..', '..', 'node-integration-tests');
8+
const BUILD_ROOT = join(import.meta.dir, '..', 'build');
9+
10+
const entry = process.argv[2];
11+
if (!entry) {
12+
// eslint-disable-next-line no-console
13+
console.error('BUILD_FAILED no scenario path');
14+
process.exit(1);
15+
}
16+
17+
const result = await Bun.build({
18+
entrypoints: [entry],
19+
target: 'bun',
20+
// Mirrors the scenario's folder, so relative paths between scenarios keep their shape.
21+
outdir: join(BUILD_ROOT, relative(NODE_SUITES_ROOT, dirname(entry))),
22+
sourcemap: 'linked',
23+
// The instrument file is preloaded unbundled, so the bundle must share its `@sentry/*` packages.
24+
// knex requires the drivers of all its dialects, and the ones that are not installed must stay
25+
// external so the bundle still builds.
26+
external: ['@sentry/*', '@sentry-internal/*', 'better-sqlite3', 'oracledb', 'pg-query-stream', 'sqlite3'],
27+
plugins: [sentryBunPlugin()],
28+
});
29+
30+
const output = result.outputs.find(file => file.kind === 'entry-point');
31+
if (!result.success || !output) {
32+
// eslint-disable-next-line no-console
33+
console.error('BUILD_FAILED', result.logs);
34+
process.exit(1);
35+
}
36+
37+
// eslint-disable-next-line no-console
38+
console.log(`BUILD_OK ${output.path}`);

0 commit comments

Comments
 (0)