Skip to content

Commit 3e8a91c

Browse files
author
Luca Forstner
authored
Merge pull request #11472 from getsentry/prepare-release/8.0.0-alpha.8
2 parents 9eb71c2 + 5a03483 commit 3e8a91c

File tree

742 files changed

+9340
-28836
lines changed

Some content is hidden

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

742 files changed

+9340
-28836
lines changed

.craft.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ targets:
1616
- name: npm
1717
id: '@sentry/core'
1818
includeNames: /^sentry-core-\d.*\.tgz$/
19-
## 1.4 Tracing package
19+
## 1.4 Browser Utils package
2020
- name: npm
21-
id: '@sentry-internal/tracing'
22-
includeNames: /^sentry-internal-tracing-\d.*\.tgz$/
21+
id: '@sentry-internal/browser-utils'
22+
includeNames: /^sentry-internal-browser-utils-\d.*\.tgz$/
2323
## 1.5 Replay Internal package (browser only)
2424
- name: npm
2525
id: '@sentry-internal/replay'

.eslintrc.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,19 @@ module.exports = {
5151
},
5252
},
5353
{
54-
files: ['scenarios/**', 'dev-packages/rollup-utils/**'],
54+
files: ['scenarios/**', 'dev-packages/rollup-utils/**', 'dev-packages/bundle-analyzer-scenarios/**'],
5555
parserOptions: {
5656
sourceType: 'module',
5757
},
5858
rules: {
5959
'no-console': 'off',
6060
},
6161
},
62+
{
63+
files: ['vite.config.ts'],
64+
parserOptions: {
65+
project: ['tsconfig.test.json'],
66+
},
67+
},
6268
],
6369
};

.git-blame-ignore-revs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,11 @@ ef6b3c7877d5fc8031c08bb28b0ffafaeb01f501
1313
# chore: Enforce formatting of MD files in repository root #10127
1414
aecf26f22dbf65ce2c0caadc4ce71b46266c9f45
1515

16-
# chore: Create dev-packages folder #9997
16+
# chore: Create dev-packages folder #9997
1717
35205b4cc5783237e69452c39ea001e461d9c84d
18+
19+
# ref: Move node & node-experimental folders #11309
20+
# As well as revert and re-revert of this
21+
971b51d4b8e92aa1b93c51074e28c7cbed63b486
22+
ebc9b539548953bb9dd81d6a18adcdd91e804563
23+
c88ff463a5566194a454b58bc555f183cf9ee813

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,12 @@ jobs:
9696
- 'scripts/**'
9797
- 'packages/core/**'
9898
- 'packages/rollup-utils/**'
99-
- 'packages/tracing/**'
100-
- 'packages/tracing-internal/**'
10199
- 'packages/utils/**'
102100
- 'packages/types/**'
103101
browser: &browser
104102
- *shared
105103
- 'packages/browser/**'
104+
- 'packages/browser-utils/**'
106105
- 'packages/replay/**'
107106
- 'packages/replay-canvas/**'
108107
- 'packages/feedback/**'
@@ -118,7 +117,6 @@ jobs:
118117
node:
119118
- *shared
120119
- 'packages/node/**'
121-
- 'packages/node-experimental/**'
122120
- 'dev-packages/node-integration-tests/**'
123121
nextjs:
124122
- *shared
@@ -135,7 +133,6 @@ jobs:
135133
profiling_node:
136134
- *shared
137135
- 'packages/node/**'
138-
- 'packages/node-experimental/**'
139136
- 'packages/profiling-node/**'
140137
- 'dev-packages/e2e-tests/test-applications/node-profiling/**'
141138
profiling_node_bindings:
@@ -1039,6 +1036,7 @@ jobs:
10391036
'create-remix-app-v2',
10401037
'create-remix-app-express-vite-dev',
10411038
'debug-id-sourcemaps',
1039+
# 'esm-loader-node-express-app', # This is currently broken for upstream reasons. See https://github.com/getsentry/sentry-javascript/pull/11338#issuecomment-2025450675
10421040
'nextjs-app-dir',
10431041
'nextjs-14',
10441042
'react-create-hash-router',
@@ -1050,8 +1048,11 @@ jobs:
10501048
'node-fastify-app',
10511049
# TODO(v8): Re-enable hapi tests
10521050
# 'node-hapi-app',
1051+
'node-nestjs-app',
10531052
'node-exports-test-app',
1053+
'node-koa-app',
10541054
'vue-3',
1055+
'webpack-4',
10551056
'webpack-5'
10561057
]
10571058
build-command:

.github/workflows/flaky-test-detector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_dispatch:
44
pull_request:
55
paths:
6-
- 'dev-packages/browser-integration-tests/suites/**'
6+
- 'dev-packages/browser-integration-tests/suites/**/test.ts'
77
branches-ignore:
88
- master
99

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@
3838
"editor.codeActionsOnSave": {
3939
"source.organizeImports.biome": "explicit",
4040
},
41-
"editor.defaultFormatter": "biomejs.biome"
41+
"editor.defaultFormatter": "biomejs.biome",
42+
"[typescript]": {
43+
"editor.defaultFormatter": "biomejs.biome"
44+
}
4245
}

CHANGELOG.md

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

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

7+
## 8.0.0-alpha.8
8+
9+
This is the eighth alpha release of Sentry JavaScript SDK v8, which includes a variety of breaking changes.
10+
11+
Read the [in-depth migration guide](./MIGRATION.md) to find out how to address any breaking changes in your code.
12+
13+
### Important Changes
14+
15+
- **feat: Add @sentry-internal/browser-utils (#11381)**
16+
17+
A big part of the browser-runtime specific exports of the internal `@sentry/utils` package were moved into a new package
18+
`@sentry-internal/browser-utils`. If you imported any API from `@sentry/utils` (which is generally not recommended but
19+
necessary for some workarounds), please check that your import statements still point to existing exports after
20+
upgrading.
21+
22+
- **feat: Add loader file to node-based SDKs to support ESM monkeypatching (#11338)**
23+
24+
When using ESM, it is necessary to use a "loader" to be able to instrument certain third-party packages and Node.js API.
25+
The server-side SDKs now ship with a set of ESM loader hooks, that should be used when using ESM. Use them as follows:
26+
27+
```sh
28+
# For Node.js <= 18.18.2
29+
node --experimental-loader=@sentry/node/hook your-app.js
30+
31+
# For Node.js >= 18.19.0
32+
node --import=@sentry/node/register your-app.js
33+
```
34+
35+
Please note that due to an upstream bug, these loader hooks will currently crash or simply not work. We are planning to
36+
fix this in upcoming versions of the SDK - definitely before a stable version 8 release.
37+
38+
- **feat(node): Add Koa error handler (#11403)**
39+
- **feat(node): Add NestJS error handler (#11375)**
40+
41+
The Sentry SDK now exports integrations and error middlewares for Koa (`koaIntegration()`, `setupKoaErrorHandler()`) and
42+
NestJS (`setupNestErrorHandler()`) that can be used to instrument your Koa and NestJS applications with error
43+
monitoring.
44+
45+
### Removal/Refactoring of deprecated functionality
46+
47+
- feat(core): Remove hub check in isSentryRequestUrl (#11407)
48+
- feat(opentelemetry): Remove top level startActiveSpan (#11380)
49+
- feat(types): `beforeSend` and `beforeSendTransaction` breaking changes (#11354)
50+
- feat(v8): Remove all class based integrations (#11345)
51+
- feat(v8/core): Remove span.attributes top level field (#11378)
52+
- ref: Remove convertIntegrationFnToClass (#11343)
53+
- ref(node): Remove the old `node` package (#11322)
54+
- ref(tracing): Remove `span.startChild()` (#11376)
55+
- ref(v8): Remove `addRequestDataToTransaction` util (#11369)
56+
- ref(v8): Remove `args` on `HandlerDataXhr` (#11373)
57+
- ref(v8): Remove `getGlobalObject` utility method (#11372)
58+
- ref(v8): Remove `metadata` on transaction (#11397)
59+
- ref(v8): Remove `pushScope`, `popScope`, `isOlderThan`, `shouldSendDefaultPii` from hub (#11404)
60+
- ref(v8): Remove `shouldCreateSpanForRequest` from vercel edge options (#11371)
61+
- ref(v8): Remove deprecated `_reportAllChanges` option (#11393)
62+
- ref(v8): Remove deprecated `scope.getTransaction()` (#11365)
63+
- ref(v8): Remove deprecated methods on scope (#11366)
64+
- ref(v8): Remove deprecated span & transaction properties (#11400)
65+
- ref(v8): Remove Transaction concept (#11422)
66+
67+
### Other Changes
68+
69+
- feat: Add `trpcMiddleware` back to serverside SDKs (#11374)
70+
- feat: Implement timed events & remove `transaction.measurements` (#11398)
71+
- feat(browser): Bump web-vitals to 3.5.2 (#11391)
72+
- feat(feedback): Add `getFeedback` utility to get typed feedback instance (#11331)
73+
- feat(otel): Do not sample `options` and `head` requests (#11467)
74+
- feat(remix): Update scope `transactionName` when resolving route (#11420)
75+
- feat(replay): Bump `rrweb` to 2.12.0 (#11314)
76+
- feat(replay): Use data sentry element as fallback for the component name (#11383)
77+
- feat(sveltekit): Update scope `transactionName` when pageload route name is updated (#11406)
78+
- feat(tracing-internal): Reset propagation context on navigation (#11401)
79+
- feat(types): Add View Hierarchy types (#11409)
80+
- feat(utils): Use `globalThis` (#11351)
81+
- feat(vue): Update scope's `transactionName` when resolving a route (#11423)
82+
- fix(core): unref timer to not block node exit (#11430)
83+
- fix(node): Fix baggage propagation (#11363)
84+
- fix(web-vitals): Check for undefined navigation entry (#11311)
85+
- ref: Set preserveModules to true for browser packages (#11452)
86+
- ref(core): Remove duplicate logic in scope.update (#11384)
87+
- ref(feedback): Add font family style to actor (#11432)
88+
- ref(feedback): Add font family to buttons (#11414)
89+
- ref(gcp-serverless): Remove setting `.__sentry_transaction` (#11346)
90+
- ref(nextjs): Replace multiplexer with conditional exports (#11442)
91+
792
## 8.0.0-alpha.7
893

994
This is the seventh alpha release of Sentry JavaScript SDK v8, which includes a variety of breaking changes.

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
We welcome suggested improvements and bug fixes to the `@sentry/*` family of packages, in the form of pull requests on
1010
[`GitHub`](https://github.com/getsentry/sentry-javascript). The guide below will help you get started, but if you have
11-
further questions, please feel free to reach out on [Discord](https://discord.gg/Ww9hbqr).
11+
further questions, please feel free to reach out on [Discord](https://discord.gg/Ww9hbqr). To learn about some general
12+
SDK development principles check out the [SDK Development Guide](https://develop.sentry.dev/sdk/) in the Sentry
13+
Developer Documentation.
1214

1315
## Setting up an Environment
1416

MIGRATION.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ For IE11 support please transpile your code to ES5 using babel or similar and ad
4343

4444
**Next.js**: The Next.js SDK now supports Next.js 13.2.0+
4545

46+
**Express**: Complex router setups are only properly parametrized in Node 16+.
47+
4648
## 2. Package removal
4749

4850
We've removed the following packages:
@@ -569,7 +571,7 @@ Sentry.getGlobalScope().addEventProcessor(event => {
569571

570572
The `lastEventId` function has been removed. See [below](./MIGRATION.md#deprecate-lasteventid) for more details.
571573

572-
#### Remove `void` from transport return types
574+
#### Removal of `void` from transport return types
573575

574576
The `send` method on the `Transport` interface now always requires a `TransportMakeRequestResponse` to be returned in
575577
the promise. This means that the `void` return type is no longer allowed.
@@ -588,7 +590,7 @@ interface Transport {
588590
}
589591
```
590592

591-
#### Remove `addGlobalEventProcessor` in favor of `addEventProcessor`
593+
#### Removal of `addGlobalEventProcessor` in favor of `addEventProcessor`
592594

593595
In v8, we are removing the `addGlobalEventProcessor` function in favor of `addEventProcessor`.
594596

@@ -608,6 +610,23 @@ addEventProcessor(event => {
608610
});
609611
```
610612

613+
#### Removal of `Sentry.Handlers.trpcMiddleware()` in favor of `Sentry.trpcMiddleware()`
614+
615+
The Sentry tRPC middleware got moved from `Sentry.Handlers.trpcMiddleware()` to `Sentry.trpcMiddleware()`. Functionally
616+
they are the same:
617+
618+
```js
619+
// v7
620+
import * as Sentry from '@sentry/node';
621+
Sentry.Handlers.trpcMiddleware();
622+
```
623+
624+
```js
625+
// v8
626+
import * as Sentry from '@sentry/node';
627+
Sentry.trpcMiddleware();
628+
```
629+
611630
### Browser SDK (Browser, React, Vue, Angular, Ember, etc.)
612631

613632
Removed top-level exports: `Offline`, `makeXHRTransport`, `BrowserTracing`, `wrap`
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
console.log('One');
2+
console.warn('Two', { a: 1 });
3+
console.error('Error 2', { b: { c: [] } });
4+
5+
// Passed assertions _should not_ be captured
6+
console.assert(1 + 1 === 2, 'math works');
7+
// Failed assertions _should_ be captured
8+
console.assert(1 + 1 === 3, 'math broke');
9+
10+
Sentry.captureException('test exception');
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event } from '@sentry/browser';
3+
4+
import { sentryTest } from '../../../../../utils/fixtures';
5+
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
6+
7+
sentryTest('should capture console breadcrumbs', async ({ getLocalTestUrl, page }) => {
8+
const url = await getLocalTestUrl({ testDir: __dirname });
9+
10+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
11+
12+
expect(eventData.breadcrumbs).toEqual([
13+
{
14+
category: 'console',
15+
data: { arguments: ['One'], logger: 'console' },
16+
level: 'log',
17+
message: 'One',
18+
timestamp: expect.any(Number),
19+
},
20+
{
21+
category: 'console',
22+
data: { arguments: ['Two', { a: 1 }], logger: 'console' },
23+
level: 'warning',
24+
message: 'Two [object Object]',
25+
timestamp: expect.any(Number),
26+
},
27+
{
28+
category: 'console',
29+
data: { arguments: ['Error 2', { b: '[Object]' }], logger: 'console' },
30+
level: 'error',
31+
message: 'Error 2 [object Object]',
32+
timestamp: expect.any(Number),
33+
},
34+
{
35+
category: 'console',
36+
data: {
37+
arguments: ['math broke'],
38+
logger: 'console',
39+
},
40+
level: 'log',
41+
message: 'Assertion failed: math broke',
42+
timestamp: expect.any(Number),
43+
},
44+
]);
45+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
7+
defaultIntegrations: false,
8+
integrations: [Sentry.breadcrumbsIntegration()],
9+
sampleRate: 1,
10+
});

dev-packages/browser-integration-tests/suites/integrations/Breadcrumbs/dom/click/template.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<body>
88
<button id="button1" type="button">Button 1</button>
99
<button id="button2" type="button">Button 2</button>
10-
<button id="annotated-button" type="button" data-sentry-component="AnnotatedButton">Button 3</button>
10+
<button id="annotated-button" type="button" data-sentry-component="AnnotatedButton" data-sentry-element="StyledButton">Button 3</button>
11+
<button id="annotated-button-2" type="button" data-sentry-element="StyledButton">Button 4</button>
1112
</body>
1213
</html>

dev-packages/browser-integration-tests/suites/integrations/Breadcrumbs/dom/click/test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ sentryTest(
7878

7979
await page.goto(url);
8080
await page.locator('#annotated-button').click();
81+
await page.locator('#annotated-button-2').click();
8182

8283
const [eventData] = await Promise.all([promise, page.evaluate('Sentry.captureException("test exception")')]);
8384

@@ -88,6 +89,12 @@ sentryTest(
8889
message: 'body > AnnotatedButton',
8990
data: { 'ui.component_name': 'AnnotatedButton' },
9091
},
92+
{
93+
timestamp: expect.any(Number),
94+
category: 'ui.click',
95+
message: 'body > StyledButton',
96+
data: { 'ui.component_name': 'StyledButton' },
97+
},
9198
]);
9299
},
93100
);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const click = new MouseEvent('click');
2+
function kaboom() {
3+
throw new Error('lol');
4+
}
5+
Object.defineProperty(click, 'target', { get: kaboom });
6+
const input = document.getElementById('input1');
7+
input.dispatchEvent(click);
Lines changed: 10 additions & 0 deletions
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+
<title></title>
6+
</head>
7+
<body>
8+
<input id="input1" type="text" />
9+
</body>
10+
</html>

0 commit comments

Comments
 (0)