Skip to content

Commit 52b6e8a

Browse files
committed
Merge branch 'develop' into onur/postgres-js-esm-support
2 parents 4a6c7a9 + 3deeecd commit 52b6e8a

File tree

359 files changed

+12261
-2130
lines changed

Some content is hidden

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

359 files changed

+12261
-2130
lines changed

.cursor/rules/publishing_release.mdc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@ Use these guidelines when publishing a new Sentry JavaScript SDK release.
1212

1313
The release process is outlined in [publishing-a-release.md](mdc:docs/publishing-a-release.md).
1414

15-
1. Make sure you are on the latest version of the `develop` branch. To confirm this, run `git pull origin develop` to get the latest changes from the repo.
15+
1. Ensure you're on the `develop` branch with the latest changes:
16+
- If you have unsaved changes, stash them with `git stash -u`.
17+
- If you're on a different branch than `develop`, check out the develop branch using `git checkout develop`.
18+
- Pull the latest updates from the remote repository by running `git pull origin develop`.
19+
1620
2. Run `yarn changelog` on the `develop` branch and copy the output. You can use `yarn changelog | pbcopy` to copy the output of `yarn changelog` into your clipboard.
1721
3. Decide on a version for the release based on [semver](mdc:https://semver.org). The version should be decided based on what is in included in the release. For example, if the release includes a new feature, we should increment the minor version. If it includes only bug fixes, we should increment the patch version. You can find the latest version in [CHANGELOG.md](mdc:CHANGELOG.md) at the very top.
1822
4. Create a branch `prepare-release/VERSION`, eg. `prepare-release/8.1.0`, off `develop`.
19-
5. Update [CHANGELOG.md](mdc:CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release from the output of `yarn changelog`. See the `Updating the Changelog` section in [publishing-a-release.md](mdc:docs/publishing-a-release.md) for more details. If you remove changelog entries because they are not applicable, please let the user know.
23+
5. Update [CHANGELOG.md](mdc:CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release from the output of `yarn changelog`. See the `Updating the Changelog` section in [publishing-a-release.md](mdc:docs/publishing-a-release.md) for more details. Do not remove any changelog entries.
2024
6. Commit the changes to [CHANGELOG.md](mdc:CHANGELOG.md) with `meta(changelog): Update changelog for VERSION` where `VERSION` is the version of the release, e.g. `meta(changelog): Update changelog for 8.1.0`
2125
7. Push the `prepare-release/VERSION` branch to origin and remind the user that the release PR needs to be opened from the `master` branch.
26+
8. In case you were working on a different branch, you can checkout back to the branch you were working on and continue your work by unstashing the changes you stashed earlier with the command `git stash pop` (only if you stashed changes).
2227

2328
## Key Commands
2429

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,7 @@ jobs:
11681168
job_lint,
11691169
job_check_format,
11701170
job_circular_dep_check,
1171+
job_size_check,
11711172
]
11721173
# Always run this, even if a dependent job failed
11731174
if: always()

.size-limit.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ module.exports = [
3838
path: 'packages/browser/build/npm/esm/index.js',
3939
import: createImport('init', 'browserTracingIntegration'),
4040
gzip: true,
41-
limit: '41 KB',
41+
limit: '41.3 KB',
42+
},
43+
{
44+
name: '@sentry/browser (incl. Tracing, Profiling)',
45+
path: 'packages/browser/build/npm/esm/index.js',
46+
import: createImport('init', 'browserTracingIntegration', 'browserProfilingIntegration'),
47+
gzip: true,
48+
limit: '48 KB',
4249
},
4350
{
4451
name: '@sentry/browser (incl. Tracing, Replay)',
@@ -75,7 +82,7 @@ module.exports = [
7582
path: 'packages/browser/build/npm/esm/index.js',
7683
import: createImport('init', 'browserTracingIntegration', 'replayIntegration', 'replayCanvasIntegration'),
7784
gzip: true,
78-
limit: '84 KB',
85+
limit: '85 KB',
7986
},
8087
{
8188
name: '@sentry/browser (incl. Tracing, Replay, Feedback)',
@@ -120,7 +127,7 @@ module.exports = [
120127
import: createImport('init', 'ErrorBoundary', 'reactRouterV6BrowserTracingIntegration'),
121128
ignore: ['react/jsx-runtime'],
122129
gzip: true,
123-
limit: '43 KB',
130+
limit: '43.3 KB',
124131
},
125132
// Vue SDK (ESM)
126133
{
@@ -135,7 +142,7 @@ module.exports = [
135142
path: 'packages/vue/build/esm/index.js',
136143
import: createImport('init', 'browserTracingIntegration'),
137144
gzip: true,
138-
limit: '43 KB',
145+
limit: '43.1 KB',
139146
},
140147
// Svelte SDK (ESM)
141148
{
@@ -150,7 +157,7 @@ module.exports = [
150157
name: 'CDN Bundle',
151158
path: createCDNPath('bundle.min.js'),
152159
gzip: true,
153-
limit: '27 KB',
160+
limit: '27.5 KB',
154161
},
155162
{
156163
name: 'CDN Bundle (incl. Tracing)',
@@ -183,7 +190,7 @@ module.exports = [
183190
path: createCDNPath('bundle.tracing.min.js'),
184191
gzip: false,
185192
brotli: false,
186-
limit: '124 KB',
193+
limit: '124.1 KB',
187194
},
188195
{
189196
name: 'CDN Bundle (incl. Tracing, Replay) - uncompressed',
@@ -233,7 +240,7 @@ module.exports = [
233240
import: createImport('init'),
234241
ignore: [...builtinModules, ...nodePrefixedBuiltinModules],
235242
gzip: true,
236-
limit: '156 KB',
243+
limit: '158 KB',
237244
},
238245
{
239246
name: '@sentry/node - without tracing',

CHANGELOG.md

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

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

7+
Work in this release was contributed by @hanseo0507. Thank you for your contribution!
8+
9+
## 10.22.0
10+
11+
### Important Changes
12+
13+
- **feat(node): Instrument cloud functions for firebase v2 ([#17952](https://github.com/getsentry/sentry-javascript/pull/17952))**
14+
15+
We added instrumentation for Cloud Functions for Firebase v2, enabling automatic performance tracking and error monitoring. This will be added automatically if you have enabled tracing.
16+
17+
- **feat(core): Instrument LangChain AI ([#17955](https://github.com/getsentry/sentry-javascript/pull/17955))**
18+
19+
Instrumentation was added for LangChain AI operations. You can configure what is recorded like this:
20+
21+
```ts
22+
Sentry.init({
23+
integrations: [
24+
Sentry.langChainIntegration({
25+
recordInputs: true, // Record prompts/messages
26+
recordOutputs: true, // Record responses
27+
}),
28+
],
29+
});
30+
```
31+
32+
### Other Changes
33+
34+
- feat(cloudflare,vercel-edge): Add support for LangChain instrumentation ([#17986](https://github.com/getsentry/sentry-javascript/pull/17986))
35+
- feat: Align sentry origin with documentation ([#17998](https://github.com/getsentry/sentry-javascript/pull/17998))
36+
- feat(core): Truncate request messages in AI integrations ([#17921](https://github.com/getsentry/sentry-javascript/pull/17921))
37+
- feat(nextjs): Support node runtime on proxy files ([#17995](https://github.com/getsentry/sentry-javascript/pull/17995))
38+
- feat(node): Pass requestHook and responseHook option to OTel ([#17996](https://github.com/getsentry/sentry-javascript/pull/17996))
39+
- fix(core): Fix wrong async types when instrumenting anthropic's stream api ([#18007](https://github.com/getsentry/sentry-javascript/pull/18007))
40+
- fix(nextjs): Remove usage of chalk to avoid runtime errors ([#18010](https://github.com/getsentry/sentry-javascript/pull/18010))
41+
- fix(node): Pino capture serialized `err` ([#17999](https://github.com/getsentry/sentry-javascript/pull/17999))
42+
- fix(node): Pino child loggers ([#17934](https://github.com/getsentry/sentry-javascript/pull/17934))
43+
- fix(react): Don't trim index route `/` when getting pathname ([#17985](https://github.com/getsentry/sentry-javascript/pull/17985))
44+
- fix(react): Patch `spanEnd` for potentially cancelled lazy-route transactions ([#17962](https://github.com/getsentry/sentry-javascript/pull/17962))
45+
46+
<details>
47+
<summary> <strong>Internal Changes</strong> </summary>
48+
49+
- chore: Add required size_check for GH Actions ([#18009](https://github.com/getsentry/sentry-javascript/pull/18009))
50+
- chore: Upgrade madge to v8 ([#17957](https://github.com/getsentry/sentry-javascript/pull/17957))
51+
- test(hono): Fix hono e2e tests ([#18000](https://github.com/getsentry/sentry-javascript/pull/18000))
52+
- test(react-router): Fix `getMetaTagTransformer` tests for Vitest compatibility ([#18013](https://github.com/getsentry/sentry-javascript/pull/18013))
53+
- test(react): Add parameterized route tests for `createHashRouter` ([#17789](https://github.com/getsentry/sentry-javascript/pull/17789))
54+
55+
</details>
56+
57+
## 10.21.0
58+
59+
### Important Changes
60+
61+
- **feat(browserProfiling): Add `trace` lifecycle mode for UI profiling ([#17619](https://github.com/getsentry/sentry-javascript/pull/17619))**
62+
63+
Adds a new `trace` lifecycle mode for UI profiling, allowing profiles to be captured for the duration of a trace. A `manual` mode will be added in a future release.
64+
65+
- **feat(nuxt): Instrument Database ([#17899](https://github.com/getsentry/sentry-javascript/pull/17899))**
66+
67+
Adds instrumentation for Nuxt database operations, enabling better performance tracking of database queries.
68+
69+
- **feat(nuxt): Instrument server cache API ([#17886](https://github.com/getsentry/sentry-javascript/pull/17886))**
70+
71+
Adds instrumentation for Nuxt's server cache API, providing visibility into cache operations.
72+
73+
- **feat(nuxt): Instrument storage API ([#17858](https://github.com/getsentry/sentry-javascript/pull/17858))**
74+
75+
Adds instrumentation for Nuxt's storage API, enabling tracking of storage operations.
76+
77+
### Other Changes
78+
79+
- feat(browser): Add `onRequestSpanEnd` hook to browser tracing integration ([#17884](https://github.com/getsentry/sentry-javascript/pull/17884))
80+
- feat(nextjs): Support Next.js proxy files ([#17926](https://github.com/getsentry/sentry-javascript/pull/17926))
81+
- feat(replay): Record outcome when event buffer size exceeded ([#17946](https://github.com/getsentry/sentry-javascript/pull/17946))
82+
- fix(cloudflare): copy execution context in durable objects and handlers ([#17786](https://github.com/getsentry/sentry-javascript/pull/17786))
83+
- fix(core): Fix and add missing cache attributes in Vercel AI ([#17982](https://github.com/getsentry/sentry-javascript/pull/17982))
84+
- fix(core): Improve uuid performance ([#17938](https://github.com/getsentry/sentry-javascript/pull/17938))
85+
- fix(ember): Use updated version for `clean-css` ([#17979](https://github.com/getsentry/sentry-javascript/pull/17979))
86+
- fix(nextjs): Don't set experimental instrumentation hook flag for next 16 ([#17978](https://github.com/getsentry/sentry-javascript/pull/17978))
87+
- fix(nextjs): Inconsistent transaction naming for i18n routing ([#17927](https://github.com/getsentry/sentry-javascript/pull/17927))
88+
- fix(nextjs): Update bundler detection ([#17976](https://github.com/getsentry/sentry-javascript/pull/17976))
89+
90+
<details>
91+
<summary> <strong>Internal Changes</strong> </summary>
92+
93+
- build: Update to typescript 5.8.0 ([#17710](https://github.com/getsentry/sentry-javascript/pull/17710))
94+
- chore: Add external contributor to CHANGELOG.md ([#17949](https://github.com/getsentry/sentry-javascript/pull/17949))
95+
- chore(build): Upgrade nodemon to 3.1.10 ([#17956](https://github.com/getsentry/sentry-javascript/pull/17956))
96+
- chore(ci): Fix external contributor action when multiple contributions existed ([#17950](https://github.com/getsentry/sentry-javascript/pull/17950))
97+
- chore(solid): Remove unnecessary import from README ([#17947](https://github.com/getsentry/sentry-javascript/pull/17947))
98+
- test(nextjs): Fix proxy/middleware test ([#17970](https://github.com/getsentry/sentry-javascript/pull/17970))
99+
100+
</details>
101+
7102
Work in this release was contributed by @0xbad0c0d3. Thank you for your contribution!
8103

9104
## 10.20.0

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "10.20.0",
3+
"version": "10.22.0",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -43,7 +43,7 @@
4343
"@babel/preset-typescript": "^7.16.7",
4444
"@playwright/test": "~1.53.2",
4545
"@sentry-internal/rrweb": "2.34.0",
46-
"@sentry/browser": "10.20.0",
46+
"@sentry/browser": "10.22.0",
4747
"@supabase/supabase-js": "2.49.3",
4848
"axios": "^1.12.2",
4949
"babel-loader": "^8.2.2",

dev-packages/browser-integration-tests/suites/integrations/supabase/auth/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ sentryTest('should capture Supabase authentication errors', async ({ getLocalTes
143143
start_timestamp: expect.any(Number),
144144
timestamp: expect.any(Number),
145145
trace_id: transactionEvent.contexts?.trace?.trace_id,
146-
status: 'unknown_error',
146+
status: 'internal_error',
147147
data: expect.objectContaining({
148148
'sentry.op': 'db',
149149
'sentry.origin': 'auto.db.supabase',

dev-packages/browser-integration-tests/suites/profiling/legacyMode/subject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function fibonacci(n) {
1717
return fibonacci(n - 1) + fibonacci(n - 2);
1818
}
1919

20-
await Sentry.startSpanManual({ name: 'root-fibonacci-2', parentSpan: null, forceTransaction: true }, async span => {
20+
await Sentry.startSpanManual({ name: 'root-fibonacci', parentSpan: null, forceTransaction: true }, async span => {
2121
fibonacci(30);
2222

2323
// Timeout to prevent flaky tests. Integration samples every 20ms, if function is too fast it might not get sampled

dev-packages/browser-integration-tests/suites/profiling/legacyMode/test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,16 @@ sentryTest('sends profile envelope in legacy mode', async ({ page, getLocalTestU
7373
expect(profile.frames.length).toBeGreaterThan(0);
7474
for (const frame of profile.frames) {
7575
expect(frame).toHaveProperty('function');
76-
expect(frame).toHaveProperty('abs_path');
77-
expect(frame).toHaveProperty('lineno');
78-
expect(frame).toHaveProperty('colno');
79-
8076
expect(typeof frame.function).toBe('string');
81-
expect(typeof frame.abs_path).toBe('string');
82-
expect(typeof frame.lineno).toBe('number');
83-
expect(typeof frame.colno).toBe('number');
77+
78+
if (frame.function !== 'fetch' && frame.function !== 'setTimeout') {
79+
expect(frame).toHaveProperty('abs_path');
80+
expect(frame).toHaveProperty('lineno');
81+
expect(frame).toHaveProperty('colno');
82+
expect(typeof frame.abs_path).toBe('string');
83+
expect(typeof frame.lineno).toBe('number');
84+
expect(typeof frame.colno).toBe('number');
85+
}
8486
}
8587

8688
const functionNames = profile.frames.map(frame => frame.function).filter(name => name !== '');
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import * as Sentry from '@sentry/browser';
2+
import { browserProfilingIntegration } from '@sentry/browser';
3+
4+
window.Sentry = Sentry;
5+
6+
Sentry.init({
7+
dsn: 'https://[email protected]/1337',
8+
integrations: [browserProfilingIntegration()],
9+
tracesSampleRate: 1,
10+
profileSessionSampleRate: 1,
11+
profileLifecycle: 'trace',
12+
});
13+
14+
function largeSum(amount = 1000000) {
15+
let sum = 0;
16+
for (let i = 0; i < amount; i++) {
17+
sum += Math.sqrt(i) * Math.sin(i);
18+
}
19+
}
20+
21+
function fibonacci(n) {
22+
if (n <= 1) {
23+
return n;
24+
}
25+
return fibonacci(n - 1) + fibonacci(n - 2);
26+
}
27+
28+
// Create two NON-overlapping root spans so that the profiler stops and emits a chunk
29+
// after each span (since active root span count returns to 0 between them).
30+
await Sentry.startSpanManual({ name: 'root-fibonacci-1', parentSpan: null, forceTransaction: true }, async span => {
31+
fibonacci(40);
32+
// Ensure we cross the sampling interval to avoid flakes
33+
await new Promise(resolve => setTimeout(resolve, 25));
34+
span.end();
35+
});
36+
37+
// Small delay to ensure the first chunk is collected and sent
38+
await new Promise(r => setTimeout(r, 25));
39+
40+
await Sentry.startSpanManual({ name: 'root-largeSum-2', parentSpan: null, forceTransaction: true }, async span => {
41+
largeSum();
42+
// Ensure we cross the sampling interval to avoid flakes
43+
await new Promise(resolve => setTimeout(resolve, 25));
44+
span.end();
45+
});
46+
47+
const client = Sentry.getClient();
48+
await client?.flush(5000);

0 commit comments

Comments
 (0)