Skip to content

Commit f3bf884

Browse files
committed
Merge branch 'develop' of https://github.com/getsentry/sentry-javascript into feature/parameterize-public-api
2 parents 1ee501c + 5f0b506 commit f3bf884

File tree

327 files changed

+4556
-1938
lines changed

Some content is hidden

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

327 files changed

+4556
-1938
lines changed

.craft.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ targets:
3232
- name: npm
3333
id: '@sentry-internal/feedback'
3434
includeNames: /^sentry-internal-feedback-\d.*\.tgz$/
35+
## 1.8 ReplayCanvas package (browser only)
36+
- name: npm
37+
id: '@sentry-internal/replay-canvas'
38+
includeNames: /^sentry-internal-replay-canvas-\d.*\.tgz$/
3539

3640
## 2. Browser & Node SDKs
3741
- name: npm

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ ef6b3c7877d5fc8031c08bb28b0ffafaeb01f501
1212

1313
# chore: Enforce formatting of MD files in repository root #10127
1414
aecf26f22dbf65ce2c0caadc4ce71b46266c9f45
15+
16+
# chore: Create dev-packages folder #9997
17+
35205b4cc5783237e69452c39ea001e461d9c84d

.github/workflows/build.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ jobs:
100100
- *shared
101101
- 'packages/browser/**'
102102
- 'packages/replay/**'
103+
- 'packages/replay-canvas/**'
103104
- 'packages/feedback/**'
104105
browser_integration:
105106
- *shared
@@ -371,6 +372,7 @@ jobs:
371372
${{ github.workspace }}/packages/browser/build/bundles/**
372373
${{ github.workspace }}/packages/integrations/build/bundles/**
373374
${{ github.workspace }}/packages/replay/build/bundles/**
375+
${{ github.workspace }}/packages/replay-canvas/build/bundles/**
374376
${{ github.workspace }}/packages/**/*.tgz
375377
${{ github.workspace }}/packages/serverless/build/aws/dist-serverless/*.zip
376378
@@ -776,8 +778,14 @@ jobs:
776778
strategy:
777779
fail-fast: false
778780
matrix:
779-
node: [14, 16, 18, 20, 21]
781+
node: [18, 20, 21]
780782
remix: [1, 2]
783+
# Remix v2 only supports Node 18+, so run Node 14, 16 tests separately
784+
include:
785+
- node: 14
786+
remix: 1
787+
- node: 16
788+
remix: 1
781789
steps:
782790
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
783791
uses: actions/checkout@v4
@@ -863,8 +871,9 @@ jobs:
863871
'node-express-app',
864872
'create-react-app',
865873
'create-next-app',
866-
'create-remix-app',
867-
'create-remix-app-v2',
874+
# disabling remix e2e tests because of flakes
875+
# 'create-remix-app',
876+
# 'create-remix-app-v2',
868877
'debug-id-sourcemaps',
869878
'nextjs-app-dir',
870879
'nextjs-14',

.size-limit.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ module.exports = [
1414
gzip: true,
1515
limit: '75 KB',
1616
},
17+
{
18+
name: '@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped)',
19+
path: 'packages/browser/build/npm/esm/index.js',
20+
import: '{ init, Replay, BrowserTracing, ReplayCanvas }',
21+
gzip: true,
22+
limit: '90 KB',
23+
},
1724
{
1825
name: '@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped)',
1926
path: 'packages/browser/build/npm/esm/index.js',
@@ -47,6 +54,13 @@ module.exports = [
4754
gzip: true,
4855
limit: '50 KB',
4956
},
57+
{
58+
name: '@sentry/browser (incl. sendFeedback) - Webpack (gzipped)',
59+
path: 'packages/browser/build/npm/esm/index.js',
60+
import: '{ init, sendFeedback }',
61+
gzip: true,
62+
limit: '50 KB',
63+
},
5064
{
5165
name: '@sentry/browser - Webpack (gzipped)',
5266
path: 'packages/browser/build/npm/esm/index.js',

CHANGELOG.md

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

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

7+
## 7.94.1
8+
9+
This release fixes a publishing issue.
10+
11+
## 7.94.0
12+
13+
### Important Changes
14+
15+
#### Deprecations
16+
17+
As we're moving closer to the next major version of the SDK, more public APIs were deprecated.
18+
19+
To get a head start on migrating to the replacement APIs, please take a look at our
20+
[migration guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md).
21+
22+
- feat: Deprecate user segment field (#10210)
23+
- feat(core): Deprecate `finish` on `Span` interface in favour of `end` (#10161)
24+
- feat(core): Deprecate `getCurrentHub()` (#10200)
25+
- feat(core): Deprecate `hub.bindClient()` & `makeMain()` (#10188)
26+
- feat(core): Deprecate `Span.instrumenter` (#10139)
27+
- feat(core): Deprecate `Span.isSuccess()` in favor of reading span status (#10213)
28+
- feat(core): Deprecate `Span.op` in favor of op attribute (#10189)
29+
- feat(core): Deprecate `Span.spanRecorder` (#10199)
30+
- feat(core): Deprecate `Span.status` (#10208)
31+
- feat(core): Deprecate `Span.transaction` in favor of `getRootSpan` (#10134)
32+
- feat(core): Deprecate `Transaction.instrumenter` (#10162)
33+
- feat(core): Deprecate `Transaction.setMeasurement` in favor of `setMeasurement` (#10182)
34+
- feat(core): Deprecate integration classes & `Integrations.X` (#10198)
35+
- feat(core): Deprecate methods on `Hub` (#10124)
36+
- feat(core): Deprecate remaining `setName` declarations on `Transaction` and `Span` (#10164)
37+
- feat(core): Deprecate span `startTimestamp` & `endTimestamp` (#10192)
38+
- feat(core): Deprecate `hub.bindClient()` and `makeMain()` (#10118)
39+
- feat(types): Deprecate `op` on `Span` interface (#10217)
40+
- feat(integrations): Deprecate `Transaction` integration (#10178)
41+
- feat(integrations): Deprecate pluggable integration classes (#10211)
42+
43+
#### Replay & Canvas
44+
45+
We have added a new `ReplayCanvas` integration (#10112), which you can add to capture the contents of canvas elements
46+
with Replay.
47+
48+
Just add it _in addition_ to the regular replay integration:
49+
50+
```js
51+
Sentry.init({
52+
integrations: [new Sentry.Replay(), new Sentry.ReplayCanvas()],
53+
});
54+
```
55+
56+
### Other Changes
57+
58+
- feat(core): Add `client.getIntegrationByName()` (#10130)
59+
- feat(core): Add `client.init()` to replace `client.setupIntegrations()` (#10118)
60+
- feat(core): Add `withActiveSpan` (#10195)
61+
- feat(core): Add `withIsolationScope` (#10141)
62+
- feat(core): Streamline integration function results to be compatible (#10135)
63+
- feat(core): Write data from `setUser`, `setTags`, `setExtras`, `setTag`, `setExtra`, and `setContext` to isolation
64+
scope (#10163)
65+
- feat(core): Add domain information to resource span data #10205
66+
- feat(feedback): Export sendFeedback from @sentry/browser (#10231)
67+
- feat(node): Update and vendor https-proxy-agent (#10088)
68+
- feat(node-experimental): Add `withActiveSpan` (#10194)
69+
- feat(replays): Add snapshot function to replay canvas integration (#10066)
70+
- feat(types): Add `SerializedEvent` interface (pre v8) (#10240)
71+
- feat(types): Add support for new monitor config thresholds (#10225)
72+
- fix: Ensure all integration classes have correct types (#10183)
73+
- fix(astro): Fix import path when using external init files with default path (#10214)
74+
- fix(cdn): Emit console warning instead of error for integration shims (#10193)
75+
- fix(core): Take user from current scope when starting a session (#10153)
76+
- fix(node-experimental): Ensure `http.status_code` is always a string (#10177)
77+
- fix(node): Guard against `process.argv[1]` being undefined (#10155)
78+
- fix(node): Module name resolution (#10144)
79+
- fix(node): Remove leading slash in Windows filenames (#10147)
80+
- fix(remix): Capture thrown fetch responses. (#10166)
81+
- fix(tracing): Gate mongo operation span data behind sendDefaultPii (#10227)
82+
- fix(tracing-internal): Delay pageload transaction finish until document is interactive (#10215)
83+
- fix(tracing-internal): Only collect request/response spans when browser performance timing is available (#10207)
84+
- fix(tracing-internal): Prefer `fetch` init headers over `fetch` input headers (#10176)
85+
- fix(utils): Ensure dropUndefinedKeys() does not break class instances (#10245)
86+
787
## 7.93.0
888

989
### Important Changes

MIGRATION.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,33 @@ npx @sentry/migr8@latest
1010
This will let you select which updates to run, and automatically update your code. Make sure to still review all code
1111
changes!
1212

13+
## Deprecate `getCurrentHub()`
14+
15+
In v8, you will no longer have a Hub, only Scopes as a concept. This also means that `getCurrentHub()` will eventually
16+
be removed.
17+
18+
Instead of `getCurrentHub()`, use the respective replacement API directly - see [Deprecate Hub](#deprecate-hub) for
19+
details.
20+
21+
## Deprecate class-based integrations
22+
23+
In v7, integrations are classes and can be added as e.g. `integrations: [new Sentry.Integrations.ContextLines()]`. In
24+
v8, integrations will not be classes anymore, but instead functions. Both the use as a class, as well as accessing
25+
integrations from the `Integrations.XXX` hash, is deprecated in favor of using the new functional integrations
26+
27+
- for example, `new Integrations.LinkedErrors()` becomes `linkedErrorsIntegration()`.
28+
29+
The following list shows how integrations should be migrated:
30+
31+
| Old | New | Packages |
32+
| ------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------- |
33+
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
34+
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
35+
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
36+
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
37+
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
38+
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
39+
1340
## Deprecate `hub.bindClient()` and `makeMain()`
1441

1542
Instead, either directly use `initAndBind()`, or the new APIs `setCurrentClient()` and `client.init()`. See
@@ -54,7 +81,7 @@ If you are using the `Hub` right now, see the following table on how to migrate
5481
| ---------------------- | ------------------------------------------------------------------------------------ |
5582
| `new Hub()` | `withScope()`, `withIsolationScope()` or `new Scope()` |
5683
| hub.isOlderThan() | REMOVED - Was used to compare `Hub` instances, which are gonna be removed |
57-
| hub.bindClient() | A combination of `scope.setClient()` and `client.setupIntegrations()` |
84+
| hub.bindClient() | A combination of `scope.setClient()` and `client.init()` |
5885
| hub.pushScope() | `Sentry.withScope()` |
5986
| hub.popScope() | `Sentry.withScope()` |
6087
| hub.withScope() | `Sentry.withScope()` |
@@ -167,6 +194,7 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
167194
- `span.getTraceContext()`: Use `spanToTraceContext(span)` utility function instead.
168195
- `span.sampled`: Use `span.isRecording()` instead.
169196
- `span.spanId`: Use `span.spanContext().spanId` instead.
197+
- `span.parentSpanId`: Use `spanToJSON(span).parent_span_id` instead.
170198
- `span.traceId`: Use `span.spanContext().traceId` instead.
171199
- `span.name`: Use `spanToJSON(span).description` instead.
172200
- `span.description`: Use `spanToJSON(span).description` instead.
@@ -178,6 +206,9 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
178206
- `span.instrumenter` This field was removed and will be replaced internally.
179207
- `span.transaction`: Use `getRootSpan` utility function instead.
180208
- `span.spanRecorder`: Span recording will be handled internally by the SDK.
209+
- `span.status`: Use `.setStatus` to set or update and `spanToJSON()` to read the span status.
210+
- `span.op`: Use `startSpan` functions to set, `setAttribute()` to update and `spanToJSON` to read the span operation.
211+
- `span.isSuccess`: Use `spanToJSON(span).status === 'ok'` instead.
181212
- `transaction.setMetadata()`: Use attributes instead, or set data on the scope.
182213
- `transaction.metadata`: Use attributes instead, or set data on the scope.
183214
- `transaction.setContext()`: Set context on the surrounding scope instead.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "7.93.0",
3+
"version": "7.94.1",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -45,9 +45,9 @@
4545
"dependencies": {
4646
"@babel/preset-typescript": "^7.16.7",
4747
"@playwright/test": "^1.31.1",
48-
"@sentry-internal/rrweb": "2.7.3",
49-
"@sentry/browser": "7.93.0",
50-
"@sentry/tracing": "7.93.0",
48+
"@sentry-internal/rrweb": "2.9.0",
49+
"@sentry/browser": "7.94.1",
50+
"@sentry/tracing": "7.94.1",
5151
"axios": "1.6.0",
5252
"babel-loader": "^8.2.2",
5353
"html-webpack-plugin": "^5.5.0",
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
beforeSend(event) {
8+
Sentry.captureUserFeedback({
9+
event_id: event.event_id,
10+
name: 'John Doe',
11+
12+
comments: 'This feedback should be attached associated with the captured error',
13+
});
14+
return event;
15+
},
16+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Sentry.captureException(new Error('Error with Feedback'));
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event, UserFeedback } from '@sentry/types';
3+
4+
import { sentryTest } from '../../../../utils/fixtures';
5+
import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers';
6+
7+
sentryTest('capture user feedback when captureException is called', async ({ getLocalTestPath, page }) => {
8+
const url = await getLocalTestPath({ testDir: __dirname });
9+
10+
const data = (await getMultipleSentryEnvelopeRequests(page, 2, { url })) as (Event | UserFeedback)[];
11+
12+
expect(data).toHaveLength(2);
13+
14+
const errorEvent = ('exception' in data[0] ? data[0] : data[1]) as Event;
15+
const feedback = ('exception' in data[0] ? data[1] : data[0]) as UserFeedback;
16+
17+
expect(feedback).toEqual({
18+
comments: 'This feedback should be attached associated with the captured error',
19+
20+
event_id: errorEvent.event_id,
21+
name: 'John Doe',
22+
});
23+
});

0 commit comments

Comments
 (0)