Skip to content

Commit 11cb00e

Browse files
authored
Merge pull request #11308 from getsentry/prepare-release/8.0.0-alpha.7
meta(changelog): Update changelog for v8.0.0-alpha.7
2 parents 7115492 + 2f6291d commit 11cb00e

File tree

27 files changed

+214
-535
lines changed

27 files changed

+214
-535
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,4 @@ packages/deno/build-test
5757
packages/deno/lib.deno.d.ts
5858

5959
# gatsby
60-
packages/gatsby/gatsby-browser.d.ts
6160
packages/gatsby/gatsby-node.d.ts

CHANGELOG.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

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

7-
## 8.0.0-alpha.6
7+
## 8.0.0-alpha.7
88

9-
This is the sixth alpha release of Sentry JavaScript SDK v8, which includes a variety of breaking changes.
9+
This is the seventh alpha release of Sentry JavaScript SDK v8, which includes a variety of breaking changes.
1010

1111
Read the [in-depth migration guide](./MIGRATION.md) to find out how to address any breaking changes in your code.
1212

@@ -16,6 +16,14 @@ Read the [in-depth migration guide](./MIGRATION.md) to find out how to address a
1616

1717
We now use OpenTelemetry under the hood to power performance monitoring and tracing in the Next.js SDK.
1818

19+
- **feat(v8/gatsby): Update SDK initialization for gatsby (#11292)**
20+
21+
In v8, you cannot initialize the SDK anymore via Gatsby plugin options. Instead, you have to configure the SDK in a
22+
`sentry.config.js` file.
23+
24+
We also removed the automatic initialization of `browserTracingIntegration`. You now have to add this integration
25+
yourself.
26+
1927
### Removal/Refactoring of deprecated functionality
2028

2129
- feat(v8): Remove addGlobalEventProcessor (#11255)
@@ -31,6 +39,7 @@ We now use OpenTelemetry under the hood to power performance monitoring and trac
3139
- ref(core): Remove `scope.setSpan()` and `scope.getSpan()` methods (#11051)
3240
- ref(profiling-node): Remove usage of getCurrentHub (#11275)
3341
- ref(v8): change integration.setupOnce signature (#11238)
42+
- ref: remove node-experimental references (#11290)
3443

3544
### Other Changes
3645

@@ -49,6 +58,10 @@ We now use OpenTelemetry under the hood to power performance monitoring and trac
4958
- fix(node): Use `suppressTracing` to avoid capturing otel spans (#11288)
5059
- fix(opentelemetry): Do not stomp span status when `startSpan` callback throws (#11170)
5160

61+
## 8.0.0-alpha.6
62+
63+
This version did not publish correctly due to a configuration issue.
64+
5265
## 8.0.0-alpha.5
5366

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

MIGRATION.md

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ New minimum supported browsers:
3939

4040
For IE11 support please transpile your code to ES5 using babel or similar and add required polyfills.
4141

42-
**React**: We no longer support React 15 in version 8 of the React SDK.
42+
**React**: The Next.js SDK now supports React 16+
43+
44+
**Next.js**: The Next.js SDK now supports Next.js 13.2.0+
4345

4446
## 2. Package removal
4547

@@ -979,6 +981,118 @@ const config = {
979981
export default withSentryConfig(config);
980982
```
981983

984+
### Gatsby SDK
985+
986+
#### Removal of Gatsby Initialization via plugin options
987+
988+
In v8, we are removing the ability to initialize the Gatsby SDK via plugin options. Instead, you should create a
989+
`sentry.config.js` file in the root of your project and initialize the SDK there.
990+
991+
```js
992+
// v7 - gatsby-config.js
993+
module.exports = {
994+
// ...
995+
plugins: [
996+
{
997+
resolve: '@sentry/gatsby',
998+
options: {
999+
dsn: process.env.SENTRY_DSN,
1000+
},
1001+
},
1002+
// ...
1003+
],
1004+
};
1005+
```
1006+
1007+
```js
1008+
// v8 - gatsby-config.js
1009+
module.exports = {
1010+
// ...
1011+
plugins: [
1012+
{
1013+
resolve: '@sentry/gatsby',
1014+
},
1015+
// ...
1016+
],
1017+
};
1018+
1019+
// v8 - sentry.config.js
1020+
import * as Sentry from '@sentry/gatsby';
1021+
1022+
Sentry.init({
1023+
dsn: '__PUBLIC_DSN__',
1024+
});
1025+
```
1026+
1027+
We've also added `enableClientWebpackPlugin` which allows you to enable or disable the `@sentry/webpack-plugin` in the
1028+
client-side build. By default, it is enabled.
1029+
1030+
```js
1031+
// v8 - gatsby-config.js
1032+
module.exports = {
1033+
// ...
1034+
plugins: [
1035+
{
1036+
resolve: '@sentry/gatsby',
1037+
options: {
1038+
enableClientWebpackPlugin: false,
1039+
},
1040+
},
1041+
// ...
1042+
],
1043+
};
1044+
```
1045+
1046+
#### Automatic adding of `browserTracingIntegration` for Gatsby
1047+
1048+
The Gatsby SDK no longer adds the `browserTracingIntegration` automatically. If you want to enable tracing in the
1049+
browser, you need to add it manually. Make sure to also configured a `tracePropagationTargets` value.
1050+
1051+
```js
1052+
// v7 - gatsby-config.js
1053+
module.exports = {
1054+
// ...
1055+
plugins: [
1056+
{
1057+
resolve: '@sentry/gatsby',
1058+
options: {
1059+
tracesSampleRate: 1.0,
1060+
},
1061+
},
1062+
// ...
1063+
],
1064+
};
1065+
```
1066+
1067+
```js
1068+
// v8 - gatsby-config.js
1069+
module.exports = {
1070+
// ...
1071+
plugins: [
1072+
{
1073+
resolve: '@sentry/gatsby',
1074+
},
1075+
// ...
1076+
],
1077+
};
1078+
1079+
// v8 - sentry.config.js
1080+
import * as Sentry from '@sentry/gatsby';
1081+
1082+
Sentry.init({
1083+
dsn: '__PUBLIC_DSN__',
1084+
integrations: [Sentry.browserTracingIntegration()],
1085+
1086+
// Set tracesSampleRate to 1.0 to capture 100%
1087+
// of transactions for performance monitoring.
1088+
// We recommend adjusting this value in production
1089+
tracesSampleRate: 1.0,
1090+
1091+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
1092+
tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/],
1093+
});
1094+
```
1095+
9821096
## 5. Behaviour Changes
9831097

9841098
- [Updated behaviour of `tracePropagationTargets` in the browser](./MIGRATION.md#updated-behaviour-of-tracepropagationtargets-in-the-browser-http-tracing-headers--cors)

dev-packages/e2e-tests/test-applications/nextjs-app-dir/assert-build.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ const buildStderr = fs.readFileSync('.tmp_build_stderr', 'utf-8');
3131
assert.match(buildStdout, / \/client-component/);
3232
assert.match(buildStdout, / \/client-component\/parameter\/\[\.\.\.parameters\]/);
3333
assert.match(buildStdout, / \/client-component\/parameter\/\[parameter\]/);
34-
assert.match(buildStdout, /λ \/server-component/);
35-
assert.match(buildStdout, /λ \/server-component\/parameter\/\[\.\.\.parameters\]/);
36-
assert.match(buildStdout, /λ \/server-component\/parameter\/\[parameter\]/);
34+
assert.match(buildStdout, /(λ|ƒ) \/server-component/);
35+
assert.match(buildStdout, /(λ|ƒ) \/server-component\/parameter\/\[\.\.\.parameters\]/);
36+
assert.match(buildStdout, /(λ|ƒ) \/server-component\/parameter\/\[parameter\]/);
3737

3838
export {};

dev-packages/e2e-tests/test-applications/sveltekit-2/test/errors.client.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ test.describe('client-side errors', () => {
66
test('captures error thrown on click', async ({ page }) => {
77
await page.goto('/client-error');
88

9-
await expect(page.getByText('Client error')).toBeVisible();
10-
119
const errorEventPromise = waitForError('sveltekit-2', errorEvent => {
1210
return errorEvent?.exception?.values?.[0]?.value === 'Click Error';
1311
});
1412

15-
const clickPromise = page.getByText('Throw error').click();
13+
await page.getByText('Throw error').click();
14+
15+
await expect(errorEventPromise).resolves.toBeDefined();
1616

17-
const [errorEvent, _] = await Promise.all([errorEventPromise, clickPromise]);
17+
const errorEvent = await errorEventPromise;
1818

1919
const errorEventFrames = errorEvent.exception?.values?.[0]?.stacktrace?.frames;
2020

dev-packages/e2e-tests/test-applications/sveltekit/test/errors.client.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ test.describe('client-side errors', () => {
66
test('captures error thrown on click', async ({ page }) => {
77
await page.goto('/client-error');
88

9-
await expect(page.getByText('Client error')).toBeVisible();
10-
119
const errorEventPromise = waitForError('sveltekit', errorEvent => {
1210
return errorEvent?.exception?.values?.[0]?.value === 'Click Error';
1311
});
1412

15-
const clickPromise = page.getByText('Throw error').click();
13+
await page.getByText('Throw error').click();
14+
15+
await expect(errorEventPromise).resolves.toBeDefined();
1616

17-
const [errorEvent, _] = await Promise.all([errorEventPromise, clickPromise]);
17+
const errorEvent = await errorEventPromise;
1818

1919
const errorEventFrames = errorEvent.exception?.values?.[0]?.stacktrace?.frames;
2020

packages/bun/src/sdk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function getDefaultIntegrations(_options: Options): Integration[] {
6666
* @example
6767
* ```
6868
*
69-
* const { addBreadcrumb } = require('@sentry/node-experimental');
69+
* const { addBreadcrumb } = require('@sentry/node');
7070
* addBreadcrumb({
7171
* message: 'My Breadcrumb',
7272
* // ...
@@ -76,7 +76,7 @@ export function getDefaultIntegrations(_options: Options): Integration[] {
7676
* @example
7777
* ```
7878
*
79-
* const Sentry = require('@sentry/node-experimental');
79+
* const Sentry = require('@sentry/node');
8080
* Sentry.captureMessage('Hello, world!');
8181
* Sentry.captureException(new Error('Good bye'));
8282
* Sentry.captureEvent({

packages/gatsby/.eslintrc.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,14 @@ module.exports = {
77
jsx: true,
88
},
99
// ignore these because they're not covered by a `tsconfig`, which makes eslint throw an error
10-
ignorePatterns: ['gatsby-browser.d.ts', 'gatsby-node.d.ts'],
10+
ignorePatterns: ['gatsby-node.d.ts'],
1111
overrides: [
1212
{
1313
files: ['scripts/**/*.ts'],
1414
parserOptions: {
1515
project: ['../../tsconfig.dev.json'],
1616
},
1717
},
18-
{
19-
files: ['./gatsby-browser.js'],
20-
env: {
21-
browser: true,
22-
node: false,
23-
},
24-
parserOptions: {
25-
sourceType: 'module',
26-
},
27-
},
2818
],
2919
extends: ['../../.eslintrc.js'],
3020
};

packages/gatsby/README.md

Lines changed: 21 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Official Sentry SDK for GatsbyJS
88

9-
Register the package as a plugin in `gatsby-config.js`:
9+
First register the package as a plugin in `gatsby-config.js`:
1010

1111
```javascript
1212
module.exports = {
@@ -23,66 +23,32 @@ module.exports = {
2323
};
2424
```
2525

26-
Options will be passed directly to `Sentry.init`. See all available options in
27-
[our docs](https://docs.sentry.io/error-reporting/configuration/?platform=javascript). The `environment` value defaults
28-
to `NODE_ENV` (or `'development'` if `NODE_ENV` is not set).
29-
30-
## GitHub Actions
31-
32-
The `release` value is inferred from `GITHUB_SHA`.
33-
34-
## Netlify
35-
36-
The `release` value is inferred from `COMMIT_REF`.
37-
38-
## Vercel
39-
40-
To automatically capture the `release` value on Vercel you will need to register appropriate
41-
[system environment variable](https://vercel.com/docs/v2/build-step#system-environment-variables) (e.g.
42-
`VERCEL_GITHUB_COMMIT_SHA`) in your project.
43-
44-
## Sentry Performance
45-
46-
To enable tracing, supply either `tracesSampleRate` or `tracesSampler` to the options. This will turn on the
47-
`BrowserTracing` integration for automatic instrumentation of pageloads and navigations.
26+
Then configure your `Sentry.init` call:
4827

4928
```javascript
50-
module.exports = {
51-
// ...
52-
plugins: [
53-
{
54-
resolve: '@sentry/gatsby',
55-
options: {
56-
dsn: process.env.SENTRY_DSN, // this is the default
29+
import * as Sentry from '@sentry/gatsby';
5730

58-
// A rate of 1 means all traces will be sent, so it's good for testing.
59-
// In production, you'll likely want to either choose a lower rate or use `tracesSampler` instead (see below).
60-
tracesSampleRate: 1,
31+
Sentry.init({
32+
dsn: '__PUBLIC_DSN__',
33+
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
6134

62-
// Alternatively:
63-
tracesSampler: samplingContext => {
64-
// Examine provided context data (along with anything in the global namespace) to decide the sample rate
65-
// for this transaction.
66-
// Can return 0 to drop the transaction entirely.
35+
// Set tracesSampleRate to 1.0 to capture 100%
36+
// of transactions for performance monitoring.
37+
// We recommend adjusting this value in production
38+
tracesSampleRate: 1.0,
6739

68-
if ('...') {
69-
return 0.5; // These are important - take a big sample
70-
} else if ('...') {
71-
return 0.01; // These are less important or happen much more frequently - only take 1% of them
72-
} else if ('...') {
73-
return 0; // These aren't something worth tracking - drop all transactions like this
74-
} else {
75-
return 0.1; // Default sample rate
76-
}
77-
},
78-
},
79-
},
80-
// ...
81-
],
82-
};
40+
// Capture Replay for 10% of all sessions,
41+
// plus for 100% of sessions with an error
42+
replaysSessionSampleRate: 0.1,
43+
replaysOnErrorSampleRate: 1.0,
44+
45+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
46+
tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/],
47+
});
8348
```
8449

85-
If you want to supply options to the `BrowserTracing` integration, use the `browserTracingOptions` parameter.
50+
The Gatsby SDK also automatically sets up sourcemaps uploading for you. To disable this functionality, set the
51+
`enableClientWebpackPlugin` option to be `false`.
8652

8753
```javascript
8854
module.exports = {
@@ -91,12 +57,7 @@ module.exports = {
9157
{
9258
resolve: '@sentry/gatsby',
9359
options: {
94-
dsn: process.env.SENTRY_DSN, // this is the default
95-
tracesSampleRate: 1, // or tracesSampler (see above)
96-
browserTracingOptions: {
97-
// disable creating spans for XHR requests
98-
traceXHR: false,
99-
},
60+
enableClientWebpackPlugin: false,
10061
},
10162
},
10263
// ...

0 commit comments

Comments
 (0)