Skip to content

Commit 51e30cf

Browse files
authored
Merge branch 'develop' into ab/unpin-e2e-rr-spa
2 parents 95a2c48 + 821e986 commit 51e30cf

189 files changed

Lines changed: 2934 additions & 1158 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.

.eslintrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ module.exports = {
2323
'types/**',
2424
'scripts/*.js',
2525
],
26+
rules: {
27+
'@typescript-eslint/no-explicit-any': 'error',
28+
},
2629
reportUnusedDisableDirectives: true,
2730
overrides: [
2831
{
@@ -36,6 +39,9 @@ module.exports = {
3639
parserOptions: {
3740
project: ['tsconfig.test.json'],
3841
},
42+
rules: {
43+
'@typescript-eslint/no-explicit-any': 'off',
44+
},
3945
},
4046
{
4147
files: ['scripts/**/*.ts'],

.github/workflows/build.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
needs.job_get_metadata.outputs.changed_any_code == 'true' ||
129129
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
130130
needs.job_get_metadata.outputs.is_release == 'true' ||
131-
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false')
131+
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false' && needs.job_get_metadata.outputs.changed_any_code == 'true')
132132
steps:
133133
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
134134
uses: actions/checkout@v6
@@ -1144,15 +1144,6 @@ jobs:
11441144
retention-days: 7
11451145
if-no-files-found: ignore
11461146

1147-
- name: Deploy Astro to Cloudflare
1148-
uses: cloudflare/wrangler-action@v3
1149-
if: matrix.test-application == 'cloudflare-astro'
1150-
with:
1151-
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
1152-
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
1153-
command: pages deploy dist --project-name=${{ secrets.CLOUDFLARE_PROJECT_NAME }}
1154-
workingDirectory: ${{ runner.temp }}/test-application
1155-
11561147
job_required_jobs_passed:
11571148
name: All required jobs passed or were skipped
11581149
needs:

.size-limit.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,27 @@ module.exports = [
112112
gzip: true,
113113
limit: '35 KB',
114114
},
115+
{
116+
name: '@sentry/browser (incl. Metrics)',
117+
path: 'packages/browser/build/npm/esm/prod/index.js',
118+
import: createImport('init', 'metrics'),
119+
gzip: true,
120+
limit: '27 KB',
121+
},
122+
{
123+
name: '@sentry/browser (incl. Logs)',
124+
path: 'packages/browser/build/npm/esm/prod/index.js',
125+
import: createImport('init', 'logger'),
126+
gzip: true,
127+
limit: '27 KB',
128+
},
129+
{
130+
name: '@sentry/browser (incl. Metrics & Logs)',
131+
path: 'packages/browser/build/npm/esm/prod/index.js',
132+
import: createImport('init', 'metrics', 'logger'),
133+
gzip: true,
134+
limit: '28 KB',
135+
},
115136
// React SDK (ESM)
116137
{
117138
name: '@sentry/react',
@@ -213,7 +234,7 @@ module.exports = [
213234
import: createImport('init'),
214235
ignore: ['next/router', 'next/constants'],
215236
gzip: true,
216-
limit: '46 KB',
237+
limit: '46.5 KB',
217238
},
218239
// SvelteKit SDK (ESM)
219240
{

CHANGELOG.md

Lines changed: 107 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,118 @@
44

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

7-
- **feat(nextjs): Add tree-shaking configuration to `webpack` build config ([#18359](https://github.com/getsentry/sentry-javascript/pull/18359))**
7+
## 10.32.1
8+
9+
- fix(cloudflare): Add hono transaction name when error is thrown ([#18529](https://github.com/getsentry/sentry-javascript/pull/18529))
10+
- fix(ember): Make `implementation` field optional (`hash` routes) ([#18564](https://github.com/getsentry/sentry-javascript/pull/18564))
11+
- fix(vercelai): Fix input token count ([#18574](https://github.com/getsentry/sentry-javascript/pull/18574))
12+
13+
<details>
14+
<summary> <strong>Internal Changes</strong> </summary>
15+
16+
- chore(lint): prefer 'unknown' to 'any', fix lint warnings
17+
- chore(test): Remove `cloudflare-astro` e2e test ([#18567](https://github.com/getsentry/sentry-javascript/pull/18567))
18+
19+
</details>
20+
21+
## 10.32.0
22+
23+
### Important Changes
24+
25+
- **feat(core): Apply scope attributes to logs ([#18184](https://github.com/getsentry/sentry-javascript/pull/18184))**
26+
27+
You can now set attributes on the SDK's scopes which will be applied to all logs as long as the respective scopes are active. For the time being, only `string`, `number` and `boolean` attribute values are supported.
28+
29+
```ts
30+
Sentry.geGlobalScope().setAttributes({ is_admin: true, auth_provider: 'google' });
31+
32+
Sentry.withScope(scope => {
33+
scope.setAttribute('step', 'authentication');
34+
35+
// scope attributes `is_admin`, `auth_provider` and `step` are added
36+
Sentry.logger.info(`user ${user.id} logged in`, { activeSince: 100 });
37+
Sentry.logger.info(`updated ${user.id} last activity`);
38+
});
39+
40+
// scope attributes `is_admin` and `auth_provider` are added
41+
Sentry.logger.warn('stale website version, reloading page');
42+
```
843

944
- **feat(replay): Add Request body with `attachRawBodyFromRequest` option ([#18501](https://github.com/getsentry/sentry-javascript/pull/18501))**
1045

11-
To attach the raw request body (from `Request` objects passed as the first `fetch` argument) to replay events,
12-
you can now use the `attachRawBodyFromRequest` option in the Replay integration:
46+
To attach the raw request body (from `Request` objects passed as the first `fetch` argument) to replay events, you can now use the `attachRawBodyFromRequest` option in the Replay integration:
1347

14-
```js
15-
Sentry.init({
16-
integrations: [
17-
Sentry.replayIntegration({
18-
attachRawBodyFromRequest: true,
48+
```js
49+
Sentry.init({
50+
integrations: [
51+
Sentry.replayIntegration({
52+
attachRawBodyFromRequest: true,
53+
}),
54+
],
55+
});
56+
```
57+
58+
- **feat(tanstackstart-react): Trace server functions ([#18500](https://github.com/getsentry/sentry-javascript/pull/18500))**
59+
60+
To enable tracing for server-side requests, you can now explicitly define a [server entry point](https://tanstack.com/start/latest/docs/framework/react/guide/server-entry-point) in your application and wrap your request handler with `wrapFetchWithSentry`.
61+
62+
```typescript
63+
// src/server.ts
64+
import { wrapFetchWithSentry } from '@sentry/tanstackstart-react';
65+
import handler, { createServerEntry } from '@tanstack/react-start/server-entry';
66+
67+
export default createServerEntry(
68+
wrapFetchWithSentry({
69+
fetch(request: Request) {
70+
return handler.fetch(request);
71+
},
1972
}),
20-
],
21-
});
22-
```
73+
);
74+
```
75+
76+
- **feat(vue): Add TanStack Router integration ([#18547](https://github.com/getsentry/sentry-javascript/pull/18547))**
77+
78+
The `@sentry/vue` package now includes support for TanStack Router. Use `tanstackRouterBrowserTracingIntegration` to automatically instrument pageload and navigation transactions with parameterized routes:
79+
80+
```javascript
81+
import { createApp } from 'vue';
82+
import { createRouter } from '@tanstack/vue-router';
83+
import * as Sentry from '@sentry/vue';
84+
import { tanstackRouterBrowserTracingIntegration } from '@sentry/vue/tanstackrouter';
85+
86+
const router = createRouter({
87+
// your router config
88+
});
89+
90+
Sentry.init({
91+
app,
92+
dsn: '__PUBLIC_DSN__',
93+
integrations: [tanstackRouterBrowserTracingIntegration(router)],
94+
tracesSampleRate: 1.0,
95+
});
96+
```
97+
98+
### Other Changes
99+
100+
- feat(core): Capture initialize attributes on MCP servers ([#18531](https://github.com/getsentry/sentry-javascript/pull/18531))
101+
- feat(nextjs): Extract tracing logic from server component wrapper templates ([#18408](https://github.com/getsentry/sentry-javascript/pull/18408))
102+
- feat(nextjs): added webpack treeshaking flags as config ([#18359](https://github.com/getsentry/sentry-javascript/pull/18359))
103+
- fix(solid/tanstackrouter): Ensure web vitals are sent on pageload ([#18542](https://github.com/getsentry/sentry-javascript/pull/18542))
104+
105+
<details>
106+
<summary> <strong>Internal Changes</strong> </summary>
107+
108+
- chore(changelog): Add entry for scope attributes ([#18555](https://github.com/getsentry/sentry-javascript/pull/18555))
109+
- chore(changelog): Add entry for tanstack start wrapFetchWithSentry ([#18558](https://github.com/getsentry/sentry-javascript/pull/18558))
110+
- chore(deps): bump @trpc/server from 10.45.2 to 10.45.3 in /dev-packages/e2e-tests/test-applications/node-express-incorrect-instrumentation ([#18530](https://github.com/getsentry/sentry-javascript/pull/18530))
111+
- chore(deps): bump @trpc/server from 10.45.2 to 10.45.3 in /dev-packages/e2e-tests/test-applications/node-express-v5 ([#18550](https://github.com/getsentry/sentry-javascript/pull/18550))
112+
- chore(e2e): Pin to react-router 7.10.1 in spa e2e test ([#18548](https://github.com/getsentry/sentry-javascript/pull/18548))
113+
- chore(e2e): Remove check on `http.response_content_length_uncompressed` ([#18536](https://github.com/getsentry/sentry-javascript/pull/18536))
114+
- chore(github): Add "Closes" to PR template ([#18538](https://github.com/getsentry/sentry-javascript/pull/18538))
115+
- test(cloudflare-mcp): Unpin mcp sdk ([#18528](https://github.com/getsentry/sentry-javascript/pull/18528))
116+
- test(nextjs): Add e2e tests for server component spans in next 16 ([#18544](https://github.com/getsentry/sentry-javascript/pull/18544))
117+
118+
</details>
23119

24120
## 10.31.0
25121

dev-packages/.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
extends: ['../.eslintrc.js'],
3+
rules: {
4+
// tests often have just cause to do evil
5+
'@typescript-eslint/no-explicit-any': 'off',
6+
},
7+
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
node: true,
55
},
66
// todo: remove regexp plugin from here once we add it to base.js eslint config for the whole project
7-
extends: ['../../.eslintrc.js', 'plugin:regexp/recommended'],
7+
extends: ['../.eslintrc.js', 'plugin:regexp/recommended'],
88
plugins: ['regexp'],
99
ignorePatterns: [
1010
'suites/**/subject.js',

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.31.0",
3+
"version": "10.32.1",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -43,7 +43,7 @@
4343
"@babel/preset-typescript": "^7.16.7",
4444
"@playwright/test": "~1.56.0",
4545
"@sentry-internal/rrweb": "2.34.0",
46-
"@sentry/browser": "10.31.0",
46+
"@sentry/browser": "10.32.1",
4747
"@supabase/supabase-js": "2.49.3",
4848
"axios": "^1.12.2",
4949
"babel-loader": "^8.2.2",

dev-packages/browser-integration-tests/suites/public-api/logger/integration/test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { expect } from '@playwright/test';
22
import type { LogEnvelope } from '@sentry/core';
33
import { sentryTest } from '../../../../utils/fixtures';
4-
import { getFirstSentryEnvelopeRequest, properFullEnvelopeRequestParser } from '../../../../utils/helpers';
4+
import {
5+
getFirstSentryEnvelopeRequest,
6+
properFullEnvelopeRequestParser,
7+
testingCdnBundle,
8+
} from '../../../../utils/helpers';
59

610
sentryTest('should capture console object calls', async ({ getLocalTestUrl, page }) => {
7-
const bundle = process.env.PW_BUNDLE || '';
811
// Only run this for npm package exports
9-
if (bundle.startsWith('bundle') || bundle.startsWith('loader')) {
10-
sentryTest.skip();
11-
}
12+
sentryTest.skip(testingCdnBundle());
1213

1314
const url = await getLocalTestUrl({ testDir: __dirname });
1415

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// only log attribute
2+
Sentry.logger.info('log_before_any_scope', { log_attr: 'log_attr_1' });
3+
4+
Sentry.getGlobalScope().setAttributes({ global_scope_attr: true });
5+
6+
// this attribute will not be sent for now
7+
Sentry.getGlobalScope().setAttribute('array_attr', [1, 2, 3]);
8+
9+
// global scope, log attribute
10+
Sentry.logger.info('log_after_global_scope', { log_attr: 'log_attr_2' });
11+
12+
Sentry.withIsolationScope(isolationScope => {
13+
isolationScope.setAttribute('isolation_scope_1_attr', { value: 100, unit: 'millisecond' });
14+
15+
// global scope, isolation scope, log attribute
16+
Sentry.logger.info('log_with_isolation_scope', { log_attr: 'log_attr_3' });
17+
18+
Sentry.withScope(scope => {
19+
scope.setAttributes({ scope_attr: { value: 200, unit: 'millisecond' } });
20+
21+
// global scope, isolation scope, current scope attribute, log attribute
22+
Sentry.logger.info('log_with_scope', { log_attr: 'log_attr_4' });
23+
});
24+
25+
Sentry.withScope(scope2 => {
26+
scope2.setAttribute('scope_2_attr', { value: 300, unit: 'millisecond' });
27+
28+
// global scope, isolation scope, current scope attribute, log attribute
29+
Sentry.logger.info('log_with_scope_2', { log_attr: 'log_attr_5' });
30+
});
31+
});
32+
33+
Sentry.flush();
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import { expect } from '@playwright/test';
2+
import type { LogEnvelope } from '@sentry/core';
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import {
5+
getFirstSentryEnvelopeRequest,
6+
properFullEnvelopeRequestParser,
7+
testingCdnBundle,
8+
} from '../../../../utils/helpers';
9+
10+
sentryTest('captures logs with scope attributes', async ({ getLocalTestUrl, page }) => {
11+
sentryTest.skip(testingCdnBundle());
12+
13+
const url = await getLocalTestUrl({ testDir: __dirname });
14+
15+
const event = await getFirstSentryEnvelopeRequest<LogEnvelope>(page, url, properFullEnvelopeRequestParser);
16+
const envelopeItems = event[1];
17+
18+
expect(envelopeItems[0]).toEqual([
19+
{
20+
type: 'log',
21+
item_count: 5,
22+
content_type: 'application/vnd.sentry.items.log+json',
23+
},
24+
{
25+
items: [
26+
{
27+
timestamp: expect.any(Number),
28+
level: 'info',
29+
body: 'log_before_any_scope',
30+
severity_number: 9,
31+
trace_id: expect.any(String),
32+
attributes: {
33+
'sentry.sdk.name': { value: 'sentry.javascript.browser', type: 'string' },
34+
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
35+
log_attr: { value: 'log_attr_1', type: 'string' },
36+
},
37+
},
38+
{
39+
timestamp: expect.any(Number),
40+
level: 'info',
41+
body: 'log_after_global_scope',
42+
severity_number: 9,
43+
trace_id: expect.any(String),
44+
attributes: {
45+
'sentry.sdk.name': { value: 'sentry.javascript.browser', type: 'string' },
46+
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
47+
global_scope_attr: { value: true, type: 'boolean' },
48+
log_attr: { value: 'log_attr_2', type: 'string' },
49+
},
50+
},
51+
{
52+
timestamp: expect.any(Number),
53+
level: 'info',
54+
body: 'log_with_isolation_scope',
55+
severity_number: 9,
56+
trace_id: expect.any(String),
57+
attributes: {
58+
'sentry.sdk.name': { value: 'sentry.javascript.browser', type: 'string' },
59+
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
60+
global_scope_attr: { value: true, type: 'boolean' },
61+
isolation_scope_1_attr: { value: 100, unit: 'millisecond', type: 'integer' },
62+
log_attr: { value: 'log_attr_3', type: 'string' },
63+
},
64+
},
65+
{
66+
timestamp: expect.any(Number),
67+
level: 'info',
68+
body: 'log_with_scope',
69+
severity_number: 9,
70+
trace_id: expect.any(String),
71+
attributes: {
72+
'sentry.sdk.name': { value: 'sentry.javascript.browser', type: 'string' },
73+
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
74+
global_scope_attr: { value: true, type: 'boolean' },
75+
isolation_scope_1_attr: { value: 100, unit: 'millisecond', type: 'integer' },
76+
scope_attr: { value: 200, unit: 'millisecond', type: 'integer' },
77+
log_attr: { value: 'log_attr_4', type: 'string' },
78+
},
79+
},
80+
{
81+
timestamp: expect.any(Number),
82+
level: 'info',
83+
body: 'log_with_scope_2',
84+
severity_number: 9,
85+
trace_id: expect.any(String),
86+
attributes: {
87+
'sentry.sdk.name': { value: 'sentry.javascript.browser', type: 'string' },
88+
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
89+
global_scope_attr: { value: true, type: 'boolean' },
90+
isolation_scope_1_attr: { value: 100, unit: 'millisecond', type: 'integer' },
91+
scope_2_attr: { value: 300, unit: 'millisecond', type: 'integer' },
92+
log_attr: { value: 'log_attr_5', type: 'string' },
93+
},
94+
},
95+
],
96+
},
97+
]);
98+
});

0 commit comments

Comments
 (0)